I dont know why it dont work.... use it like that :
const url = 'https://api.themoviedb.org/3/movie/top_rated?language=en-US&page=1';
const options = {
method: 'GET',
headers: {
accept: 'application/json',
Authorization: 'Bearer MyAPIKey'
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
¿No encuentras una película o serie? Inicia sesión para crearla:
¿Quieres puntuar o añadir este elemento a una lista?
¿No eres miembro?
Contestado por Travis Bell
el 7 de agosto de 2024 a las 10:58
You can't use your API key as a bearer token. If you want to use bearer authentication, make sure to use your access token.
You can read more about this here, in the docs: https://developer.themoviedb.org/docs/authentication-application