Included
Get a subject tree
GET
/api/v1/subjects/{subjectId}/treeIncluded- Scope
curriculum:read- Price
- Included once you've topped up
One subject with both of its trees: the teaching curriculum and the exam specification hierarchy, each as topics containing subtopics.
What to know
- THE TWO TREES ARE DIFFERENT COLLECTIONS. Both are called "subtopics" here so one renderer handles either, but an id from `topics` and an id from `examTopics` come from separate hierarchies. The spec-points endpoint tells you which one an id belongs to.
- Past papers and mark schemes are not part of this payload and never will be. They are exam board copyright.
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| subjectId | string (path) | Yes | A 24-character hex id from GET /subjects. |
Example request
curl
curl "https://www.revisiongenie.com/api/v1/subjects/6612f0a1c3b4d5e6f7a80912/tree" \
-H "Authorization: Bearer rgk_live_YOUR_KEY_HERE"Example response
json
{
"subject": {
"id": "6612f0a1c3b4d5e6f7a80912",
"name": "Biology",
"qualification": "GCSE",
"examBoard": "AQA"
},
"topics": [
{
"id": "6612f0b2c3b4d5e6f7a80a01",
"name": "Cell biology",
"subtopics": [
{ "id": "6612f0c3c3b4d5e6f7a80b01", "name": "Cell structure" },
{ "id": "6612f0c3c3b4d5e6f7a80b02", "name": "Cell division" }
]
}
],
"examTopics": [
{
"id": "6612f0d4c3b4d5e6f7a80c01",
"name": "Paper 1: Cell biology and organisation",
"subtopics": [
{ "id": "6612f0e5c3b4d5e6f7a80d01", "name": "Eukaryotes and prokaryotes" }
]
}
]
}Errors
Every error carries the same shape: a stable error code to branch on and a message for a human. Codes specific to this endpoint come first.
| Code | Status | When |
|---|---|---|
| topup_required | 402 | This developer account has never topped up. The data endpoints are included from your first top-up onwards, whatever your balance does afterwards. The body carries a top-up link. |
| invalid_id | 400 | subjectId is not a 24-character hex id. |
| not_found | 404 | No such subject, or the subject is inactive or user-created. All three read the same from outside. |
| invalid_key | 401 | The key is missing, malformed, revoked, expired, or is not a developer key. |
| forbidden | 403 | The key is valid but does not hold the scope this endpoint requires. |
| suspended | 403 | The developer account is suspended. Data reads stop as well as billable calls. |
| rate_limited | 429 | The key went past its ceiling: 120 calls a minute overall, 30 a minute on the paid endpoints. Also returned after repeated failed authentication from one address. |
| server_error | 500 | Something failed on our side. Retry; a paid call is refunded. |