# YouTube Data API v3 example, get all videos of a channel. # Request: Get the playlist ID for channel's uploaded videos # https://developers.google.com/youtube/v3/docs/channels/list curl \ 'https://youtube.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=youtube&key=[YOUR_API_KEY]' \ --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \ --header 'Accept: application/json' \ --compressed # Response: { "kind": "youtube#channelListResponse", "etag": "FkVc2964Bz2gz698JINc2iLU5SU", "pageInfo": { "totalResults": 1, "resultsPerPage": 5 }, "items": [ { "kind": "youtube#channel", "etag": "KtwKqtpT7ADmb2Z7f6Q67dPrVSU", "id": "UCBR8-60-B28hp2BmDPdntcQ", "contentDetails": { "relatedPlaylists": { "likes": "", "uploads": "UUBR8-60-B28hp2BmDPdntcQ" # <-- The playlist ID for channel's uploads } } } ] } # Get the first 50 videos of the uploads playlist, using the playlist ID. # https://developers.google.com/youtube/v3/docs/playlistItems/list curl \ 'https://youtube.googleapis.com/youtube/v3/playlistItems?part=snippet&maxResults=50&playlistId=UUBR8-60-B28hp2BmDPdntcQ&key=[YOUR_API_KEY]' \ --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \ --header 'Accept: application/json' \ --compressed # Response. # From here you could grap the relevant video info, # then use the "nextPageToken" to grab the next 50 videos, # and keep going until you exhaust the list. # Note that this has a quota cost of 1 per request (with max. 50 videos per request), # and there could be very many pages to iterate through for some channels. { "kind": "youtube#playlistItemListResponse", "etag": "H6l2JM74fs4OnCeSoSKmtSZnvqc", "nextPageToken": "EAAaBlBUOkNESQ", "items": [ { "kind": "youtube#playlistItem", "etag": "bHRrol6jUXf4W_NIwSWJ6D6K22E", "id": "VVVCUjgtNjAtQjI4aHAyQm1EUGRudGNRLjNEMDlxR2lwU0c0", "snippet": { "publishedAt": "2022-12-08T17:00:01Z", "channelId": "UCBR8-60-B28hp2BmDPdntcQ", "title": "i’m still recovering from meeting all my fave creators at this year’s #streamys 😭", "description": "i’m still recovering from meeting all my fave creators at this year’s #streamys 😭 catch the full show at yt.be/streamys to spot even more creators", "thumbnails": { "default": { "url": "https://i.ytimg.com/vi/3D09qGipSG4/default.jpg", "width": 120, "height": 90 }, "medium": { "url": "https://i.ytimg.com/vi/3D09qGipSG4/mqdefault.jpg", "width": 320, "height": 180 }, "high": { "url": "https://i.ytimg.com/vi/3D09qGipSG4/hqdefault.jpg", "width": 480, "height": 360 }, "standard": { "url": "https://i.ytimg.com/vi/3D09qGipSG4/sddefault.jpg", "width": 640, "height": 480 }, "maxres": { "url": "https://i.ytimg.com/vi/3D09qGipSG4/maxresdefault.jpg", "width": 1280, "height": 720 } }, "channelTitle": "YouTube", "playlistId": "UUBR8-60-B28hp2BmDPdntcQ", "position": 0, "resourceId": { "kind": "youtube#video", "videoId": "3D09qGipSG4" }, "videoOwnerChannelTitle": "YouTube", "videoOwnerChannelId": "UCBR8-60-B28hp2BmDPdntcQ" } }, # ], "pageInfo": { "totalResults": 614, "resultsPerPage": 50 } }