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
Non riesci a trovare un film o una serie Tv? Accedi per crearlo.
Vuoi valutare o aggiungere quest'elemento a una lista?
Non sei un membro?
Risposta da Travis Bell
il 19 agosto, 2021 alle 10:38AM
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:
Risposta da Omara8
il 19 agosto, 2021 alle 11:08AM
have u tried this API?, it literally returns the movie black widow as first item with release date July 9th
Risposta da Omara8
il 19 agosto, 2021 alle 11:12AM
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.
Risposta da Omara8
il 19 agosto, 2021 alle 11:16AM
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
Risposta da Travis Bell
il 19 agosto, 2021 alle 11:29AM
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.Risposta da Omara8
il 19 agosto, 2021 alle 11:37AM
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.
Risposta da Omara8
il 19 agosto, 2021 alle 12:36PM
@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.
Risposta da Travis Bell
il 19 agosto, 2021 alle 12:48PM
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.Risposta da Omara8
il 19 agosto, 2021 alle 1:34PM
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
Risposta da Omara8
il 19 agosto, 2021 alle 1:57PM
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?
Risposta da Travis Bell
il 19 agosto, 2021 alle 2:38PM
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
.Risposta da Omara8
il 19 agosto, 2021 alle 2:40PM
yes i had just figured it out as well, again as i said earlier, very unintuitive