Hi,
I’m struggling to use the response in a JS app I’m building. Do you have any advice/reading to help?
Thanks
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:
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:
Don’t forget to put your personal API key in both examples to try them.
Please let me know if you have more questions.