Rafiq for developers
Rafiq Developer Platform

Islamic answers, with their evidence.

The engine behind rafiqai.app, as an API. Ask a question about Islam and get an answer grounded in the Qur'an, hadith and the rulings of scholars — with the sources it used.

Get an API key Read the docs
One request
curl https://api.rafiqai.app/v1/chat \
  -H "Authorization: Bearer rk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"message": "Can I combine prayers while travelling?"}'
TypeScript
import { Rafiq } from "rafiq-sdk";

const rafiq = new Rafiq();

const res = await rafiq.ask({
  message: "Can I combine prayers while travelling?"
});

if (res.answered) console.log(res.answer.summary);
Python
from rafiq import Rafiq

rafiq = Rafiq()

res = rafiq.ask(
    message="Can I combine prayers while travelling?"
)

if res.answered:
    print(res.answer.summary)

Typed SDKs for TypeScript and Python — they handle retries, tell the two rate limits apart, and will not let you read an answer without checking whether there was one.

The difference

It answers from a corpus, or it declines.

Rafiq is not a chat completion API, and it does not answer from a model's memory. Every ruling it states comes from a retrieved scholarly document — and when nothing in the corpus answers your question, it says so.

Out of scope
{
  "answered": false,
  "answer": {
    "summary": "I couldn't find
      anything on this."
  },
  "sources": []
}
In scope
{
  "answered": true,
  "intent": "applied_fiqh",
  "answer": { "summary": "..." },
  "sources": [
    { "title": "...", "url": "..." }
  ]
}

Handle the refusal

An abstention is a correct outcome, not a failure. Show it the way you would show a search that found nothing — if you retry on it, you will loop forever.

The surface

Six endpoints. Nothing to learn twice.

One answers questions. The rest are deterministic reference data — no model call, no retrieval, and safe to cache hard.

What it reads

Over a million documents, and it cites them.

Retrieval runs across the whole library on every question, and a cross-encoder reranks what survives. The documents behind an answer come back with it.

1,171,867documents indexed
226,782scholarly fatwas
36,108hadith narrations
35,029passages of tafsir
6,236verses of the Qur'an
754,575pages from classical works

Rafiq reports what the scholars ruled. It does not perform ijtihad, and it will decline rather than derive a ruling of its own.

What people build

For the ummah's own software.

01

Ask-a-question in your app

A masjid app or an Islamic-education product, answering from scholarship rather than from a general model.

02

Prayer times and Hijri dates

Without maintaining astronomical code or a calendar table of your own.

03

Qur'an text

Uthmani script by verse or range, for a reader, a widget or a memorisation tool.

04

A da'wah companion

A separate corpus and a different voice, for someone exploring Islam or working through a doubt.

What it costs

Free to start. No card, no call.

Sign in with your Nizam account, create a key, and you are calling it a minute later. Every response tells you exactly where you stand.

PlanPer minutePer month
Free30 requests5,000 calls
Partner120 requests100,000 calls

Your own 4xx errors do not count against the quota — getting a parameter wrong while you are building should not cost you anything. If you are building something useful and need more, ask.

Start building.

A Nizam account is all you need. The documentation is open, so read it first if you would rather look before signing in.