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
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:
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
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.
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
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.
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?
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.
Travis Bell 的回复
于 2021 年 08 月 19 日 10:38上午
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
andrelease_date.lte
without aregion
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:If you don't want to target a particular region, you can do a slightly different query:
Omara8 的回复
于 2021 年 08 月 19 日 11:08上午
have u tried this API?, it literally returns the movie black widow as first item with release date July 9th
Omara8 的回复
于 2021 年 08 月 19 日 11:12上午
for example this is the API im running right now.
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.
Omara8 的回复
于 2021 年 08 月 19 日 11:16上午
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
Travis Bell 的回复
于 2021 年 08 月 19 日 11:29上午
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.For this query, the returned
release_date
data is not going to be theprimary_release_date.lte
/primary_release_date.gte
that you're filtering on since you're specifying aregion
. If you want to see the matched data, you will want to remove theregion
filter. If you want the region, then userelease_date.gte
andrelease_date.lte
and possibly thewith_release_type
filter. You can't mix and match primary with a region.Omara8 的回复
于 2021 年 08 月 19 日 11:37上午
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.
Omara8 的回复
于 2021 年 08 月 19 日 12:36下午
@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.
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.
Travis Bell 的回复
于 2021 年 08 月 19 日 12:48下午
What region is returning a movie from 1874? I'm not seeing that here:
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.Omara8 的回复
于 2021 年 08 月 19 日 1:34下午
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
Omara8 的回复
于 2021 年 08 月 19 日 1:57下午
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?
Travis Bell 的回复
于 2021 年 08 月 19 日 2:38下午
I believe the issue is that you have a typo in your params, the params aren't
primary_release_date_gte
andprimary_release_date_lte
but ratherprimary_release_date.gte
andprimary_release_date.lte
.Omara8 的回复
于 2021 年 08 月 19 日 2:40下午
yes i had just figured it out as well, again as i said earlier, very unintuitive