-
Notifications
You must be signed in to change notification settings - Fork 0
API
Yamtrack provides a REST API for programmatic access to media tracking. The API is authenticated exclusively with a static API key (per-user token) and returns JSON responses.
https://your-yamtrack-instance.com/api/
Every user has a static API token (the same token used for external integrations and webhooks, shown in the user profile under Account settings → Integrations). It is the only way to authenticate the REST API and the MCP server, so a single key works for both.
Send it as a Bearer token:
GET /api/auth/me/
Headers: Authorization: Bearer <api_token>
or via the X-API-Key header:
Headers: X-API-Key: <api_token>
The API key identifies the owning user, so all requests are scoped to that user's data.
GET /api/auth/me/
Headers: Authorization: Bearer <api_token>
GET /api/media/<media_type>/
media_type can be: movie, tv, anime, manga, game, book, comic, boardgame, season.
| Parameter | Type | Values / Default |
|---|---|---|
status |
string (enum) |
All (default), Completed, In progress, Planning, Paused, Dropped. Invalid values fall back to All. |
sort |
string (enum) |
score, title, progress, start_date, end_date. Any Item/model field is also accepted (no strict validation). No default (queryset default order). |
search |
string | Case-insensitive substring match on item__title. |
page |
int | Default 1. |
per_page |
int | Default 32. |
Example:
GET /api/media/movie/?status=Completed&sort=score&search=spider&page=1&per_page=32
POST /api/media/<media_type>/create/
Request body:
{
"media_id": "12345",
"source": "tmdb",
"start_date": "2024-01-01T10:00:00Z",
"end_date": "2024-01-02T12:30:00Z"
}Optional start_date and end_date accept an ISO 8601 datetime to set a custom
watch date instead of the current time.
POST /api/media/manual/create/
{
"media_type": "movie",
"title": "My Movie",
"status": "Completed",
"progress": 1
}GET /api/details/<source>/<media_type>/<media_id>/
GET /api/details/<source>/tv/<media_id>/season/<season_number>/
PATCH /api/media/<media_type>/<instance_id>/
{
"score": 8,
"status": "Completed",
"start_date": "2024-01-01T10:00:00Z",
"end_date": "2024-01-02T12:30:00Z"
}Optional start_date and end_date accept an ISO 8601 datetime.
DELETE /api/media/<media_type>/<instance_id>/delete/
POST /api/sync/<source>/<media_type>/<media_id>/
POST /api/media/<media_type>/<instance_id>/progress/
Request body (increase or decrease):
{
"operation": "increase"
}{
"operation": "decrease"
}GET /api/home/
Returns in-progress and planning sections for the authenticated user.
| Parameter | Type | Values / Default |
|---|---|---|
sort |
string (enum) |
upcoming (default), recent, completion, episodes_left, title. |
Example:
GET /api/home/?sort=recent
POST /api/episodes/
{
"media_id": "999",
"source": "tmdb",
"season_number": 1,
"episode_number": 1,
"end_date": "2024-01-02T12:30:00Z"
}Optional end_date accepts an ISO 8601 datetime for a custom watch date/time.
Re-sending the same media_id/season_number/episode_number updates the
end_date of the most recent instance (returns 200 OK) instead of creating a
new entry. Omit end_date to use the current time.
GET /api/search/?q=<query>&media_type=<media_type>
| Parameter | Type | Values / Default |
|---|---|---|
q |
string | Required. Search query. |
media_type |
string (enum) |
Required. tv, movie, anime, manga, game, book, comic, boardgame. |
source |
string | Optional. Defaults to the default source for the media type. |
page |
int | Default 1. |
Example:
GET /api/search/?q=spider&media_type=movie&source=tmdb&page=1
GET /api/history/<source>/<media_type>/<media_id>/
Returns change history for a media item.
| Parameter | Type | Values / Default |
|---|---|---|
season_number |
int | Optional. |
episode_number |
int | Optional. |
Example:
GET /api/history/tmdb/movie/12345/?season_number=1&episode_number=3
GET /api/statistics/
Returns aggregated statistics for the authenticated user.
| Parameter | Type | Values / Default |
|---|---|---|
start-date |
string (date YYYY-MM-DD or all) |
Default: one year ago. |
end-date |
string (date YYYY-MM-DD or all) |
Default: today. Use all/all to include everything. |
Example:
GET /api/statistics/?start-date=2024-01-01&end-date=2024-12-31
| Source | Media Types |
|---|---|
tmdb |
movie, tv |
mal |
anime, manga |
igdb |
game |
openlibrary |
book |
custom |
all |
PlanningIn progressCompletedDroppedPaused