I've followed the instructions in this Google video and elsewhere to:
- connect to the v3 API using a static API key
- get the playlist ID for uploads for a channel, using the legacy channel ID (e.g. "GoogleDevelopers")
- use the playlistItems endpoint for that playlist to retrieve the list of videos uploaded to that YouTube account.
The first two stages work and I'm able to get the channel/playlist ID, but playlistItems is returning playlistNotFound every time (I've tested it with several different YouTube accounts.)
I've been trying to carefully check for typos - I can't spot anything wrong with the requests.
Any ideas, or can anyone reproduce the problem?
Example API call (using the GoogleDevelopers channel as shown in their video) - you'll need to generate your own API key to test this:
https://www.googleapis.com/youtube/v3/channels?key=[myAPIkey]&forUsername=GoogleDevelopers&part=id
Response:
{
"kind": "youtube#channelListResponse",
"etag": "\"IHLB7Mi__JPvvG2zLQWAg8l36UU/9Uu_LJKSiIBlJOBZoZLkKcjhUUE\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#channel",
"etag": "\"IHLB7Mi__JPvvG2zLQWAg8l36UU/JgZIwrlCnsd1wzjssCxaCFp8mRU\"",
"id": "UC_x5XG1OV2P6uZZ5FSM9Ttw"
}
]
}
Attempting to get the first video in the playlist:
{
"error": {
"errors": [
{
"domain": "youtube.playlistItem",
"reason": "playlistNotFound",
"message": "Not Found",
"locationType": "parameter",
"location": "playlistId"
}
],
"code": 404,
"message": "Not Found"
}
}
Note: I generated a server key, because this is going to run on a server. But I'm testing in a browser (with the IP addresses whitelisted.) This shouldn't cause any issues should it? (no auth errors so far.)