I am trying to validate youtube video ids..get some info from youtube-validation...but its not working seems http://gdata.youtube.com/feeds/api/videos/VIDEO_ID is no more active link or depricated. Any help would be more appriciated.
Asked
Active
Viewed 150 times
1 Answers
0
Check out the Youtube Google API Explorer, specifically the youtube.videos.list
service. If you issue a request such as https://www.googleapis.com/youtube/v3/videos?part=id&id=VIDEO_ID
, (you must be authenticated) it should return a response with the video info under the items
attribute. If items
is empty, a video with that id does not exist. For example, a valid video may return a JSON response like this:
{
"kind": "youtube#videoListResponse",
"etag": "\"fpJ9onbY0Rl_LqYLG6rOCJ9h9N8/2sdqvy58GwqpgneamWQjMdcDsqc\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "\"fpJ9onbY0Rl_LqYLG6rOCJ9h9N8/u5C_LXE-00OOvmXch-wqbcTQQ5Q\"",
"id": "VapbvTq8GOE"
}
]
}
But if the video id is invalid, items will be empty []

evan_schmevan
- 1,591
- 12
- 19