The Movie Database 支持

how can i set the discover api to only get movies with release date starting tomorrow and higher only, i have tried with release_date_gte and _lte and the results are all over the place, 0 sort or anything and its weird

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

Jump to last post

Hi @Omara8, a few points that should help:

Default sort is by popularity. You can change this if you want by using a different sort_by value.

Filtering with release_date.gte and release_date.lte without a region is going to simply filter by the earliest release date found on a media record. So as an example, filtering starting tomorrow and ending Dec 31, you can do something like:

https://api.themoviedb.org/3/discover/movie?api_key=###&release_date.gte=2021-08-19&release_date.lte=2021-12-31&region=US

If you don't want to target a particular region, you can do a slightly different query:

https://api.themoviedb.org/3/discover/movie?api_key=###&primary_release_date.gte=2021-08-19&primary_release_date.lte=2021-12-31
https://api.themoviedb.org/3/discover/movie?api_key=###&release_date.gte=2021-08-19&release_date.lte=2021-12-31&region=US

have u tried this API?, it literally returns the movie black widow as first item with release date July 9th

for example this is the API im running right now.

https://api.themoviedb.org/3/discover/movie?primary_release_date.gte=2021-08-19&primary_release_date.lte=2021-12-31&sort_by=primary_release_date.asc&region=US

the results that are coming do include a movie like the following, which is a movie from 2020, i think you have a major content issue or a back-end issue that needs some major fixing.

{
            "adult": false,
            "backdrop_path": "/f6YSikiGgSx2IEHiDAWwTt3uEki.jpg",
            "genre_ids": [
                35,
                18,
                10749
            ],
            "id": 802119,
            "original_language": "en",
            "original_title": "All About Sex",
            "overview": "Three friends in their mid-20s struggle to navigate their professional and personal lives, colliding head on with the messy, hilarious and dreadful growing pangs of adulthood.",
            "popularity": 52.13,
            "poster_path": "/z5vs0pe9lJ21WZ4mdhPftYiIlFA.jpg",
            "release_date": "2020-01-16",
            "title": "All About Sex",
            "video": false,
            "vote_average": 0,
            "vote_count": 0
        }

the more i look at the response the more i see issues there, for example i got movie #5 is releasing on August 27th, then movies 7,8 are releasing on August 20th, the sorting is also not working properly

@Omara8 said:

https://api.themoviedb.org/3/discover/movie?api_key=###&release_date.gte=2021-08-19&release_date.lte=2021-12-31region=US

have u tried this API?, it literally returns the movie black widow as first item with release date July 9th

Sure, look at the release data we have: https://www.themoviedb.org/movie/497698-black-widow/releases#US

You can see there's a physical release date added for September 14.

If you want to add release type filtering, you'll want to add a with_release_type filter. This is discussed in the docs.

the more i look at the response the more i see issues there, for example i got movie #5 is releasing on August 27th, then movies 7,8 are releasing on August 20th, the sorting is also not working properly

For this query, the returned release_date data is not going to be the primary_release_date.lte/primary_release_date.gte that you're filtering on since you're specifying a region. If you want to see the matched data, you will want to remove the region filter. If you want the region, then use release_date.gte and release_date.lte and possibly the with_release_type filter. You can't mix and match primary with a region.

ok now now api works but from what i have seen so far the documentation are not exactly intuitive, if some fields are left optional then the developers might not even read the description to find out that if they don't add X or Y it will ruin the responses.

@travisbell so i have been testing out the APIs and i am honestly thinking about implementing another service for the back-end for this project.

i am using this API right now with AND without region=US, on postman it is working properly without adding or removing "primary_" when toggling the region, for the android app it literally brings out movies dating back to 1874.

https://api.themoviedb.org/3/discover/movie?page=2&release_date.gte=2021-08-19&release_date.lte=2021-12-31&sort_by=release_date.asc&with_release_type=3

my conclusion is that the service is simply non workable with the current status to be in anything consumer related, could be used as testing service for dummy projects but that's it

what a shame.

@Omara8 said:

i am using this API right now with AND without region=US, on postman it is working properly without adding or removing "primary_" when toggling the region, for the android app it literally brings out movies dating back to 1874.

https://api.themoviedb.org/3/discover/movie?page=2&release_date.gte=2021-08-19&release_date.lte=2021-12-31&sort_by=release_date.asc&with_release_type=3

What region is returning a movie from 1874? I'm not seeing that here:

https://api.themoviedb.org/3/discover/movie?release_date.gte=2021-08-19&release_date.lte=2021-12-31&sort_by=release_date.asc&with_release_type=3&api_key=###region=US

The first item is 2021-08-20 which seems correct and reasonable. I went through all 10 pages and couldn't find anything like that.

I/okhttp.OkHttpClient: <-- 200 https://api.themoviedb.org/3/discover/movie?page=1&primary_release_date_gte=2021-08-19&primary_release_date_lte=2022-12-31&sort_by=primary_release_date.asc&with_release_type=3 (1191ms, unknown-length body)

here's a screenshot of the actual response

preview

the only difference i can see is that im using the bearer token not the api key as a query, also are there any special headers that need to exist/not exist on the API call?

@Omara8 said:

I/okhttp.OkHttpClient: <-- 200 https://api.themoviedb.org/3/discover/movie?page=1&primary_release_date_gte=2021-08-19&primary_release_date_lte=2022-12-31&sort_by=primary_release_date.asc&with_release_type=3 (1191ms, unknown-length body)

here's a screenshot of the actual response

preview

I believe the issue is that you have a typo in your params, the params aren't primary_release_date_gte and primary_release_date_lte but rather primary_release_date.gte and primary_release_date.lte.

https://api.themoviedb.org/3/discover/movie?page=1&primary_release_date.gte=2021-08-19&primary_release_date.lte=2022-12-31&sort_by=primary_release_date.asc&with_release_type=3

yes i had just figured it out as well, again as i said earlier, very unintuitive

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

全站通用

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

在媒体页面

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

在电视季页面

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

在电视集页面

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

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

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

在讨论页面

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

设置

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

登录

还不是会员?

注册加入社区