Skip to content
GET /v1/categories

All trivia categories

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/opentdb-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

curl "https://api.oanor.com/opentdb-api/v1/categories" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/opentdb-api/v1/categories", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/opentdb-api/v1/categories");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/opentdb-api/v1/categories",
    headers={"x-oanor-key": "oanor_test_..."}
)

Example response

A real response from this endpoint, captured by the latest health check.

{
    "data": {
        "count": 24,
        "categories": [
            {
                "id": 9,
                "name": "General Knowledge"
            },
            {
                "id": 10,
                "name": "Entertainment: Books"
            },
            {
                "id": 11,
                "name": "Entertainment: Film"
            },
            {
                "id": 12,
                "name": "Entertainment: Music"
            },
            {
                "id": 13,
                "name": "Entertainment: Musicals & Theatres"
            },
            {
                "id": 14,
                "name": "Entertainment: Television"
            },
            {
                "id": 15,
                "name": "Entertainment: Video Games"
            },
            {
                "id": 16,
                "name": "Entertainment: Board Games"
            },
            {
                "id": 17,
                "name": "Science & Nature"
            },
            {
                "id": 18,
                "name": "Science: Computers"
            },
            {
                "id": 19,
                "name": "Science: Mathematics"
            },
            {
                "id": 20,
                "name": "Mythology"
            },
            {
                "id": 21,
                "name": "Sports"
            },
            {
                "id": 22,
                "name": "Geography"
            },
            {
                "id": 23,
                "name": "History"
            },
            {
                "id": 24,
                "name": "Politics"
            },
            {
                "id": 25,
                "name": "Art"
            },
            {
                "id": 26,
                "name": "Celebrities"
            },
            {
                "id": 27,
                "name": "Animals"
            },
            {
                "id": 28,
                "name": "Vehicles"
            },
            {
                "id": 29,
                "name": "Entertainment: Comics"
            },
            {
                "id": 30,
                "name": "Science: Gadgets"
            },
            {
                "id": 31,
                "name": "Entertainment: Japanese Anime & Manga"
            },
            {
                "id": 32,
                "name": "Entertainment: Cartoon & Animations"
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-08T09:48:48.310Z",
        "request_id": "051ff1f1-0dda-4353-9601-47241ff5712a"
    },
    "status": "ok",
    "message": "Categories retrieved successfully",
    "success": true
}