The Movie Database Support

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 replies (on page 1 of 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)!!!

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login