Supporto The Movie Database

Hi how to display trailer from particular movie say for eg: from upcoming movies if selected one movie, where I need to display video trailer. How to get that link.

Thanks.

69 risposte (nella pagina 4 di 5)

Jump to last post

Pagina precedenteProssima paginaUltima pagina

@thidasaone said:

Hi @travisbell ,

I tried to append the movie details to the response. But I'm getting the response like this.

{
    "status_code": 7,
    "status_message": "Invalid API key: You must be granted a valid key."
}

My request is:

https://api.themoviedb.org/3/movie/157336?api_key={{API_KEY}}&append_to_response=videos

I tried your API key (I've truncated it here for privacy) and everything is working properly. Make sure you copied and pasted it properly (no spaces or anything around it for example).

https://api.themoviedb.org/3/movie/550?api_key=4d55e***************&append_to_response=videos

@travisbell I am unable to get the key for the video. All I am getting is this:

{"id":155,"results":[{"id":"58f284f49251413da7003225","iso_639_1":"en","iso_3166_1":"US","key":"kmJLuwP3MbY","name":"The Dark Knight - Official Trailer [HD]","site":"YouTube","size":1080,"type":"Trailer"}]}

and when I try to parse it I am only able to get the id value and not able to get value from key as its in second array I guess. Can you help me with it as I am new in JS?

@surya6032 said:
@travisbell I am unable to get the key for the video. All I am getting is this:

{"id":155,"results":[{"id":"58f284f49251413da7003225","iso_639_1":"en","iso_3166_1":"US","key":"kmJLuwP3MbY","name":"The Dark Knight - Official Trailer [HD]","site":"YouTube","size":1080,"type":"Trailer"}]}

and when I try to parse it I am only able to get the id value and not able to get value from key as its in second array I guess. Can you help me with it as I am new in JS?

Trailer URL

When you make an API Request requesting Videos, in the response you will receive something like this:

videos  
results 
0   
id  "57e6bf38925141414600bbe1"
iso_639_1   "pt"
iso_3166_1  "BR"
key "eBKvlCf0B4g"
name    "Clube da Luta | 1999 | Trailer Legendado | Fight Club"
site    "YouTube"
size    480
type    "Trailer"

In your case "key":"kmJLuwP3MbY",

Just add the Key in the respective URL:

YouTube: https://www.youtube.com/watch?v=  
Vimeo: https://vimeo.com/  

For example:
Youtube: https://www.youtube.com/watch?v=eBKvlCf0B4g
Youtube: https://www.youtube.com/watch?v=hzfvYSIIgyc
Vimeo: https://vimeo.com/282875052

In your case Youtube: https://www.youtube.com/watch?v=kmJLuwP3MbY

Travis Bell - 2020-09-19
Hi @user, we only support YouTube and Vimeo right now.

@ticao2 I am unable to extract the key from the returned data. How do I extract it?

@surya6032 said:
@ticao2 I am unable to extract the key from the returned data. How do I extract it?

I have no idea.
I am not a programmer.
I'm just a curious old man who got to understand the TMDb API. :-)

@ticao2 hahahah okay sir. I hope someone can help me with this😅

Hello,

When I append "&append_to_response=videos" to the general request to find the movies (https://developers.themoviedb.org/3/search/search-movies) It never shows the youtube ID for the videos. Am I doinn something wrong ?

Example : to https://api.themoviedb.org/3/search/movie?api_key=e10867ce9f0cd0e1d8210200f5702795&language=en-US&query=The%20Invisible%20Ma&page=1&include_adult=false&append_to_response=videos

thx for your help!

Only the get info methods support append_to_response. You can’t use it on search, discover or find.

how do I get trailers for the trending movies that I am getting from the api

@bhuvanlal198 said:

how do I get trailers for the trending movies that I am getting from the api

You can follow the "search and query" article in the documentation. Just swap out search for a trending method.

@ticao2 said:

@surya6032 said:
@travisbell I am unable to get the key for the video. All I am getting is this:

{"id":155,"results":[{"id":"58f284f49251413da7003225","iso_639_1":"en","iso_3166_1":"US","key":"kmJLuwP3MbY","name":"The Dark Knight - Official Trailer [HD]","site":"YouTube","size":1080,"type":"Trailer"}]}

and when I try to parse it I am only able to get the id value and not able to get value from key as its in second array I guess. Can you help me with it as I am new in JS?

Trailer URL

When you make an API Request requesting Videos, in the response you will receive something like this:

videos    
results   
0 
id    "57e6bf38925141414600bbe1"
iso_639_1 "pt"
iso_3166_1    "BR"
key   "eBKvlCf0B4g"
name  "Clube da Luta | 1999 | Trailer Legendado | Fight Club"
site  "YouTube"
size  480
type  "Trailer"

In your case "key":"kmJLuwP3MbY",

Just add the Key in the respective URL:

YouTube: https://www.youtube.com/watch?v=  
Vimeo: https://vimeo.com/  

For example:
Youtube: https://www.youtube.com/watch?v=eBKvlCf0B4g
Youtube: https://www.youtube.com/watch?v=hzfvYSIIgyc
Vimeo: https://vimeo.com/282875052

In your case Youtube: https://www.youtube.com/watch?v=kmJLuwP3MbY

Travis Bell - 2020-09-19
Hi @user, we only support YouTube and Vimeo right now.

how to get any movie id

@amdbookings said:
how to get any movie id

Read these initial introduction instructions.
https://developers.themoviedb.org/3/getting-started/introduction
When you don't know the ID, there are 3 ways to search using Title, Name or External ID.

  1. Search = Using Title or Name
  2. Discover = Using Title
  3. Find = Using External ID

1 Get/Search
https://developers.themoviedb.org/3/search/search-movies
Movies, TV Shows, People, Company, Collection, Keyword

2 Get/Discover
- Movies
https://developers.themoviedb.org/3/discover/movie-discover
- TV Shows
https://developers.themoviedb.org/3/discover/tv-discover

3 Get/Find
https://developers.themoviedb.org/3/find/find-by-id
IMDB ID, TVDB ID, Facebook, Instagram, Twitter

In the response, depending on the search terms, you may receive one or more items.
For all items you will receive basic information, including the item ID.

Knowing the ID of the item you are looking for (Movie, TV Show, People etc ...)
we go to the second step which is to obtain the complete information of the item,
making a Request of the type Get / Info or Get / Details.

For each type of item there is a specific API Request to obtain Basic Information.

Movie = https://developers.themoviedb.org/3/movies/get-movie-details
TV Show = https://developers.themoviedb.org/3/tv/get-tv-details
People = https://developers.themoviedb.org/3/people/get-person-details
Company = https://developers.themoviedb.org/3/companies/get-company-details
Network = https://developers.themoviedb.org/3/networks/get-network-details
Collection = https://developers.themoviedb.org/3/collections/get-collection-details
keyword = https://developers.themoviedb.org/3/keywords/get-keyword-details

For each of the Items, there are variations of API Request
to obtain other Item information. more specific information.
These API Request variations can be found in the menu
to the left of each of the Links informed above.

Hi @travisbell Is there any API to get trailer URL for given IMDB_ID of a Movie? Or we need to find that movie first to get TMDB_ID and then call Videos API?

@travisbell said:

Since we link to YouTube, it's as simple as taking the key value and appending it to a youtube.com address like so:

http://api.themoviedb.org/3/movie/550/videos?api_key=###

Has the YouTube key of SUXWAEX2jlg, so:

https://www.youtube.com/watch?v=SUXWAEX2jlg

Cheers.

I didn't understand. Can you be more specific? How can I display trailers from Youtube based on the movie data from the API?

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