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.

Updated View as Markdown

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.

SizeFixed sideHeight at 2:3 (poster, profile)Height at 16:9 (backdrop, still)Good for
w9292 px wide138 px52 pxSearch suggestions
w154154 px wide231 px87 pxDense lists
w185185 px wide278 px104 pxGrids on desktop, profile photos
w300300 px wide450 px169 pxBackdrop thumbnails, OMDb Poster
w342342 px wide513 px192 pxGrids on phones with high density screens
w500500 px wide750 px281 pxDetail pages
w780780 px wide1,170 px439 pxLarge posters, medium backdrops
w12801,280 px wide1,920 px720 pxFull width backdrops
h632632 px high632 px (about 421 wide)632 px (about 1,124 wide)Profile photos at full height
originalSource sizeSource sizeSource sizeDownloads 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.

Text
https://img.amodb.dev/t/p/{size}/{file}
PartValueExample
Secure base URLimages.secure_base_url from /3/configurationhttps://img.amodb.dev/t/p/
Plain base URLimages.base_urlhttp://img.amodb.dev/t/p/
SizeOne of the 10 sizesw500
FileThe path from a response field, starting with //pB8BM7pdSp6B6Ih7QZ4DrQ3PmJK.jpg

{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.

Text
https://img.amodb.dev/t/p/w500/pB8BM7pdSp6B6Ih7QZ4DrQ3PmJK.jpg

Which 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 width1x screen2x screen3x screen
92 pxw92w185w342
154 pxw154w342w500
185 pxw185w500w780
342 pxw342w780original
500 pxw500originaloriginal

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?

RequestAnswer
A size outside the 10, such as w45 or w200404 with status_code 34
A file name that is not letters, digits, _ and - plus an extension, or that is over 80 characters404 with status_code 34
A file the host does not have404 with status_code 34, remembered for 60 seconds
A method other than GET, HEAD or OPTIONS405 with status_code 37

File names end in .jpg, .jpeg, .png, .webp or .svg. A good response carries these headers:

HeaderValue
Cache-Controlpublic, max-age=2592000, immutable (30 days)
Access-Control-Allow-Origin*
X-Amodb-CacheHIT or MISS
Content-TypeThe 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.

JSON
{
  "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"]
  }
}
JavaScript
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.

Questions and answers

What are the TMDB image sizes?

On amodb the sizes are w92, w154, w185, w300, w342, w500, w780, w1280, h632 and original. Ten sizes in all: nine fixed to a width or height in pixels, plus the source file. Join a base URL, a size and a file path such as poster_path.

What is the TMDB image base URL?

On amodb the secure base URL is https://img.amodb.dev/t/p/, returned as images.secure_base_url by GET /3/configuration. Add a size and the file path, for example https://img.amodb.dev/t/p/w500/pB8BM7pdSp6B6Ih7QZ4DrQ3PmJK.jpg. The images host needs no key.

Which TMDB image size should I use for a poster?

Take the displayed width in CSS pixels, multiply by the screen pixel ratio, and pick the next size up. A 185 px grid card on a 2x phone needs 370 px, so w500. A detail page at 500 px on a 1x screen takes w500. Posters are 2:3.

What happens if I request a size that is not listed?

The image host returns 404 with the TMDB error body and status_code 34. Only the 10 listed sizes are served, so w45 or w200 fail. A wrong file name fails the same way. Read the size lists from GET /3/configuration instead of guessing.

Can I put image URLs straight into img tags?

Yes. Image URLs carry no key, so they are safe in public pages. Pick the smallest size that covers the displayed width times the device pixel ratio, and set width and height so the page does not shift while the image loads.

Do image requests count toward my rate limit?

No. The image host does not read a key, so posters and backdrops never use your requests per minute. Only keyed calls to api.amodb.dev count, including cached replies, at 20, 40 or 120 requests per minute by plan.