On this page

Public API

v1

Read-only access to QBookBd content: subjects and topics, MCQs, exam papers, CQ questions, blog posts, job posts, books and solutions. Every request requires an API key.

Overview

Base URL

https://qbookbd.com/api/v1

Response format

JSON (application/json)

Version 1 is stable. Breaking changes will be released under a new version prefix (/api/v2) so existing integrations keep working.

Authentication

Log in to your QBookBd account, open Settings → API Keys, and create a key. The full key is shown only once.

  1. Create an account or log in.
  2. Go to Settings → API Keys.
  3. Create a key, copy it, and store it securely.
  4. Send it with every request in the X-API-Key header.

Header (recommended)

X-API-Key: qb_live_your_key_here

Bearer token (also accepted)

Authorization: Bearer qb_live_your_key_here

Keep your key secret

Keys are stored hashed. If a key leaks, revoke it immediately from Settings → API Keys. Never embed a key in public browser code or commit it to a repository.

Quick start

curl "https://qbookbd.com/api/v1/subjects" \
  -H "Accept: application/json" \
  -H "X-API-Key: qb_live_your_key_here"

Successful response:

{
  "success": true,
  "message": null,
  "data": [
    { "id": 1, "name": "বাংলা", "description": null, "mcqs_count": 120 }
  ]
}

Rate limits

Limits are applied per API key. The default is 60 requests per minute per key. Invalid key attempts are additionally limited per IP address. Future paid plans will raise the per-key limit.

HeaderMeaning
X-RateLimit-LimitRequests allowed in the current window.
X-RateLimit-RemainingRequests remaining in the current window.
X-RateLimit-ResetUnix timestamp when the window resets.
Retry-AfterSeconds to wait after a 429 response.

When the limit is exceeded the API returns 429 Too Many Requests. Respect the headers and back off instead of retrying in a tight loop.

Conventions

Portals

Content is separated into three portals: jobs, teacher and law. Choose one explicitly:

X-Portal: jobs

You can also use ?portal=law. Without either, the API uses jobs.

Pagination

Paginated endpoints accept page and per_page. The paginator lives inside data:

{
  "success": true,
  "data": {
    "current_page": 1,
    "data": [ ... ],
    "last_page": 8,
    "per_page": 20,
    "total": 152
  }
}

Errors

Errors use the same envelope with success: false and a human-readable message.

Endpoints

All paths below are relative to https://qbookbd.com/api/v1.

Subjects & topics

MethodPathDescription
GET /subjects List active subjects with MCQ counts.
GET /subjects/{subject} Subject detail with its topic tree.
GET /subjects/{subject}/topics Flat list of topics for a subject.
GET /subjects/{subject}/mcqs Paginated MCQs in a subject. Supports topic_id and per_page (max 50).

MCQs

MethodPathDescription
GET /mcqs Paginated MCQ list. Supports topic_id, search and per_page (max 100).
GET /mcqs/{mcq} Single MCQ with options, explanation and metadata.
GET /mcqs/{mcq}/explanations Community explanations for an MCQ.

Exam papers

MethodPathDescription
GET /exam-papers Paginated exam papers. Supports type, designation, year, paper_type, search, sort and per_page.
GET /exam-papers/years Distinct exam years available.
GET /exam-papers/{examPaper} Exam paper detail with its MCQs. Supports subject_id, topic_id and page.

Designations & question types

MethodPathDescription
GET /designations Job designations that have published papers. Supports tag.
GET /designations/{designation}/exam-papers Published papers for a designation. Supports per_page (max 50).
GET /question-types Active question types.

Blog posts

MethodPathDescription
GET /blog-posts Published blog posts. Supports tag, search and per_page (max 50).
GET /blog-posts/{slug} Full blog post by slug.

CQ questions

MethodPathDescription
GET /cq-questions Published creative (CQ) questions. Supports subject_id, topic_id, search and per_page (max 50).
GET /cq-questions/{slug} Single CQ question with sub-questions and linked papers.

Job posts & solutions

MethodPathDescription
GET /job-posts Published job posts. Supports topic_id, search and per_page (max 100).
GET /job-posts/{jobPost} Job post detail with approved solutions.
GET /solutions Approved solutions. Supports job_post_id and per_page (max 100).

Books & shop catalog

MethodPathDescription
GET /books Active books. Supports category_id, type, format, price, publisher_id.
GET /books/{book} Book detail.

Site feeds & search

MethodPathDescription
GET /home Community posts feed. Supports page.
GET /home/sidebar Sidebar subjects, papers and recent MCQs.
GET /search?q=term Search published papers and active MCQs. q must be at least 2 characters.

Examples

JavaScript (fetch)

const res = await fetch("https://qbookbd.com/api/v1/mcqs?topic_id=12&per_page=20", {
  headers: {
    Accept: "application/json",
    "X-API-Key": process.env.QBOOK_API_KEY,
    "X-Portal": "jobs",
  },
});

if (!res.ok) {
  throw new Error(`QBook API error: ${res.status}`);
}

const body = await res.json();
console.log(body.data.data);

PHP (cURL)

$ch = curl_init("https://qbookbd.com/api/v1/exam-papers?year=2025");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Accept: application/json",
        "X-API-Key: " . getenv("QBOOK_API_KEY"),
    ],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);

Status codes

StatusMeaning
200Success.
401Missing, invalid, revoked or expired API key.
403The key lacks the required scope, or the owning account is blocked.
404The resource does not exist or is not published.
422Validation error (for example, an invalid query parameter).
429Rate limit exceeded. Read Retry-After.

Security best practices

  • Call the API from your server. Do not ship the key to browsers or mobile apps where it can be extracted.
  • Use one key per integration so you can revoke a single site without breaking others.
  • Set an expiry date for temporary integrations.
  • Rotate keys periodically and immediately after any suspected leak.
  • Cache responses responsibly; respect Retry-After and rate-limit headers.
  • Do not use the API to republish content without permission.

Questions or higher limits?

Contact us through the contact page and mention your API key prefix and use case.

Tags: primary psc bcs upazila-officer ntrca