Streaming Availability

FREEMIUM
Verified
Par Movie of the Night | Mise à jour vor 2 Tagen | Movies
Popularité

9.9 / 10

Latence

587ms

Niveau de service

100%

Health Check

N/A

Retour à toutes les discussions

How to use the response with JS?

Rapid account: Jacobr Vjf L Kw 4 By TO
jacobr-VjfLKw4ByTO
vor 2 Jahren

Hi,

I’m struggling to use the response in a JS app I’m building. Do you have any advice/reading to help?

Thanks

Rapid account: Cevatbarisyilmaz
cevatbarisyilmaz Commented vor 2 Jahren

Is it a Node.js app or just a plain JS?

For Node.js, you can check out this example: https://gist.github.com/cevatbarisyilmaz/6f643b92cc68c593f5a19a92f81e3aa8

For vanilla JS you can check out this one:

fetch("https://streaming-availability.p.rapidapi.com/search/basic?country=us&service=netflix&type=movie&page=1&output_language=en&language=en", {
	"method": "GET",
	"headers": {
		"x-rapidapi-host": "streaming-availability.p.rapidapi.com",
		"x-rapidapi-key": "YOUR_API_KEY_HERE"
	}
})
.then(response => {
	return response.json();
})
.then(data => {
    for(let show of data.results) {
        console.log(show.imdbID, show.title, show.streamingInfo["netflix"]["us"].link);
    }
})
.catch(err => {
	console.error(err);
});

Don’t forget to put your personal API key in both examples to try them.

Please let me know if you have more questions.

Participez à la discussion - ajoutez un commentaire ci-dessous:

Connectez-vous / Inscrivez-vous pour publier de nouveaux commentaires