Streaming Availability

부분 유료
Verified
분류별 Movie of the Night | 업데이트됨 6 giorni fa | Movies
인기

9.9 / 10

지연 시간

584ms

서비스 수준

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 anni fa

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.

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입