v2.0.0 — trivia, image, quote, batch, daily & leaderboard

Smart Anime Quiz
REST API

Auto-generated trivia, image-based, and quote quizzes — with rate limiting, caching, batch mode, and retry logic. Free & open source.

~/aniquiz-api
$ curl https://aniquizapi.vercel.app/api/quiz?difficulty=medium

{
  "data": {
    "type": "trivia",
    "question": "Which anime features the phrase 'Bankai!'?",
    "correct": "Bleach",
    "options": ["Naruto", "Bleach", "One Piece", "Attack on Titan"],
    "difficulty": "medium"
  },
  "creator": "Shinei Nouzen",
  "version": "2.0.0"
}
GitHub Stars
Forks
6
Quiz Types
13
Endpoints

Engineered for Developers

Build anime quiz apps, bots, and games with a powerful, free API

Trivia Quizzes

Multiple-choice questions from OpenTDB anime category with easy, medium, hard difficulty levels.

Image Quizzes

Identify random anime characters from Jikan API images. Great for visual quiz apps.

Quote Quizzes

Guess who said the anime quote — with multi-source fallback for 99% uptime.

Batch Mode

Fetch 1–10 quizzes in a single request with /api/batch?count=5. NEW

Rate Limiting

30 requests/min per IP with proper 429 status and Retry-After headers. NEW

Smart Caching

In-memory TTL cache for image and quote APIs — faster responses, fewer rate limits. NEW

Retry & Fallback

Automatic retries with exponential backoff + 3-level quote API fallback chain. NEW

Health Endpoint

/health for uptime monitoring and status checks. NEW

Quiz of the Day

Daily featured quiz — same for everyone, changes at midnight UTC. /api/quiz-of-the-day NEW

Leaderboard

Submit scores with POST /api/score and view rankings at /api/leaderboard. NEW

SSE Stream

Real-time quiz-of-the-day push via Server-Sent Events at /api/stream. NEW

Field Filtering

Return only what you need: ?fields=question,options,correct. NEW

API Endpoints

Simple GET endpoints, ready for front-end or bot integration

GET /health

API health check — returns status, uptime, and timestamp.

$ curl https://aniquizapi.vercel.app/health
GET /api/quiz?difficulty=easy|medium|hard

Fetch a multiple-choice anime trivia question by difficulty level.

$ curl https://aniquizapi.vercel.app/api/quiz?difficulty=hard
GET /api/image-quiz

Returns a random anime character image. User must guess the character name.

$ curl https://aniquizapi.vercel.app/api/image-quiz
GET /api/quote-quiz

Returns a random anime quote. Guess who said it.

$ curl https://aniquizapi.vercel.app/api/quote-quiz
GET /api/random

Returns a quiz from any type — trivia, image, or quote. True random with fallback.

$ curl https://aniquizapi.vercel.app/api/random
GET /api/batch?count=3

Fetch multiple quizzes at once (1–10). NEW

$ curl https://aniquizapi.vercel.app/api/batch?count=5
GET /api/quiz-of-the-day

Daily featured quiz — same for everyone, changes at midnight UTC. NEW

$ curl https://aniquizapi.vercel.app/api/quiz-of-the-day
GET /api/categories

List available quiz categories with descriptions. NEW

$ curl https://aniquizapi.vercel.app/api/categories
GET /api/leaderboard

View score rankings. NEW

$ curl https://aniquizapi.vercel.app/api/leaderboard?mode=classic&limit=10
POST /api/score

Submit a quiz score. Body: {"name": "Player", "score": 100, "mode": "classic"} NEW

$ curl -X POST https://aniquizapi.vercel.app/api/score -H "Content-Type: application/json" -d '{"name":"Player","score":100}'
GET /api/stats

API usage statistics — total requests, cache hit rate, per-endpoint counts. NEW

$ curl https://aniquizapi.vercel.app/api/stats
GET /api/openapi

OpenAPI 3.0.3 specification — use with Swagger UI, Postman, or auto-generate clients. NEW

$ curl https://aniquizapi.vercel.app/api/openapi
GET /api/stream

Server-Sent Events stream for real-time quiz-of-the-day notifications. NEW

$ curl -N https://aniquizapi.vercel.app/api/stream

Try It Live

Test API endpoints directly from your browser

API Playground
Pick an endpoint and hit Send. Response renders below.

Open Source & Free Forever

Star the repo, report issues, or contribute new quiz sources

View on GitHub
stars forks MIT Licensed