使用YouTube API v3查询频道的品牌设置时,为什么他们会按渠道ID返回查询,但不会按用户名查询?API不会按用户名返回频道列表查询的品牌设置.
如果您按频道ID(例如id=UC8-Th83bH_thdKZDJCrn88g)查询频道的品牌设置,则会返回一组完整的品牌设置:
Google API Explorer:https://developers.google.com/youtube/v3/docs/channels/list
请求
GET https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&id=UC8-Th83bH_thdKZDJCrn88g&key={YOUR_API_KEY}
Run Code Online (Sandbox Code Playgroud)
响应
{
// ... snip ...
"items": [
{
"kind": "youtube#channel",
"etag": "\"...\"",
"id": "UC8-Th83bH_thdKZDJCrn88g",
"brandingSettings": {
"channel": {
"title": "The Tonight Show Starring Jimmy Fallon",
"description": "Watch The Tonight Show Starring Jimmy Fallon Weeknights 11:35/10:35c\n\nThe Tonight Show Starring Jimmy Fallon features hilarious highlights from the show including: comedy sketches, music parodies, celebrity interviews, ridiculous games, and, of course, Jimmy's Thank You Notes and hashtags! …Run Code Online (Sandbox Code Playgroud)