API Reference

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:

1
Topics — Top-level grouping (e.g., Programming, DevOps & Cloud, Database)
2
Categories — Specific subjects within a topic (e.g., Python, JavaScript, Go)
3
Tags — Freeform labels on quizzes (e.g., decorators, async, testing)

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.

GET/api/v1/categories

List 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.

No auth required60 requests/min rate limit

Response Fields

FieldTypeDescription
Topic Fields
idstringUnique topic identifier
namestringDisplay name (e.g., "Programming")
slugstringURL-friendly slug
iconstring | nullOptional icon identifier
categoriesarrayList of categories within this topic
Category Fields
categories[].idstringCategory ID — use this as categoryId when creating quizzes
categories[].namestringDisplay name (e.g., "Python")
categories[].slugstringURL-friendly slug
categories[].quizCountnumberNumber of published quizzes in this category
categories[].tagsstring[]Popular tags used across quizzes in this category, sorted by frequency (up to 20)

Example Request

bash
curl -X GET "https://quizapi.io/api/v1/categories" \
  -H "Content-Type: application/json"

Example Response

json
{
  "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.

bash
# 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 CodeDescription
200Categories retrieved successfully
429Rate limit exceeded (60 requests per minute)
500Internal server error