YouTube Data API

Hi, I would like to write a script, that get the channel_id from a channel url. For this, I was trying to use the username: https://www.youtube.com/@t3dotgg -> t3dotgg https://youtube.googleapis.com/youtube/v3/channels?part=id&forUsername=t3dotgg&key=[YOUR_API_KEY] but I get this response: 200
{
"kind": "youtube#channelListResponse",
"etag": "RuuXzTIr0OoDqI4S0RU6n4FqKEM",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
}
}
{
"kind": "youtube#channelListResponse",
"etag": "RuuXzTIr0OoDqI4S0RU6n4FqKEM",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
}
}
but if I use a different username like ludwig it works: 200
{
"kind": "youtube#channelListResponse",
"etag": "TAcFH8yqbppZUNBGKLFmQiISJUg",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#channel",
"etag": "uyh-UPnVJ-53EQBU_y-FVSAZ7xw",
"id": "UCZL4arowpEICMkWEPyx_vaQ"
}
]
}
{
"kind": "youtube#channelListResponse",
"etag": "TAcFH8yqbppZUNBGKLFmQiISJUg",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#channel",
"etag": "uyh-UPnVJ-53EQBU_y-FVSAZ7xw",
"id": "UCZL4arowpEICMkWEPyx_vaQ"
}
]
}
3 Replies
Ayato
Ayato2y ago
Ohh yea, that worked, thank you very much, do you know why the above method works for some but not for all?
Diogo
Diogo2y ago
no idea kkkkk never worked with youtube api
Want results from more Discord servers?
Add your server