REST API Reference

ExamsWave Developer API

Programmatically pull practice exam questions, vector-rendered math/science diagrams, and full exam blueprints directly into your LMS or learning application.

Base Request Format

GET /api.php?action=fetch_questions

// Header

Authorization: Bearer YOUR_API_KEY

// Request URL

https://examswave.com/api.php?action=fetch_questions&framework=alevels&subject=mathematics&limit=1

Authentication

The ExamsWave API authenticates requests using Bearer Tokens in the HTTP header or via query string parameter (?key=...).

HEADER Option A: Bearer Token (Recommended)

Provide your API key in the standard Authorization header with every request.

Authorization: Bearer YOUR_API_KEY

URL PARAMETER Option B: Query Parameter

Pass the key directly in the request query string for rapid browser testing.

https://examswave.com/api.php?action=ping&key=YOUR_API_KEY

API Endpoints Reference

All API calls execute through the main gateway controller /api.php using the action parameter.

GET action=ping
Aliases: auth_check, check

Validates your API credentials, subscription status, user role, and dynamic monthly rate quota.

Sample Request URL

https://examswave.com/api.php?action=ping&key=YOUR_API_KEY

JSON Response Object (200 OK)

{
  "status": "success",
  "message": "API key validated successfully.",
  "user": {
    "id": 101,
    "name": "Jane Doe",
    "email": "jane@example.com",
    "role": "student",
    "subscription_status": "active",
    "subscription_expires_at": "2026-12-31 23:59:59"
  },
  "api_quota": {
    "monthly_limit": 5000,
    "status": "Active"
  }
}
GET action=get_frameworks
Aliases: blueprints, exams

Returns available active exam blueprints, subject mappings, time limits, and supported languages.

Query Parameters

Parameter Type Required Description
q string Optional Search query for exam name or subjects (e.g., alevels)
country string Optional Filter blueprints by country code (e.g., US, UK)
id integer Optional Fetch a single blueprint by explicit ID

Sample Response (200 OK)

{
  "status": "success",
  "count": 1,
  "data": [
    {
      "id": 1,
      "exam_name": "A-Levels Advanced",
      "country": "UK",
      "total_exam_questions": 100,
      "time_limit_minutes": 180,
      "is_active": 1,
      "subjects": ["Mathematics", "Physics", "Chemistry"],
      "languages": ["en"]
    }
  ]
}
GET action=fetch_questions
Aliases: questions

Retrieves practice questions with options, vector XML diagrams, and step-by-step solutions.

Query Parameters

Parameter Type Required Description
framework / blueprint_id string / int Yes Framework search term (e.g., alevels) or explicit blueprint_id integer
subject string Optional Filter by module subject (e.g., mathematics, biology)
limit integer Optional Number of question items to return (Default: 50, Max: 100)

Sample Connection Requests

// Fetch by framework name & subject
https://examswave.com/api.php?action=fetch_questions&key=YOUR_API_KEY&framework=alevels&subject=mathematics&limit=5
// Fetch by Blueprint ID
https://examswave.com/api.php?action=fetch_questions&key=YOUR_API_KEY&blueprint_id=12&limit=10

JSON Response Object (200 OK)

{
  "status": "success",
  "filter": "alevels",
  "count": 1,
  "data": [
    {
      "id": 2409,
      "blueprint_id": 1,
      "subject": "Mathematics",
      "question_text": "Which coordinate accurately marks the point of inflection on the curve?",
      "image_xml": "",
      "correct_option": "A",
      "explanation": "The point of inflection occurs where concavity changes sign at coordinate (0,0).",
      "created_at": "2026-01-15 10:30:00",
      "options": {
        "A": "(0, 0) — Turning point coordinate threshold",
        "B": "(50, 10) — Maximum boundary curve",
        "C": "(100, 50) — Axis intercept",
        "D": "(190, 10) — Endpoint"
      }
    }
  ]
}

Error Handling & Status Codes

401 UNAUTHORIZED

Returned when the API key is invalid or missing entirely from the headers/query string.

{
  "status": "error",
  "code": 401,
  "message": "Unauthorized: Invalid API Key or user account not found."
}
403 FORBIDDEN

Returned when student accounts request questions without an active subscription or single access pass.

{
  "status": "error",
  "code": 403,
  "message": "Access denied: Active subscription required to access subject question pools."
}