Configuration
The configuration module allows you to retrieve all configuration details directly from TMDB. These include languages, translations, countries, image sizes and timezones.
Details
Query the API configuration details. The data returned here in the configuration endpoint is designed to provide some of the required information you'll need as you integrate our API. For example, you can get a list of valid image sizes and the valid image address.
tmdb.config.get(): Promise<ConfigurationResponse>
TMDB Reference:
Response
{
"change_keys": [
"adult",
"air_date",
"also_known_as",
...
],
"images": {
"base_url": "http://image.tmdb.org/t/p/",
"secure_base_url": "https://image.tmdb.org/t/p/",
"backdrop_sizes": ["w300", "w780", "w1280", "original"],
"logo_sizes": ["w45", "w92", "w154", "w185", "w300", "w500", "original"],
"poster_sizes": ["w92", "w154", "w185", "w342", "w500", "w780", "original"],
"profile_sizes": ["w45", "w185", "h632", "original"],
"still_sizes": ["w92", "w185", "w300", "original"]
}
}
Types
export type ImageConfiguration = {
base_url: string;
secure_base_url: string;
backdrop_sizes: string[];
logo_sizes: string[];
poster_sizes: string[];
profile_sizes: string[];
still_sizes: string[];
};
export type ConfigurationResponse = {
images: ImageConfiguration;
change_keys: string[];
};
Countries
Get the list of countries (ISO 3166-1 tags) used throughout TMDB.
tmdb.config.countries({ language: "fr" }): Promise<ConfigurationResponse>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| language | LanguageISO6391 | ❌ | Language for the response |
The language parameter is going to affect the native_name of the returned countries.
TMDB Reference:
Response
[
{
"iso_3166_1": "AD",
"english_name": "Andorra",
"native_name": "Andorre"
},
{
"iso_3166_1": "AE",
"english_name": "United Arab Emirates",
"native_name": "Émirats arabes unis"
},
...
]
Types
export type ConfigurationCountriesParams = {
language?: LanguageISO6391;
};
export type Country = {
iso_3166_1: CountryISO3166_1;
english_name: string;
native_name: string;
};
Jobs
Get the list of jobs and departments used throughout TMDB.
tmdb.config.jobs(): Promise<ConfigurationJob[]>
TMDB Reference:
Response
[
{
"department": "Production",
"jobs": [
"Casting",
"Line Producer",
"Co-Producer",
...
}
...
]
Types
export type ConfigurationJob = {
department: string;
jobs: string[];
};
Languages
Get the list of languages (ISO 639-1 tags) used throughout TMDB.
tmdb.config.languages(): Promise<ConfigurationLanguage[]>
TMDB Reference:
Response
[
{
"iso_639_1": "ay",
"english_name": "Aymara",
"name": "Aymara"
},
{
"iso_639_1": "ch",
"english_name": "Chamorro",
"name": "Finu' Chamorro"
},
...
]
Types
export type ConfigurationLanguage = {
iso_639_1: string;
english_name: string;
name: string;
};
Primary Translations
Get the complete list of officially supported translations (IETF tags).
Note on Translations (from TMDB)
While it's technically possible to add a translation in any one of the languages we have added to TMDB (we don't restrict content), the ones listed in this method are the ones we also support for localizing the website with which means they are "primary" translations.
These are all specified as IETF tags to identify the languages we use on TMDB. There is one exception which is image languages. They are currently only designated by a ISO-639-1 tag. This is a planned upgrade for the future.
We're always open to adding more if you think one should be added. You can ask about getting a new primary translation added by posting on the forums (TMDB).
tmdb.config.primary_translations(): Promise<string[]>
TMDB Reference:
Response
[
"en-US",
"it-IT",
"fr-FR",
"es-ES",
...
]
Types
export type PrimaryTranslation = string;
or use it as const:
export type PrimaryTranslations = "af-ZA" | "ar-AE" | "ar-SA" | "be-BY" | ...
Timezones
Get the list of timezones used throughout TMDB.
tmdb.config.timezones(): Promise<ConfigurationTimezone[]>
TMDB Reference:
Response
[
{
"iso_3166_1": "AD",
"zones": [
"Europe/Andorra"
]
},
{
"iso_3166_1": "AE",
"zones": [
"Asia/Dubai"
]
},
...
]
Types
export type ConfigurationTimezone = {
iso_3166_1: string;
zones: string[];
};