Categories API
Discover the full taxonomy of topics and categories available on QuizAPI. Use this endpoint to find the right categoryId when creating quizzes, and to browse popular tags within each category.
Taxonomy Structure
QuizAPI organizes content in a three-level hierarchy:
When creating a quiz, pass a categoryId from this endpoint to properly place your quiz in the hierarchy. Tags are freeform — you can use existing ones or create new ones.
/api/v1/categoriesList Topics & Categories
Returns the full Topic → Category hierarchy with quiz counts and popular tags per category. No API key required — this is a public discovery endpoint.
Response Fields
| Field | Type | Description |
|---|---|---|
| Topic Fields | ||
id | string | Unique topic identifier |
name | string | Display name (e.g., "Programming") |
slug | string | URL-friendly slug |
icon | string | null | Optional icon identifier |
categories | array | List of categories within this topic |
| Category Fields | ||
categories[].id | string | Category ID — use this as categoryId when creating quizzes |
categories[].name | string | Display name (e.g., "Python") |
categories[].slug | string | URL-friendly slug |
categories[].quizCount | number | Number of published quizzes in this category |
categories[].tags | string[] | Popular tags used across quizzes in this category, sorted by frequency (up to 20) |
Example Request
curl -X GET "https://quizapi.io/api/v1/categories" \
-H "Content-Type: application/json"Example Response
{
"success": true,
"data": [
{
"id": "topic_abc123",
"name": "Programming",
"slug": "programming",
"icon": "code",
"categories": [
{
"id": "cat_python",
"name": "Python",
"slug": "python",
"quizCount": 12,
"tags": ["python", "basics", "data-structures", "oop"]
},
{
"id": "cat_javascript",
"name": "JavaScript",
"slug": "javascript",
"quizCount": 8,
"tags": ["javascript", "react", "typescript", "node"]
}
]
},
{
"id": "topic_def456",
"name": "DevOps & Cloud",
"slug": "devops-cloud",
"icon": null,
"categories": [
{
"id": "cat_docker",
"name": "Docker",
"slug": "docker",
"quizCount": 3,
"tags": ["docker", "containers", "devops"]
}
]
}
]
}Using Categories When Creating Quizzes
The typical workflow is to first call this endpoint to discover available categories, then use the category id as categoryId when creating a quiz via POST /api/v1/quizzes. The category name will be automatically derived from the ID.
# 1. Get the Python category ID from /api/v1/categories
# 2. Use it when creating a quiz:
curl -X POST "https://quizapi.io/api/v1/quizzes" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Python Decorators",
"description": "Test your knowledge of Python decorators",
"categoryId": "cat_python",
"difficulty": "HARD",
"tags": ["python", "decorators", "oop"],
"published": true
}'Response Codes
| Status Code | Description |
|---|---|
| 200 | Categories retrieved successfully |
| 429 | Rate limit exceeded (60 requests per minute) |
| 500 | Internal server error |