The Movie Database 支持

I'm struggling with getting results for regional release dates. (I don't get any.)

When searching region (US) without a date, I get results.
url = "https://api.themoviedb.org/3/discover/movie?include_adult=false&include_video=false&language=en-US&page=1&region=us&sort_by=popularity.desc&with_release_type=3&with_runtime.gte=60"

{
  "page": 1,
  "results": [
    {
[REDACTED for brevity]
      "original_title": "Deadpool & Wolverine",
      "overview": "A listless Wade Wilson toils away in civilian life with his days as the morally flexible mercenary, Deadpool, behind him. But when his homeworld faces an existential threat, Wade must reluctantly suit-up again with an even more reluctant Wolverine.",
      "popularity": 3546.58,
      "poster_path": "/8cdWjvZQUExUUTzyp4t6EDMubfO.jpg",
      **"release_date": "2024-07-24",**
      "title": "Deadpool & Wolverine",
      "video": false,
[REDACTED for brevity]
    },

But when I search for region + release date, I get nothing.
url = "https://api.themoviedb.org/3/discover/movie?include_adult=false&include_video=false&language=en-US&page=1&region=us&release_date.gte=2024-07-24&release_date.lte=2024-07-24&sort_by=popularity.desc&with_release_type=3&with_runtime.gte=60"

{
  "page": 1,
  "results": [],
  "total_pages": 1,
  "total_results": 0
}

I've tried iterating a date (ex: May 1st) over every year since 1939 and get zero results.
The same function returns 270+ results for primary_release_date.gte/lte (with and without region) and 475+ results for release_date.gte/lte with no region.
But combining region + release date always returns 0 results. (And it doesn't matter whether I'm using my code or the TMDB widget here.)

10 回复(第 1 页,共 1 页)

Jump to last post

The region parameter must be in uppercase letters.
It complies with ISO 3166-1
In your case US.

https://api.themoviedb.org/3/discover/movie?api_key=THE_KEY&include_adult=false&include_video=false&language=en-US&page=1&region=US&release_date.gte=2024-07-24&release_date.lte=2024-07-24&sort_by=popularity.desc&with_release_type=3&with_runtime.gte=60

@ticao2 said:

The region parameter must be in uppercase letters.
It complies with ISO 3166-1
In your case US.

https://api.themoviedb.org/3/discover/movie?api_key=THE_KEY&include_adult=false&include_video=false&language=en-US&page=1®ion=US&release_date.gte=2024-07-24&release_date.lte=2024-07-24&sort_by=popularity.desc&with_release_type=3&with_runtime.gte=60

Man, I could swear that I tried that yesterday because I actually checked that when I was troubleshooting. But I just uppercased my "region": "US", and lo & behold I get a list of movies.

Thank you so much!

But I'd like to note that the URL generated in the TMDB widget populates a lowercase region code. It should not do that as it's an example of how to use the API. Granted, basic problem-solving should have led me to try "US" (and I thought I did) I wasted hours battling that empty results list to no avail, all because I was following the example in the widget.

This is the sample code in TMDB's web widget:

import requests
url = "https://api.themoviedb.org/3/discover/movie?include_adult=false&include_video=false&language=en-US&page=1&region=us&sort_by=popularity.desc"

@lazysupper said:
Thank you so much!

:-)

But I'd like to note that the URL generated in the TMDB widget populates a lowercase region code. It should not do that as it's an example of how to use the API. Granted, basic problem-solving should have led me to try "US" (and I thought I did) I wasted hours battling that empty results list to no avail, all because I was following the example in the widget.

This is the sample code in TMDB's web widget:

import requests
url = "https://api.themoviedb.org/3/discover/movie?include_adult=false&include_video=false&language=en-US&page=1®ion=us&sort_by=popularity.desc"

Hmm...
The field to specify Region does not have an example.
If you enter it in lowercase, the system does not change it to Uppercase.
It needs to be entered in Uppercase by the user.
I only see an example in Language. And it is correctly en-US.

@ticao2 said:

Hmm...
The field to specify Region does not have an example.
If you enter it in lowercase, the system does not change it to Uppercase.
It needs to be entered in Uppercase by the user.
I only see an example in Language. And it is correctly en-US.

Are you on this page: https://developer.themoviedb.org/reference/discover-movie? The field to specify region is there. It is between primary_release_date.lte and release_date.gte

And it's also in the code I shared above: &language=en-US&page=1&**region=us**&sort_by=popularity.desc

The widget doesn't change lowercase to uppercase, but it still returns results in the response box with its code showing a lowercase region, which is what led me to think that lowercase should work. Anyway, it's not an issue for me now, I just think it's not a great way to provide an example.

@lazysupper said:

@ticao2 said:

Hmm...
The field to specify Region does not have an example.
If you enter it in lowercase, the system does not change it to Uppercase.
It needs to be entered in Uppercase by the user.
I only see an example in Language. And it is correctly en-US.

Are you on this page:
https://developer.themoviedb.org/reference/discover-movie?
The field to specify region is there. It is between primary_release_date.lte and release_date.gte

Yes, that's the one.
My browser doesn't show any examples in this field.
https://imgur.com/a/lu69Axc
https://imgur.com/6EY9JQY
What operating system and browser are you using?

I don't mean that there's a placeholder example in the list of query parameters. I'm referring to the example code that the widget populates. https://imgur.com/a/hg3YP1V

@lazysupper said:
I don't mean that there's a placeholder example in the list of query parameters.
I'm referring to the example code that the widget populates.
https://imgur.com/a/hg3YP1V

I'm not sure I understand.
In the field you type US, in capital letters, and the widget populate it with us, in lowercase?
Well, that doesn't happen in my browser.
If I use US in capital letters, the widget populate in uppercase.
If I use us in lowercase, the widget populate in lowercase.
It seems that the widget behaves differently for me than it does for you.

@ticao2 said:

@lazysupper said:
I don't mean that there's a placeholder example in the list of query parameters.
I'm referring to the example code that the widget populates.
https://imgur.com/a/hg3YP1V

I'm not sure I understand.
In the field you type US, in capital letters, and the widget populate it with us, in lowercase?
Well, that doesn't happen in my browser.
If I use US in capital letters, the widget populate in uppercase.
If I use us in lowercase, the widget populate in lowercase.
It seems that the widget behaves differently for me than it does for you.

We're seeing the same thing. (I type us and the widget populates the URL in lowercase.) I'm simply saying that it delivers a response. That's my point. It should return nothing, otherwise the implication is that lowercase is acceptable.

@lazysupper said:
We're seeing the same thing. (I type us and the widget populates the URL in lowercase.) I'm simply saying that it delivers a response. That's my point. It should return nothing, otherwise the implication is that lowercase is acceptable.

Now I understand.
The system should correct from lowercase to uppercase or it should not accept lowercase and report an error perhaps.
I don't know if this service that TMDb uses, Readme, has this feature.
https://readme.com

@ticao2 said:

@lazysupper said:
We're seeing the same thing. (I type us and the widget populates the URL in lowercase.) I'm simply saying that it delivers a response. That's my point. It should return nothing, otherwise the implication is that lowercase is acceptable.

Now I understand.
The system should correct from lowercase to uppercase or it should not accept lowercase and report an error perhaps.
I don't know if this service that TMDb uses, Readme, has this feature.
https://readme.com

Ahh, that adds some clarity. Cheers!

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

全站通用

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

在媒体页面

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

在电视季页面

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

在电视集页面

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

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

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

在讨论页面

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

设置

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

登录

还不是会员?

注册加入社区