Streaming Availability

फ्रीमियम
Verified
द्वारा Movie of the Night | अपडेट किया गया 5日前 | Movies
लोकप्रियता

9.9 / 10

लेटेंसी

589ms

सेवा का स्तर

100%

Health Check

N/A

सभी चर्चाओं पर वापस जाएं

How to use the response with JS?

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 2年前

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.

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें