The Movie Database Support

Using the get videos, I saw its JSON data. I didn't see any link to video. How does it work? how can I check the video before adding to my website? please let me know.

https://api.themoviedb.org/3/movie/{movie_id}/videos?api_key=###&language=en-US

5 replies (on page 1 of 1)

Jump to last post

Hi there,

That is the right call.

travisbell$ curl -v "http://api.themoviedb.org/3/movie/297762/videos?api_key=###&language-en-US"
*   Trying 107.21.254.25...
* TCP_NODELAY set
* Connected to api.themoviedb.org (107.21.254.25) port 80 (#0)
> GET /3/movie/297762/videos?api_key=###&language-en-US HTTP/1.1
> Host: api.themoviedb.org
> User-Agent: curl/7.51.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: ETag, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After
< Cache-Control: public, max-age=28800
< Content-Type: application/json;charset=utf-8
< Date: Wed, 21 Jun 2017 16:45:59 GMT
< ETag: "58eba741a2e401c379030bbc39d434b1"
< Server: openresty
< Vary: Accept-Encoding
< X-Memc: HIT
< X-Memc-Age: 24011
< X-Memc-Expires: 4789
< X-Memc-Key: f1219b0cd01a50a95bc2652a1815ffbc
< X-RateLimit-Limit: 40
< X-RateLimit-Remaining: 39
< X-RateLimit-Reset: 1498063569
< Content-Length: 1130
< Connection: keep-alive
<
* Curl_http_done: called premature == 0
* Connection #0 to host api.themoviedb.org left intact

And here's the response:

{
  "id": 297762,
  "results": [
    {
      "id": "58ba5869925141609e01849f",
      "iso_639_1": "en",
      "iso_3166_1": "US",
      "key": "5lGoQhFb4NM",
      "name": "Official Comic-Con Trailer",
      "site": "YouTube",
      "size": 1080,
      "type": "Trailer"
    },
    {
      "id": "590df0499251414e89010704",
      "iso_639_1": "en",
      "iso_3166_1": "US",
      "key": "tsJeu11shJg",
      "name": "Power",
      "site": "YouTube",
      "size": 1080,
      "type": "Teaser"
    },
    {
      "id": "590df032c3a368650a00f87c",
      "iso_639_1": "en",
      "iso_3166_1": "US",
      "key": "tnbDVsL_JpQ",
      "name": "Goddess",
      "site": "YouTube",
      "size": 1080,
      "type": "Teaser"
    },
    {
      "id": "58c5cb929251411d30005d71",
      "iso_639_1": "en",
      "iso_3166_1": "US",
      "key": "INLzqh7rZ-U",
      "name": "Official Origin Trailer",
      "site": "YouTube",
      "size": 1080,
      "type": "Trailer"
    },
    {
      "id": "590df016c3a36864fc01000c",
      "iso_639_1": "en",
      "iso_3166_1": "US",
      "key": "HUCBxfHjayo",
      "name": "Bang Bang",
      "site": "YouTube",
      "size": 1080,
      "type": "Teaser"
    },
    {
      "id": "58ba5859925141606f019801",
      "iso_639_1": "en",
      "iso_3166_1": "US",
      "key": "1Q8fG0TtVAY",
      "name": "Official Trailer",
      "site": "YouTube",
      "size": 1080,
      "type": "Trailer"
    },
    {
      "id": "590df062c3a36864c600ffd1",
      "iso_639_1": "en",
      "iso_3166_1": "US",
      "key": "e9waCtSVoZ0",
      "name": "Together",
      "site": "YouTube",
      "size": 1080,
      "type": "Teaser"
    }
  ]
}

What were you having problems with exactly?

So I wanted to know how these JSON objects are linked to a movie trailer. Is there any way I can use its id number to see the video on YouTube? example like in images I could see the poster image for movie using url. let me know thanks

The key field is the YouTube id. So taking the first result as an example, "5lGoQhFb4NM" you can build a YouTube URL:

https://www.youtube.com/watch?v=5lGoQhFb4NM

thank you!

Awesome!

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