How to hit the YouTube Data API API

The YouTube Data API v3 at https://www.googleapis.com/youtube/v3 searches and reads public videos, channels, and playlists with an API key. part chooses which groups of fields come back.

Authentication

Create an API key in the Google Cloud console and enable the YouTube Data API v3 for the project. It goes in the query string as key. In the examples it's written {{YOUTUBE_API_KEY}}. Each call costs quota units; search is the expensive one.

Full reference: https://developers.google.com/youtube/v3/docs

Video details and stats

curl "https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics&id=dQw4w9WgXcQ&key={{YOUTUBE_API_KEY}}"
Run in PostTaco

Channel by handle

curl "https://www.googleapis.com/youtube/v3/channels?part=snippet,statistics&forHandle=@YouTube&key={{YOUTUBE_API_KEY}}"
Run in PostTaco