The Movie Database Support

Hello,

I am trying to work my way through a tutorial that executes movie searches with the API, and I keep getting 401 results, so I am unable to proceed any further. My URL that I am sending with my http request is: http://api.themoviedb.org/3/Movie.search/en/xml/[API KEY]/gladiator

Is there something I am doing wrong in the formatting of the URL? I have a valid API Key.

Thanks, Shaun

2 replies (on page 1 of 1)

Jump to last post

Hi Shaun,

A few things. First, you're not making a valid APi request. The movie search URL is:

http://api.themoviedb.org/3/search/movie?api_key=###&query=gladiator

Second, a 401 error would be caused from not sending a valid Accept header. If you take a look at our documentation and depending what language you are programming in, there's working examples for most popular ones. A working cURL request for example, looks like so:

curl --include --header "Accept: application/json" "http://api.themoviedb.org/3/search/movie?api_key=###&query=gladiator"

Cheers.

I was a bit confused by the documentation regarding constructing a request URL. There's info on the endpoints, but not on how they fit into the URL itself. Just an idea for improvement going forward.

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