The Movie Database Support

I'm new to working with APIs.

I can get all the info I need about a movie

conn = http.client.HTTPSConnection("api.themoviedb.org")

payload = "{}"


conn.request("GET", "/3/movie/now_playing?page=1&language=en-US&api_key=MYKEY&append_to_response=videos", payload)

res = conn.getresponse()
data = res.read().decode('utf-8')
json_data = json.loads(data)

movie = []
for i in range(0,NUMBER_OF_MOVIES):
    title = json_data["results"][i]["title"], 
    overview = json_data["results"][i]["overview"]
    # ...
    # ET CETERA

    movie[title, overview]

But I also need to the the trailer.

How do I add the Youtube key in that same list?

I saw I need to make a request to

movie/{movie_id}/videos?api_key=<>&language=en-US

But I'm not sure how to implement it.

1 reply (on page 1 of 1)

Jump to last post

Hi @3x3m3 There is no way to do this with the now playing method. You need to make an additional request to the /movie/{id}/videos method.

If you need to get more details than that, make sure to read about append_to_response.

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