TMDB image sizes and the image base URL
TMDB image sizes on amodb are w92, w154, w185, w300, w342, w500, w780, w1280, h632 and original. Build a URL as https://img.amodb.dev/t/p/{size}/{file}. Images need no key, do not count toward your rate and stay in the edge cache for 30 days. GET /3/configuration returns the base URLs.
amodb serves 10 image sizes: w92, w154, w185, w300, w342, w500, w780, w1280, h632 and original. Pick the smallest one that covers the displayed width times the screen pixel ratio. A poster at w500 is 500 px wide and about 750 px high. Image calls need no key and count as 0 requests on the rate limits of your plan, so you can load as many as a page needs.
What are the TMDB image sizes?
Every size is a fixed width, except h632, which is a fixed height, and original, which is the source file. The heights below follow the usual 2:3 poster and 16:9 backdrop shapes and can differ by a pixel on a real file.
| Size | Fixed side | Height at 2:3 (poster, profile) | Height at 16:9 (backdrop, still) | Good for |
|---|---|---|---|---|
w92 | 92 px wide | 138 px | 52 px | Search suggestions |
w154 | 154 px wide | 231 px | 87 px | Dense lists |
w185 | 185 px wide | 278 px | 104 px | Grids on desktop, profile photos |
w300 | 300 px wide | 450 px | 169 px | Backdrop thumbnails, OMDb Poster |
w342 | 342 px wide | 513 px | 192 px | Grids on phones with high density screens |
w500 | 500 px wide | 750 px | 281 px | Detail pages |
w780 | 780 px wide | 1,170 px | 439 px | Large posters, medium backdrops |
w1280 | 1,280 px wide | 1,920 px | 720 px | Full width backdrops |
h632 | 632 px high | 632 px (about 421 wide) | 632 px (about 1,124 wide) | Profile photos at full height |
original | Source size | Source size | Source size | Downloads and print |
Posters are 2:3. Set width and height on the <img> so the page does not shift while it loads. For the exact lists per image type, read GET /3/configuration, which returns the same structure as TMDB.
https://img.amodb.dev/t/p/{size}/{file}| Part | Value | Example |
|---|---|---|
| Secure base URL | images.secure_base_url from /3/configuration | https:/ |
| Plain base URL | images.base_url | http:/ |
| Size | One of the 10 sizes | w500 |
| File | The path from a response field, starting with / | / |
{file} is the path from a response field such as poster_path, backdrop_path, profile_path, still_path or logo_path. It already starts with /.
For the endpoint level reference, including which response fields hold image paths, see the TMDB image URL page. To list posters for a title, use the movie poster API.
https://img.amodb.dev/t/p/w500/pB8BM7pdSp6B6Ih7QZ4DrQ3PmJK.jpgWhich size should I use?
Multiply the displayed width in CSS pixels by the screen pixel ratio, then take the next size up that exists.
| Displayed width | 1x screen | 2x screen | 3x screen |
|---|---|---|---|
| 92 px | w92 | w185 | w342 |
| 154 px | w154 | w342 | w500 |
| 185 px | w185 | w500 | w780 |
| 342 px | w342 | w780 | original |
| 500 px | w500 | original | original |
The table uses poster sizes. For backdrops, the next size up from w780 is w1280.
What does the image host return for a wrong size or file?
| Request | Answer |
|---|---|
A size outside the 10, such as w45 or w200 | 404 with status_code 34 |
A file name that is not letters, digits, _ and - plus an extension, or that is over 80 characters | 404 with status_code 34 |
| A file the host does not have | 404 with status_code 34, remembered for 60 seconds |
A method other than GET, HEAD or OPTIONS | 405 with status_code 37 |
File names end in .jpg, .jpeg, .png, .webp or .svg. A good response carries these headers:
| Header | Value |
|---|---|
Cache-Control | public, (30 days) |
Access-Control-Allow-Origin | * |
X-Amodb-Cache | HIT or MISS |
Content-Type | The image type, for example image/jpeg |
Which base URLs does the configuration endpoint return?
GET /3/configuration returns the same structure as TMDB. Clients that build image URLs from it work without changes.
The edge keeps /3/configuration for 24 hours, so reading it once per day is enough.
{
"images": {
"base_url": "http://img.amodb.dev/t/p/",
"secure_base_url": "https://img.amodb.dev/t/p/",
"poster_sizes": ["w92", "w154", "w185", "w342", "w500", "w780", "original"]
}
}const base = "https://img.amodb.dev/t/p";
const srcset = ["w185", "w342", "w500"]
.map((size) => `${base}/${size}${movie.poster_path} ${size.slice(1)}w`)
.join(", ");
const html = `<img src="${base}/w342${movie.poster_path}" srcset="${srcset}"
sizes="(min-width: 64rem) 185px, 33vw" width="342" height="513"
alt="${movie.title} poster" loading="lazy">`;How long are images cached?
Images stay in the edge cache for 30 days. Store the file path from the movie details API with your record and build the URL when you render it, so you can switch sizes later without new API calls. Posters and backdrops stay the property of their owners. See the quickstart for a first request that ends with a poster.