2013-04-26 222 views
6

我想使用YouTube API的v3檢索特定YouTube視頻的標籤。如何使用YouTube v3 API檢索YouTube視頻的標籤?

我可以將包含此請求的視頻檢索到搜索端點https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&q=cats&type=video&key= {YOUR_API_KEY}。

現在我點擊了視頻端點,試圖從上面的查詢中獲取視頻的標籤。 https://www.googleapis.com/youtube/v3/videos?id=IytNBm8WA1c&part=snippet&key= {} YOUR_API_KEY

響應,

{ 
"kind": "youtube#videoListResponse", 
"etag": "\"PMn2rAVTRiZHkX45qiqfcLZoTXM/rYBuk4KeZFmSMoiSuaXfy6-Pm28\"", 
"items": [ 
    { 

    "id": "IytNBm8WA1c", 
    "kind": "youtube#video", 
    "etag": "\"PMn2rAVTRiZHkX45qiqfcLZoTXM/_6K6Qz8rLYf0d5gUnucV1LwbwU4\"", 
    "snippet": { 
    "publishedAt": "2007-07-09T14:02:03.000Z", 
    "channelId": "UCFMV3DqmnaRc4oNGvi-3OvQ", 
    "title": "Funny Cats", 
    "description": "it's soo funny :D\r\n\r\naudio content is licensed by UMG\r\n\r\nSong 1: Gioachino Rossini - The Thieving Magpie 0:00 - 1:37\r\nSong 2: The Presidents of the United States of America - Kitty 1:38 - 2:47\r\nSong 3: The Nutcracker 2:48 - 3:51\r\nSong 4: Smash Mouth - All Star 3:51 - 7:06\r\nSong 5: The Wiseguys - Ooh La La 7:07 - 7:43\r\n\r\nPS: i will ignore messages with the subject\r\n\"Business Proposal Regarding Your YouTube Videos\"", 
    "thumbnails": { 
    "default": { 
     "url": "https://i.ytimg.com/vi/IytNBm8WA1c/default.jpg" 
    }, 
    "medium": { 
     "url": "https://i.ytimg.com/vi/IytNBm8WA1c/mqdefault.jpg" 
    }, 
    "high": { 
     "url": "https://i.ytimg.com/vi/IytNBm8WA1c/hqdefault.jpg" 
    } 
    }, 
    "channelTitle": "nguoap", 
    "categoryId": "15" 
    } 
    } 
] 
} 

API瀏覽器的這一要求 - https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.videos.list?id=IytNBm8WA1c&part=snippet&_h=3&

即使我授權這一請求,我得到相同的結果。雖然,如果被授權的帳戶擁有該視頻,它將返回標籤

如何獲取我擁有的視頻的標籤而不要求最終用戶授權其帳戶?這個實現是JS的客戶端。

UPDATE:問題的GData鏈接:https://code.google.com/p/gdata-issues/issues/detail?id=4513

回答

13

根據https://developers.google.com/youtube/v3/docs/videos/list似乎在YouTube API的最新版本現在返回標籤:

比從未
https://www.googleapis.com/youtube/v3/videos?key={API-key}&fields=items(snippet(title,description,tags))&part=snippet&id={video_id} 
+0

猶未晚!感謝你的回答! – KRB 2015-11-03 14:05:10

+0

謝謝。其作品。 – 2016-01-19 16:02:19

1

不幸的是,目前你只能在你驗證自己的頻道所有者獲得與標記的視頻。搜索用於工作的標籤,但在當前的V2實現中使用is broken

相關問題