Base URL

Loading...

All API endpoints are prefixed with /api

Authentication

Most endpoints are publicly accessible. Protected endpoints require a JWT token in the Authorization header:

Authorization: Bearer <your_jwt_token>

Get a token by calling POST /api/auth/login with admin credentials.

Health Check

1
GET /api/health Check API status Public
Description

Returns the current API status and timestamp.

Response Example
{ "success": true, "message": "API is running", "timestamp": "2025-01-15T10:30:00.000Z" }

Authentication

3
POST /api/auth/login Admin login Public
Description

Authenticate with admin username and password to get a JWT token.

Request Body
{ "username": "admin", "password": "admin123" }
Response Example
{ "success": true, "data": { "token": "eyJhbGciOiJIUzI1NiIs...", "user": { "id": 0, "email": "admin@local", "role": "admin" } } }
POST /api/auth/google Google OAuth login Public
Description

Authenticate with Google ID token. Requires Google OAuth to be configured.

Request Body
{ "idToken": "google_id_token_here" }
GET /api/auth/verify Verify JWT token Public
Description

Verify if the provided JWT token is valid. Send token in Authorization header.

Headers
Authorization: Bearer <jwt_token>

Anime

10
GET /api/anime Get all anime Public
Description

Get all anime with pagination, search, and filters.

Query Parameters
Parameter Type Description
page number optional Page number (default: 1)
limit number optional Items per page (default: 20, max: 100)
search string optional Search by anime title
status string optional Filter by status: ongoing, completed
genre string optional Filter by genre
Response Example
{ "success": true, "data": [ { "id": 1, "title": "One Piece", "slug": "one-piece", "posterUrl": "https://...", "status": "ongoing", "rating": "8.5", "genres": ["Action", "Adventure"] } ], "pagination": { "page": 1, "limit": 20, "total": 150, "totalPages": 8 } }
GET /api/anime/browse Browse from source Public
Description

Browse anime directly from Anoboy source (live scraping).

Query Parameters
Parameter Type Description
letter string optional Filter by first letter (A-Z, 0-9)
GET /api/anime/:identifier Get anime by ID/slug Public
Description

Get anime details by ID (number) or slug (string). Includes episode list.

Path Parameters
Parameter Type Description
identifier string|number required Anime ID or slug
GET /api/anime/:id/episodes Get anime episodes Public
Description

Get all episodes for a specific anime.

Response Example
{ "success": true, "data": [ { "id": 1, "episodeNumber": 1, "title": "Episode 1", "duration": 24, "releaseDate": "2025-01-01" } ] }
POST /api/anime/scrape Scrape anime from URL Public
Description

Scrape and save anime from Anoboy URL. Automatically downloads poster and scrapes episodes in background.

Request Body
{ "url": "https://anoboy.be/anime/one-piece/" }
POST /api/anime/bulk-import Bulk import anime Public
Description

Bulk import all anime from Anoboy A-Z index. Runs in background.

Request Body (optional)
{ "letters": ["A", "B", "C"] }

If not specified, imports all letters A-Z and 0-9.

POST /api/anime/download-images Download missing posters Public
Description

Download and save poster images for anime that don't have local copies. Runs in background.

POST /api/anime/:id/scrape-episodes Scrape episodes Public
Description

Scrape all episodes for an anime from Anoboy. Runs in background.

POST /api/anime Create anime Auth Required
Description

Create a new anime entry manually. Requires authentication.

Request Body
{ "title": "Anime Title", "synopsis": "Description...", "posterUrl": "https://...", "genres": ["Action", "Adventure"], "status": "ongoing", "rating": "8.5" }
PUT /api/anime/:id Update anime Auth Required
Description

Update an existing anime. Requires authentication.

DELETE /api/anime/:id Delete anime Auth Required
Description

Delete an anime and all its episodes. Requires authentication.

Episodes

4
GET /api/episodes/:id Get episode by ID Public
Description

Get episode details including video source URL and parent anime info.

Response Example
{ "success": true, "data": { "id": 1, "animeId": 1, "episodeNumber": 1, "title": "Episode 1 - The Beginning", "videoSourceUrl": "https://...", "duration": 24, "releaseDate": "2025-01-01", "anime": { "id": 1, "title": "One Piece" } } }
POST /api/episodes Create episode Auth Required
Description

Create a new episode for an anime. Requires authentication.

Request Body
{ "animeId": 1, "episodeNumber": 1, "title": "Episode 1", "videoSourceUrl": "https://...", "duration": 24, "releaseDate": "2025-01-01" }
PUT /api/episodes/:id Update episode Auth Required
Description

Update an existing episode. Requires authentication.

DELETE /api/episodes/:id Delete episode Auth Required
Description

Delete an episode. Requires authentication.

Response Format

Success Response
{ "success": true, "data": { ... }, "message": "Optional success message" }
Error Response
{ "success": false, "message": "Error description" }
Paginated Response
{ "success": true, "data": [ ... ], "pagination": { "page": 1, "limit": 20, "total": 100, "totalPages": 5 } }

Rate Limiting

API requests are rate limited to prevent abuse:

Limit Window Description
100 requests 15 minutes Per IP address

When rate limited, you'll receive a 429 Too Many Requests response.