Golang for YouTube Data API V3

Wondering if anyone has experience using the YouTube Data API (V3), particularly with golang and the samples provided by the site. I’m looking for a way to incorporate this into my Hugo build–ie, by writing to a .json in my data/ folder. Most of what I can find it about integrating the YouTube API with applications, but I’m more interested in displaying a list of, for example, the five most reason videos uploaded to my channel.

Any help on this would be greatly appreciated. Thanks!

1 Like

Did you ever figure this one out?
I’m trying to accomplish the same thing, from my playlist and I’m not finding anything that suggests this is going to be an easy feat!

Alright. I ended up not going this route and am instead I’m running my playlist through the embedded YouTube frame.

That said, I generated a few IDEAS that might help you out - should you decide to explore this again.

  • If all you’re accessing is the playlist data, you can get away with skipping OAuth, I think.

    • Get an API Key
    • Use URL https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&maxResults=25&playlistId=PLgpNUeGY2V4wxhxBlR-iYCv4_bRXNIVtX&key=[API KEY]
    • Might want to update that playlistID to th playlist you want to access :wink:
  • There a few ideas in the documentation as of my typing this it’s in the data-template section search terms:

    • Gist
    • OAuth