I'm working on React site for a musician, and I want to make a page that displays the Youtube videos of his music. He has created a playlist of videos he wants included. I can access the videos individually, but I want to set it up so that whatever videos he adds to that playlist will be accessed by the API and displayed on his site.
For individual videos I'm using Axios to get the videos from this url:
https://www.googleapis.com/youtube/v3/videos?part=snippet&id=<My ID>&key=<My Key>
Then in the render method, I deconstruct 'Videos' off of state, then I map over 'Videos', returning it in an iframe element like so:
<iframe src={https://www.youtube.com/embed/${videos.id}}></iframe>
I've been plyaing with the syntax of my GET url to try to get the playlist, currently I'm getting a status code of 400
on my GET, so I'll need to start at that point. This is what I have right now for URL to get the playlist:
axios.get('https://www.googleapis.com/youtube/v3/search?key=<My Key>&list=<Playlist ID>&part=snippet,id&order=date&maxResults=20')
Can someone give me an idea of how I'm going about this the wrong way?