Supporto The Movie Database

I'm trying to use the Discover API. I know my API-Key is valid since the following works:

https://api.themoviedb.org/3/discover/movie?api_key=

But as soon as I start adding parameters, it fails ({"status_code":7,"status_message":"Invalid API key: You must be granted a valid key.","success":false}). When I use the "try it" with the parameters I really want to use, it works, but when I tried copying that URL and adjusting it to use my API-Key, I can't get it to work. For reference, the following are the parameters I really want to specify:

?include_adult=false ?include_video=false ?language=en-US ?primary_release_year=2023 ?with_genres=28|12|80|18|36|27|9648|878|53|10752 ?with_original_language=en

Here's the full URL as I built it with the parameters above:

https://api.themoviedb.org/3/discover/movie?api_key=?include_adult=false?include_video=false?language=en-US?page=1?primary_release_year=2023?with_genres=28|12|80|18|36|27|9648|878|53|10752?with_original_language=en

Can someone shed some light on this for please? I'm sure it's something simple that I'm just not used to (I'm a retired IT Nerd that spent a lot of years programming, but not in the web world). For example, are there mutually-exclusive parameters that I can't use together (I don't think so, but am obviously grasping) or are the parameters required to be specified in a specific sequence, etc?

Thanks, Mark

2 risposte (nella pagina 1 di 1)

Jump to last post

You need to start HTTP parameters with a question mark ? but append them with an ampersand &.

https://api.themoviedb.org/3/discover/movie?api_key=###&include_adult=false&include_video=false…

OMG, I feel bad for even bothering you with that question, but THANK YOU Travis. Geez. It appears that the FINAL "&" is optional (in the browser it seems to be OK with or without it).

Of course, I used to have a little laminating saying by my desk while I was still working: "The only DUMB QUESTION is the one not asked."

Thanks again! I'm successfully calling web services now and it's working like a charm. Keep up the good work (site)!!!

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