The Movie Database Support

I have the movie ID, tried to do themoviedb.org/ {id} doesn't exist, i tried using themoviedb.org/tv/ {id} and got the right page. But then i realize some need to use themoviedb.org/movie/ {id} to get the right page.

is there any way to get the right URL redirecting to tmdb?

7 replies (on page 1 of 1)

• Jump to last post

@CahyoNurHikari said:
How to get TMDb Url only with Movie ID fetched from API?
I have the movie ID,
tried to do themoviedb.org/ {id} doesn't exist,
i tried using themoviedb.org/tv/ {id} and got the right page.
But then i realize some need to use themoviedb.org/movie/ {id} to get the right page.

is there any way to get the right URL redirecting to tmdb?

There are no two Movies with the same ID.
But there may be a TV Show with the same ID. Or a person.
The list of IDs are separate, different for each type (movie, tv, person, network and company).
So, for each type you must use the corresponding Base URL.

For example, ID 500:

https://www.themoviedb.org/movie/500-reservoir-dogs  
https://www.themoviedb.org/tv/500-mad-about-you  
https://www.themoviedb.org/person/500-tom-cruise  
https://www.themoviedb.org/network/500  
https://www.themoviedb.org/company/500

is there any way to get base url (the /movie/ or /tv/) from the API?

Hi @CahyoNurHikari, no. They are static, and since you know what item you're requesting you can map them client side.

Hi, I would like to know if there is currently a way to get the TMDB URL from the TMDB ID. I read the posts above, but what do you mean 'map them client side'? How is there a way to know the URL client side if the 'GET /movie/{movie_id} ' command does not return any info on whether it is a movie or a TV show, while TMDB URL's differentiate between movies and TV shows? Thnx

@Skorpjun said:
Hi,
I would like to know if there is currently a way to get the TMDB URL from the TMDB ID.
I read the posts above, but what do you mean 'map them client side'?
How is there a way to know the URL client side if the 'GET /movie/{movie_id} ' command does not return any info on whether it is a movie or a TV show, while TMDB URL's differentiate between movies and TV shows?
Thnx

If you only know the TMDb ID but don't know what type of item it belongs to, then NO.
Just testing all possible URLs.

But, if you received that ID in an API Request response then YES.
Every response contains in each item in addition to the ID also more data including the type of item.
Movie, TV, Person, Network or Company.

If you post here an API Request you made, and you can't find that information, it will be easier to explain where the data is.

@ticao2 said:

@Skorpjun said:
Hi,
I would like to know if there is currently a way to get the TMDB URL from the TMDB ID.
I read the posts above, but what do you mean 'map them client side'?
How is there a way to know the URL client side if the 'GET /movie/{movie_id} ' command does not return any info on whether it is a movie or a TV show, while TMDB URL's differentiate between movies and TV shows?
Thnx

If you only know the TMDb ID but don't know what type of item it belongs to, then NO.
Just testing all possible URLs.

But, if you received that ID in an API Request response then YES.
Every response contains in each item in addition to the ID also more data including the type of item.
Movie, TV, Person, Network or Company.

If you post here an API Request you made, and you can't find that information, it will be easier to explain where the data is.

Hi ticao2, Imagine an API movie search request using "api.themoviedb.org/3/search/movie?query=TITLE". The JSON result would contains a lot of things, but as far as I could find no information about the type (Movie, TV, etc). See https://developers.themoviedb.org/3/search/search-movies Thnx

Hi @Skorpjun, if you're making a request to /search/movie you know you're only going to get movies back. This is the same for all searches to individual media types. If you decide to use /search/multi however, you'll see the media_type field returned.

Can't find a movie or TV show? Login to create it.

Want to rate or add this item to a list?

Login