The Movie Database 支持

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 回复(第 1 页,共 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.

找不到电影或节目?登录并创建它吧。

全站通用

s 聚焦到搜索栏
p 打开个人资料菜单
esc 关闭打开的窗口
? 打开键盘快捷键窗口

在媒体页面

b 返回(或返回上级)
e 进入编辑页面

在电视季页面

(右箭头)下一季
(左箭头)前一季

在电视集页面

(右箭头)下一集
(左箭头)上一集

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

t 打开翻译选择器
ctrl+ s 提交

在讨论页面

n 创建新讨论
w 切换关注状态
p 设为公开 / 私密讨论
c 关闭 / 开放讨论
a 打开活动页
r 回复讨论
l 跳转至最新回复
ctrl+ enter 发送信息
(右箭头)下一页
(左箭头)前一页

设置

想给这个条目评分或将其添加到片单中?

登录

还不是会员?

注册加入社区