Supporto 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 risposte (nella pagina 1 di 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

Non riesci a trovare un film o una serie Tv? Accedi per crearlo.

Globale

s focalizza la barra di ricerca
p apri menu profilo
esc chiudi una finestra aperta
? apri finestra scorciatoia tastiera

Su tutte le pagine di media

b torna indietro (o al precedente quando applicabile)
e vai alla pagina di modifica

Nelle pagine delle stagioni TV

(freccia destra) vai alla stagione successiva
(freccia sinistra) vai alla stagione precedente

Nelle pagine degli episodi TV

(freccia destra) vai all'episodio successivo
(freccia sinistra) vai all'episodio precedente

Su tutte le pagine di immagini

a apri finestra aggiungi immagine

Su tutte le pagine di modifica

t apri selettore traduzione
ctrl+ s invia modulo

Sulle pagine di discussione

n crea nuova discussione
w segna come visto/non visto
p cambia publico/privato
c cambia chiuso/aperto
a apri attivita
r rispondi alla discussione
l vai all'ultima risposta
ctrl+ enter invia il tuo messaggio
(freccia destra) pagina successiva
(freccia sinistra) pagina precedente

Impostazioni

Vuoi valutare o aggiungere quest'elemento a una lista?

Accedi