TMDB keywords API: plot tags and keyword ids
The TMDB keywords API returns the plot tags of a movie or TV series as id and name pairs, for example 14 tags for Fight Club (movie 550). Look up one keyword, list its movies 20 per page, or pass ids to discover with with_keywords. Movies reply under keywords and series under results, as in TMDB v3.
The TMDB keywords API returns the plot tags of a title. GET / gives the tags of a movie, 14 for Fight Club (movie 550). GET / gives the tags of a series, 29 for Breaking Bad (series 1396). Each tag is an id and a name, and the id works as a filter in with_keywords on discover. amodb serves these paths with the TMDB v3 JSON at https:/, and each call costs 1 request.
The paths below sit next to the TMDB discover API and the TMDB search API. Every endpoint is listed in the API reference, and the genre side of the same filters is on TMDB genre ids. To sync keyword ids into your own catalog, see the movie database API.
How do I get the keywords of a movie?
GET / returns the plot tags of one movie. A keyword is a short phrase such as a theme, a setting or a source type, and it has a numeric id you can reuse in discover.
The example loads the keywords of a movie and then asks discover for the most popular movies that share its first keyword.
curl -s "https://api.amodb.dev/3/movie/550/keywords" \
-H "Authorization: Bearer $AMODB_KEY"
curl -s "https://api.amodb.dev/3/discover/movie?with_keywords=818&sort_by=popularity.desc" \
-H "Authorization: Bearer $AMODB_KEY"const base = 'https://api.amodb.dev/3';
const headers = { Authorization: `Bearer ${process.env.AMODB_KEY}` };
const kw = await fetch(`${base}/movie/550/keywords`, { headers });
if (!kw.ok) throw new Error(`keywords failed with ${kw.status}`);
const { keywords } = await kw.json();
console.log(keywords.map((k) => `${k.id}:${k.name}`).join(', '));
if (keywords.length > 0) {
const first = keywords[0];
const found = await fetch(`${base}/discover/movie?with_keywords=${first.id}&sort_by=popularity.desc`, { headers });
if (!found.ok) throw new Error(`discover failed with ${found.status}`);
const page = await found.json();
console.log(first.name, page.results.slice(0, 5).map((m) => m.title));
}import os
import requests
base = "https://api.amodb.dev/3"
headers = {"Authorization": f"Bearer {os.environ['AMODB_KEY']}"}
r = requests.get(f"{base}/movie/550/keywords", headers=headers, timeout=10)
r.raise_for_status()
keywords = r.json()["keywords"]
print(", ".join(f"{k['id']}:{k['name']}" for k in keywords))
if keywords:
first = keywords[0]
d = requests.get(
f"{base}/discover/movie",
params={"with_keywords": first["id"], "sort_by": "popularity.desc"},
headers=headers,
timeout=10,
)
d.raise_for_status()
print(first["name"], [m["title"] for m in d.json()["results"][:5]])<?php
function amodb_get(string $url): array {
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('AMODB_KEY')],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status !== 200) {
throw new RuntimeException("amodb returned $status");
}
return json_decode($body, true);
}
$base = 'https://api.amodb.dev/3';
$keywords = amodb_get("$base/movie/550/keywords")['keywords'];
if ($keywords) {
$first = $keywords[0];
$found = amodb_get("$base/discover/movie?with_keywords={$first['id']}&sort_by=popularity.desc");
$titles = array_column(array_slice($found['results'], 0, 5), 'title');
echo $first['name'], ': ', implode(', ', $titles), PHP_EOL;
}package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
"time"
)
var client = &http.Client{Timeout: 10 * time.Second}
func get(path string, out any) error {
req, _ := http.NewRequest("GET", "https://api.amodb.dev/3"+path, nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("AMODB_KEY"))
res, err := client.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
return fmt.Errorf("amodb returned %s", res.Status)
}
return json.NewDecoder(res.Body).Decode(out)
}
type Keywords struct {
Keywords []struct {
ID int `json:"id"`
Name string `json:"name"`
} `json:"keywords"`
}
type Page struct {
Results []struct {
Title string `json:"title"`
} `json:"results"`
}
func main() {
var kw Keywords
if err := get("/movie/550/keywords", &kw); err != nil {
panic(err)
}
if len(kw.Keywords) == 0 {
return
}
first := kw.Keywords[0]
var page Page
if err := get(fmt.Sprintf("/discover/movie?with_keywords=%d&sort_by=popularity.desc", first.ID), &page); err != nil {
panic(err)
}
fmt.Println(first.Name)
for i, m := range page.Results {
if i == 5 {
break
}
fmt.Println(" ", m.Title)
}
}Parameters
movie_idpathrequiredNumeric movie id, for example550.api_keyqueryone of twoYour key. Use this or theAuthorization: Bearerheader.
Response fields
| Field | Type | Notes |
|---|---|---|
id | integer | The movie id. |
keywords | array | Objects with id and name. Empty when the movie has none. |
keywords[].id | integer | Keyword id. Use it in with_keywords and in the keyword paths below. |
keywords[].name | string | The keyword text. |
Example response
{
"id": 550,
"keywords": [
{ "id": 818, "name": "based on novel or book" },
{ "id": 825, "name": "support group" },
{ "id": 851, "name": "dual identity" }
]
}The real reply holds 14 keywords. This one is cut to the first 3. Keyword names are not translated, so language has no effect here.
How do I get the keywords of a TV series?
GET / takes the same key and returns the same objects, but the array is named results. The id in the path is the series id, for example 1396.
{
"id": 1396,
"results": [
{ "id": 1508, "name": "new mexico" },
{ "id": 2231, "name": "drug dealer" }
]
}The real reply holds 29 entries and this one is cut to the first 2. A client that serves both media types can read data.keywords ? and treat the two the same way.
How do I list the movies of a keyword?
| Method and path | Returns | Parameters |
|---|---|---|
GET / | { id, name } | none |
GET / | Paged movie list with id, page, results, total_pages, total_results | language, page |
Both paths use the numeric id from a keyword array. The movie list gives the same item shape as other movie lists, including genre_ids and poster_path, plus the keyword id at the top. Movies come ordered by popularity, 20 per page, and page runs from 1 to 500. include_adult is accepted and ignored. A page past total_pages returns an empty results array. There is no list of series for a keyword, so use / for TV.
How do I combine keywords with discover?
For anything beyond a plain list, filter in discover. It sorts, pages and combines keywords with other filters, and it covers TV as well as movies.
| Goal | Query string |
|---|---|
| Movies with one keyword | / |
| Movies with both of two keywords | / |
| Movies without a keyword | / |
| Series with a keyword | / |
| Series with either of two keywords | / |
| One keyword inside a genre | / |
A comma between ids means all of them. Write a vertical bar between ids, as in with_keywords=818|4565, to match any of them. Discover results are cached at the edge for 30 minutes.
How do I find a keyword id?
To turn text into an id, call GET /. It returns a paged list of id and name pairs, 20 per page. See search for the full set of search paths. A query that matches nothing returns 200 with an empty results array, total_pages 1 and total_results 0. Search answers are cached for 10 minutes, but every call still counts against your requests per minute, so debounce a typeahead box.
There is no call that lists every keyword. Search by name, or collect ids from the keyword arrays of the titles you already use, and keep them in your own table. One id per theme is enough, for example 818 for "based on novel or book".
Does the amodb keywords API match TMDB?
For reads, yes. The paths, parameters and JSON follow TMDB v3, so only the base URL and the key change.
| Item | On amodb |
|---|---|
| Base URL | https:/ instead of https:/ |
| Keyword paths | Same four paths and JSON: movie keywords, TV keywords, keyword record, keyword movies |
| Keyword search | GET /search/keyword, 20 results per page, empty list on no match |
| Names | Not translated, language has no effect on the keyword paths |
| Key | 32 lowercase hex characters, see TMDB API key |
| Rate | 20, 40 or 120 requests per minute per account, sliding 60 second window, no daily cap |
| Write methods | Not offered, they answer HTTP 405 |
Is the keywords API free for an app that earns money?
TMDB's API is free only until the app earns money. TMDB staff said on the TMDB forum (2026-10-15) that an app counts as commercial once it earns revenue from ads, in-app purchases, donations or subscriptions, and quoted a commercial plan at $149 a month for companies under $1M revenue (2026-03-31). amodb has no free tier. Plans start at $5.19 a month, which is 3.5% of $149, amodb charges nothing extra for commercial use on any plan, and it asks for no amodb logo or credit line. Third party credits still apply: credit JustWatch for where to watch data, and show the attribution credit wherever a text or image carries one. Compare the terms in amodb vs TMDB and read the plans on amodb pricing. A first client in TMDB API in Python covers search, details and caching.
Errors
| HTTP | status_code | When |
|---|---|---|
| 401 | 7 | The key is missing or wrong. |
| 402 | 36 | The plan period has ended. |
| 400 | 22 | page is not a whole number from 1 to 500 on /search/keyword or /. |
| 404 | 34 | No keyword with that id on /keyword/{keyword_id} and its movie list. |
| 405 | 37 | You used a write method on a keyword path. |
| 429 | 25 | You went over your requests per minute. Wait for the Retry-After seconds. |
An unknown movie or series id on the keywords paths is not a 404. You get HTTP 200 with the id and an empty array.
See error codes for every code and rate limits for plan limits.
Practical notes
- Store the keyword
id, not the name. A name can be reworded, an id does not change. - Keyword lists are cached with the details of the title, for 6 hours. A weekly refresh for tag pages is plenty.
- A single title has a short tag list. For theme pages, start from a keyword id and list its titles in discover, not the other way round.
- Use
without_keywordsto remove noise, for example a tag you never want on a family page. - An empty array is a valid answer for obscure titles. Hide the tag row instead of showing an error.