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?
.לא מצאת סרט או סדרה? היכנס כדי ליצור אותם
?רוצה לדרג או להוסיף פריט אל רשימה
?לא חבר אתר
תגובה מאת ticao2 🇧🇷 pt-BR
ב-דצמבר 16, 2020 ב-8:00לפני חצות יום
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:
תגובה מאת CahyoNurHikari
ב-דצמבר 16, 2020 ב-10:54לפני חצות יום
is there any way to get base url (the /movie/ or /tv/) from the API?
תגובה מאת Travis Bell
ב-דצמבר 16, 2020 ב-11:15לפני חצות יום
Hi @CahyoNurHikari, no. They are static, and since you know what item you're requesting you can map them client side.
תגובה מאת Skorpjun
ב-פברואר 21, 2023 ב-2:44אחרי חצות יום
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
תגובה מאת ticao2 🇧🇷 pt-BR
ב-פברואר 21, 2023 ב-5:17אחרי חצות יום
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.
תגובה מאת Skorpjun
ב-פברואר 22, 2023 ב-11:20לפני חצות יום
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
תגובה מאת Travis Bell
ב-פברואר 22, 2023 ב-11:37לפני חצות יום
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 themedia_type
field returned.