REST API  ·  v1.0  ·  Live

The Anime
Tracking API

A self-hosted backend for anime apps. JWT authentication, watchlists, watch history, episode progress — everything your app needs in one clean REST API.

Get Started → View Endpoints
EXAMPLE REQUEST
// Add an anime to your watchlist
const response = await fetch('/api/watchlist', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`
  },
  body: JSON.stringify({
    anime_id:   'one-piece',
    anime_name: 'One Piece',
    image_url:  'https://cdn.example.com/one-piece.jpg'
  })
});
// → { success: true, message: 'Added to watchlist' }
Registered Users
Watchlist Entries
Online Now
17
API Endpoints
Features

Everything you need

Built for anime streaming apps. Plug in authentication, tracking, and data management in minutes.

🔐
JWT Authentication
Register and login flows with signed JWT tokens. Protect routes with Bearer auth out of the box.
📋
Watchlist Management
Add, remove, and check anime in per-user watchlists. Includes check endpoints for UI state sync.
🕐
Watch History
Record and retrieve recently watched anime. Supports bulk clearing and per-user history.
📊
Episode Progress
Track playback progress per episode — current second, duration, percent complete, and completion state.
Realtime Online Count
Socket.io integration broadcasts live user counts. Connect your app for instant presence awareness.
💾
Admin & Backup
Full admin dashboard with data explorer, CSV export, and JSON backup/restore with merge or replace modes.
Reference

API Endpoints

All routes, methods, and auth requirements at a glance.

POST
/api/register
Register a new user account.
POST
/api/login
Login and receive a JWT token.
GET
/api/me
Get the current authenticated user's profile.
🔒 Bearer
GET
/api/watchlist
Get all watchlist entries for the user.
🔒 Bearer
GET
/api/watchlist?check=1&anime_id=…
Check if a specific anime is in the watchlist.
🔒 Bearer
POST
/api/watchlist
Add an anime to the watchlist.
🔒 Bearer
DELETE
/api/watchlist
Remove an anime from the watchlist.
🔒 Bearer
GET
/api/progress?anime_id=…
Get all episode progress for an anime.
🔒 Bearer
POST
/api/progress
Save episode progress { ep_id, anime_id, percent, current_sec, duration_sec, completed }.
🔒 Bearer
GET
/api/history?limit=10
Get recently watched anime for the user.
🔒 Bearer
POST
/api/history
Record a watch event { anime_id, anime_name, image_url }.
🔒 Bearer
DELETE
/api/history/all
Clear all watch history for the user.
🔒 Bearer
GET
/api/stats
Server stats: users, uptime, top anime.
GET
/api/admin/users
All registered users. Requires x-admin-key header.
🔑 Admin
GET
/api/admin/watchlist
Full watchlist across all users. Requires x-admin-key.
🔑 Admin
GET
/api/admin/backup
Download full JSON backup of all data.
🔑 Admin
POST
/api/admin/restore
Restore data from backup JSON. Body: { mode: "merge"|"replace", data: {...} }.
🔑 Admin
Quick Start

Up and running in minutes

Four steps from zero to a fully authenticated anime tracking integration.

1
Register a user
POST /api/register
Content-Type: application/json

{
  "username": "ash",
  "email":    "ash@pallet.town",
  "password": "pikachu123"
}
2
Login & get your token
POST /api/login
Content-Type: application/json

{
  "email":    "ash@pallet.town",
  "password": "pikachu123"
}
// → { token: "eyJhbGci..." }
3
Add to watchlist
POST /api/watchlist/
Authorization: Bearer {token}

{
  "anime_id":   "death-note",
  "anime_name": "Death Note",
  "image_url":  "https://..."
}
4
Save episode progress
POST /api/progress
Authorization: Bearer {token}

{
  "ep_id":        "dn-ep-1",
  "anime_id":     "death-note",
  "percent":      72,
  "current_sec":  1440,
  "completed":    false
}