Closed AlexandriaOL closed 3 years ago
The existing one works fine:
$ export YOUTUBE_API_KEY='<snip>'
$ curl "https://www.googleapis.com/youtube/v3/search?key=$YOUTUBE_API_KEY&part=id&maxResults=1&q=test+video&type=video"
{
"kind": "youtube#searchListResponse",
"etag": "xDGVEwA4PHypG4tDJboOkldp5dg",
"nextPageToken": "CAEQAA",
"regionCode": "US",
"pageInfo": {
"totalResults": 1000000,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#searchResult",
"etag": "s5Kj5v_Hspi8H8OifxluVhM7tTY",
"id": {
"kind": "youtube#video",
"videoId": "LXb3EKWsInQ"
}
}
]
}
If you received an error, perhaps your key is configured incorrectly.
The documentation also suggests that https://www.googleapis.com/youtube/v3/search
is the correct URL.
Yeah, turns out there's a difference between getting the API key directly through apis and services -> youtube v3 data api -> credentials
(which doesn't work) as opposed to apis and services -> credentials
:/
What it says on the tin. Fix the sample curl request so it doesn't error.