---
seo:
  description: >-
    Search and read classical Arabic Islamic-heritage books from your own code.
    The API serves the same library as the Qaf MCP server.
sidebar:
  label: Overview
title: Qaf API
---
Search and read classical Arabic Islamic-heritage books from your own code. The API serves the same library as the Qaf MCP server.

**Base URL:** `https://api.qaf.ai/v1`

**Authentication:** create a key in qaf.ai **Settings › API keys** and send it as a bearer token: `Authorization: Bearer qaf_sk_…`. A 401 response carries a `WWW-Authenticate: Bearer` challenge. Keep keys on your server, never in a browser or app. **Try it** in this reference sends your key from the browser straight to api.qaf.ai, and **Remember on this device** keeps it in this browser: use a separate key for testing and revoke it afterwards.

**Rate limits:** 60 requests per minute per account, across all its keys, and 1,000 searches per day. A 429 names the limit in `data.reason`; for `minute`, retry after `Retry-After` seconds.

**HEAD** works wherever GET does, with GET's status and headers and no body, and counts against the rate limit like GET.

**Errors** are JSON with `code`, `status`, `message` and sometimes `data`. Every response except a CORS preflight has an `X-Request-Id` header; include it when you email us at contact@qaf.ai.

Guides and examples: [developers.qaf.ai](https://developers.qaf.ai/api).

Version 1.0.0

Base URL: `https://api.qaf.ai/v1`

## Passages

Search the library, then read passages and their neighbours.

- [`POST /search`](/reference/passages/search-passages) — Search passages.
- [`GET /passages/{id}`](/reference/passages/get-passage) — Read a passage.

## Catalog

Resolve author and book names to the IDs search filters take.

- [`GET /catalog/lookup`](/reference/catalog/lookup-catalog) — Look up an author or book.
