I have started using v3 of the YouTube apis on an android device, using the java client library. Some videos that I am interested in have transcripts that I can access on the web interface (like educational videos). Is there a way to access the transcripts, if present, using the v3 apis?
Thanks
I had the same problem with this... and spent like a week looking for a solution until I hit this:
https://stackoverflow.com/questions/10036796/how-to-extract-subtitles-from-youtube-videos
Just do a GET request on: http://video.google.com/timedtext?lang={LANG}&v={VIDEOID}
You don't need any api/oauth/etc. to access this.
With API v3 you can first grab the available transcripts with the snippet:
https://www.googleapis.com/youtube/v3/captions?videoId=U1e2VNtEqm4&part=snippet&key=(my_api_key):
{
"kind": "youtube#captionListResponse",
"etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/aGHflncRxq1Uz6m1akhrOLUWUqU\"",
"items": [
{
"kind": "youtube#caption",
"etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/IC7rNKkn3SQNdovFwR6fEabUYnY\"",
"id": "TqXDnlamg84o4bX0q2oaHz4nfWZdyiZMOrcuWsSLyPc=",
"snippet": {
"videoId": "U1e2VNtEqm4",
"lastUpdated": "2016-01-25T21:50:27.142Z",
"trackKind": "standard",
"language": "en-GB",
"name": "",
"audioTrackType": "unknown",
"isCC": false,
"isLarge": false,
"isEasyReader": false,
"isDraft": false,
"isAutoSynced": false,
"status": "serving"
}
},
{
"kind": "youtube#caption",
"etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/5UP1qPkmq6mzTUaEVnFC8WqjFgU\"",
"id": "TqXDnlamg84o4bX0q2oaHw_Y53ilUWv6vMFbk0RL3XY=",
"snippet": {
"videoId": "U1e2VNtEqm4",
"lastUpdated": "2016-01-25T21:55:07.481Z",
"trackKind": "standard",
"language": "en-US",
"name": "",
"audioTrackType": "unknown",
"isCC": false,
"isLarge": false,
"isEasyReader": false,
"isDraft": false,
"isAutoSynced": false,
"status": "serving"
}
}
]
}
And then pick the transcript you want:
https://www.googleapis.com/youtube/v3/captions/id?id=TqXDnlamg84o4bX0q2oaHz4nfWZdyiZMOrcuWsSLyPc=
or
https://www.googleapis.com/youtube/v3/captions/TqXDnlamg84o4bX0q2oaHz4nfWZdyiZMOrcuWsSLyPc=
at which point you need provide an authorization key. Apparently a simple key isn't enough. Possibly because:
Quota impact: A call to this method has a quota cost of approximately 200 units.
Note the slight difference in the URLs (/caption/ versus /caption?).
All the lovely documentation is here:
https://developers.google.com/youtube/v3/docs/captions
I may be wrong, but I don't think there is yet a documented way to get the caption track via v3 of the API. If you're authenticating with oAuth2, however, your authentication will also be good for v2 of the API, so you could do a quick call to this feed:
http://gdata.youtube.com/feeds/api/videos/[VIDEOID]/captiondata/[CAPTION TRACKID]
to get the data you want. To retrieve a list of possible caption track IDs with v2 of the API, you access this feed:
https://gdata.youtube.com/feeds/api/videos/[VIDEOID]/captions
That feed request also accepts some optional parameters, including language, max-results, etc. For more details, along with a sample that shows the returned format of the caption track list, see the documentation at https://developers.google.com/youtube/2.0/developers_guide_protocol_captions#Retrieve_Caption_Set
Heres some code I wrote which grabs all the caption tracks from any youtube video without having to use the API. Just plug the video URL in the $video_url variable.
// get video id from url
$video_url = 'https://www.youtube.com/watch?v=kYX87kkyubk';
preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+(?=\?)|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $video_url, $matches);
// get video info from id
$video_id = $matches[0];
$video_info = file_get_contents('http://www.youtube.com/get_video_info?&video_id='.$video_id);
parse_str($video_info, $video_info_array);
if (isset($video_info_array['caption_tracks'])) {
$tracks = explode(',', $video_info_array['caption_tracks']);
// print info for each track (including url to track content)
foreach ($tracks as $track) {
parse_str($track, $output);
print_r($output);
}
}
Probably the best way is using Youtube API 3. I'm trying it but you need an API key + OAuth 2.0 user. A fast solution is using captionsgrabber and parsing the returned HTML data.
Use example:
https://www.captionsgrabber.com/8302/get-captions.00.php?id=UJTY7ilwSq4
// Where the id is the youtube video id
Related
I want to use the YouTube API to get the snippet of their description. However, I want it to be the primary text snippet describing the video YouTube uses as the snippet, which is different from the data api's response.
Let me give an example to clear things up:
This video will be the demonstration: https://www.youtube.com/watch?v=ADPFEw-7FtU
At the top of this description is the text "Compress Decades Into Days. Get Dan Lok’s World-Class Training Solutions to Grow Your Income, Influence and Wealth Today. Start Here ► [redacted]"
On the YouTube data API search snippet the response is: "Compress Decades Into Days. Get Dan Lok's World-Class Training Solutions to Grow Your Income, Influence and Wealth Today.". This makes sense because they're both at the start of the description. Now this is where I get confused.
If you search the title on YouTube (not the API), you'll actually see that the description is "Have you ever thought of starting an exciting YouTube career on YouTube doing what you love? Or maybe you have started, but ..."
This is the snippet I want. I want their video's "Primary SEO Search Snippet", which describes the video. Is there anyway to calculate this or get this from the API using another method? I don't want to use any non-official API/library to do this.
What this is not:
This is not any caching that has yet to expire/update
Unique to this video. There are plenty of videos where this happens
As far as I know there isn't any official API providing the data you are looking for. Anyway if you change your mind about not using unofficial APIs, then you can proceed as follows by trying out my open-source YouTube operational API. Indeed by fetching https://yt.lemnoslife.com/search?part=snippet&q=YOUR_QUERY, you will notably get the primary SEO search snippet you are looking for in item["snippet"]["detailedMetadataSnippet"].
For instance with "How To Grow With 0 Views And 0 Subscribers" you would get:
{
"kind": "youtube#searchListResponse",
"etag": "NotImplemented",
"items": [
{
"kind": "youtube#searchResult",
"etag": "NotImplemented",
"id": {
"kind": "youtube#video",
"videoId": "ADPFEw-7FtU"
},
"snippet": {
"channelId": "UCs_6DXZROU29pLvgQdCx4Ww",
"title": "How To Grow With 0 Views And 0 Subscribers",
"thumbnails": [
{
"url": "https:\/\/i.ytimg.com\/vi\/ADPFEw-7FtU\/hq720.jpg?sqp=-oaymwEjCOgCEMoBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLCKNA5T652tMTvnOw22llDniM9O6Q",
"width": 360,
"height": 202
},
...
],
"channelTitle": "Dan Lok",
"channelHandle": "DanLok",
"timestamp": "3 years ago",
"duration": 887,
"views": 4495095,
"badges": [
"CC"
],
"channelApproval": "Verified",
"channelThumbnails": [
{
"url": "https:\/\/yt3.ggpht.com\/ytc\/AMLnZu_TXnQ07ufj6eGxco9yHndCCcV5KfAizZ9jbI8vmA=s68-c-k-c0x00ffffff-no-rj",
"width": 68,
"height": 68
}
],
"detailedMetadataSnippet": "Have you ever thought of starting an exciting YouTube career on YouTube doing what you love? Or maybe you have started, but\u00a0...",
"chapters": [
{
"title": "Intro",
"time": 0,
"thumbnails": [
{
"url": "https:\/\/i.ytimg.com\/vi\/ADPFEw-7FtU\/hqdefault_25933.jpg?sqp=-oaymwEjCNACELwBSFryq4qpAxUIARUAAAAAGAElAADIQj0AgKJDeAE=&rs=AOn4CLBVOtOt_jLJd1dRRt5_dj3SlGBtRA",
"width": 336,
"height": 188
}
]
},
...
]
}
},
...
]
}
I wanted to add an answer for anyone trying to do this in 2023 and onwards.
I opened a ticket on the Google Issue Tracker regarding this issue: This was their response.
Hi Conor,
I was able to reproduce this behavior, and also found that neither a search resource description nor a video resource description will display the "Primary SEO Search Snippet" that you are seeking. Thus, I have opened up a feature request with our internal team to request this functionality, but I can't guarantee this feature will be implemented. Thus for updates regarding this, I recommend keeping an eye on our revision history.
You can use the unofficial API as per Benjamin's answer, but unfortunately, that can cause other issues depending on the scale you need to use this feature.
I am aware of similar questions being asked before, but not this exact one, so please bear with me...
I want to reproduce a channel's uploaded videos list as they appear on YouTube's web page (broken into pages and sorted by publish date).
To do this, I am trying to get a list of VideoIDs from a YouTube channel that's sorted by publish date (by YouTube, not my code since there could be 1000's of videos in a playlist and YouTube limits to 50 results per query which can add up when I only want to show the user the first 25 entries).
Initially, I was using this YouTube Data API v3 Search query:
https://www.googleapis.com/youtube/v3/search?key=[APIKey]&channelId=[ChannelID]&part=snippet,id&order=date&type=video&maxResults=25
However, as some of the previous posts on stackoverflow mentioned (YouTube API v3 Search not returning all videos), this method does not guarantee to return all videos and indeed, some videos are missing from the result, making use of this query problematic.
I then saw this google video in some of the posts:
https://www.youtube.com/watch?v=RjUlmco7v2M
In the video, it is explained that you must first get the 'uploads' playlist for a channel (I'm also grabbing the channel's title and thumbnail in this query), which I do using:
https://www.googleapis.com/youtube/v3/channels?key=[APIKEY]&part=snippet,contentDetails&id=[ChannelID]
And once I have the 'uploads' playlist ID, I query:
https://www.googleapis.com/youtube/v3/playlistItems?key=[APIKey]&playlistId=[PlaylistID]&part=snippet,id&order=date&type=video&maxResults=25
However, the returned entries are not sorted by the publish date and according to the documentation (https://developers.google.com/youtube/v3/docs/playlistItems/list), there is no optional "order" parameter associated with this query.
With all these issues in mind, how do I get the first 25 entries of the 'uploads' playlist sorted by publish date without downloading the entire playlist so I can faithfully recreate how the YouTube website is listing videos.
After making some tests and thanks to this answer (and the next answers too) I was able to retrieve the information you need using the YouTube Data API v3 and here is how I made it:
First, in your question you're using the "search" API - since I don't know which criteria you're using in the search request, I omitted it for get direct to get the "upload" playlist id from a given channel_id.
Using the channel_id = UCT2rZIAL-zNqeK1OmLLUa6g (which belongs to "Microsoft HoloLens"), I use the "channels" API for retrieve the uploads playlist id.
Here is the URL request for retrieve the "upload" playlist id from the channel_id previously mentioned:
https://www.googleapis.com/youtube/v3/channels?part=id%2Csnippet%2CcontentDetails&fields=items(contentDetails%2FrelatedPlaylists%2Fuploads%2Csnippet%2Flocalized)&id=UCT2rZIAL-zNqeK1OmLLUa6g&key=<YOUR_API_KEY>
Explanation:
part: set the snippet and contentDetails parts for retrieve the following:
fields: from the snippet part: (localized, description and title) and from the contentDetails part: (relatedPlayLists and uploads).
id: channel_id used in this request.
Here are the results from this request:
{
"items": [
{
"snippet": {
"localized": {
"title": "Microsoft HoloLens",
"description": "The official YouTube channel of Microsoft HoloLens. Transform your world with holograms. Visit HoloLens.com for more info."
}
},
"contentDetails": {
"relatedPlaylists": {
"uploads": "UUT2rZIAL-zNqeK1OmLLUa6g"
}
}
}
]
}
Check the value of the uploads property in the
contentDetails section. This value will be used in the next API request.
You can also check these results in the Google API Explorer demo I prepared for make this request.
Once retrieved the uploads value (as specified in previous lines), now it's time to use the "playlistItems" API for build the following URL:
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&playlistId=UUT2rZIAL-zNqeK1OmLLUa6g&fields=items(contentDetails(videoId%2CvideoPublishedAt)%2Csnippet%2Ftitle%2Cstatus)&maxResults=25&key=<YOUR_API_KEY>
Explanation:
part: set the snippet and contentDetails parts for retrieve the following:
fields: from the snippet part: (title and status) and from the contentDetails part: (videoId and videoPublishedAt).
playlistId: is the playlistId used in this request - (that is, the uploads value).
maxResults: set to 25.
Here are the results from this request:
{
"items": [
{
"snippet": {
"title": "Microsoft Windows Mixed Reality update | October 2018"
},
"contentDetails": {
"videoId": "00vnln25HBg",
"videoPublishedAt": "2019-01-04T17:43:47.000Z"
}
},
{
"snippet": {
"title": "How to use Spectator View for mobile devices"
},
"contentDetails": {
"videoId": "3fXlPw_FGLg",
"videoPublishedAt": "2018-10-15T17:13:42.000Z"
}
},
{
"snippet": {
"title": "Microsoft HoloLens: Visualizing the next mission to Mars."
},
"contentDetails": {
"videoId": "XVBbJ4EtAQY",
"videoPublishedAt": "2018-07-02T16:30:26.000Z"
}
},
{
"snippet": {
"title": "Microsoft HoloLens: Making mixed reality plug and play."
},
"contentDetails": {
"videoId": "QwXcSekZKWE",
"videoPublishedAt": "2018-06-25T23:25:55.000Z"
}
},
{
"snippet": {
"title": "Microsoft HoloLens | Windows Mixed Reality HMD Exerciser"
},
"contentDetails": {
"videoId": "RU3OMjq_Yic",
"videoPublishedAt": "2018-05-14T16:58:43.000Z"
}
}
]
}
I check the order of the items and they are in sorted by videoPublishedAt value (new to old).
You can also check these results in the try-it funcionality found in the YouTube Data API v3 - official documentation.1
1 For this case, I was unable to use the Google API Explorer (as I used in the first request) because I always got a "backend Error".
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 500,
"message": "Backend Error"
}
}
I think this is because the Google API explorer is outdated.
If anyone want to check it out, here is the demo.
I'm also using the playlist ID to get a list of videos, however mine do seem to be sorted by date from newest to oldest. Note that Youtube returns a page token that you can use to get the next 25 (or in my case 50) videos. I'm querying the API this way:
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&pageToken= not_used_for_first_query&fields=nextPageToken,items(snippet(publishedAt,title,desc ription,thumbnails(default(url)),resourceId(videoId)))&playlistId=uploads_playlist_id&maxResults=50&order=date&key=your_api_key
This gets back in JSON response:
The video title
Publish date
Video description
Youtube URL for video
Video unique ID
Video thumbnail
You can see my working example at https://www.scriptbarrel.com
I need to get metrics (primarily total live views and total/avg live view duration) for YouTube LIVE events. I'm having trouble with both v2 and v3 APIs.
I can schedule and stream through the API fine, and I'd like to pull the analytics as soon as the broadcast ends to roll up some reports.
Question
How can I get total or average live view duration from the v3 API?
Or, how can I properly query the v2 reports API for Live events to get non-zero data back?
More Details On Current Attempts
Here are the types of queries I've tried:
YouTube v3 API:
https://www.googleapis.com/youtube/v3/videos?
id={live_video_id}&
part={"statistics,liveStreamingDetails"}&
access_token={access_token}
{
"kind": "youtube#videoListResponse",
"etag": "...",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "...",
"id": "..",
"statistics": {
"viewCount": "38",
"likeCount": "1",
"dislikeCount": "0",
"favoriteCount": "0",
"commentCount": "0"
},
"liveStreamingDetails": {
"actualStartTime": "2018-10-11T12:01:23.000Z",
"actualEndTime": "2018-10-11T14:00:12.000Z",
"scheduledStartTime": "2018-10-11T12:00:00.000Z",
"scheduledEndTime": "2018-10-11T14:00:00.000Z"
}
}
]
}
I can get statistics.viewCount count here, but there's no way to get the avg/total time watched.
YouTube v2 Reports API:
https://youtubeanalytics.googleapis.com/v2/reports?
startDate={"2017-01-01"}&
endDate={time.Now().Add(24*time.Hour).Format("YYYY-MM-DD")}&
filters={"video==" + live_video_id}&
metrics={"views,estimatedMinutesWatched"}&
ids={"channel==MINE"}&
access_token={accessToken}
{
"kind": "youtubeAnalytics#resultTable",
"columnHeaders": [
{
"name": "views",
"columnType": "METRIC",
"dataType": "INTEGER"
},
{
"name": "estimatedMinutesWatched",
"columnType": "METRIC",
"dataType": "INTEGER"
}
],
"rows": [
[
0,
0
]
]
}
This query would seem to give the metrics I need, but it's all 0s, even when v3 returns non-zero views.
TL;DR YouTube Reports API v2 doesn't update the metrics quite often for less popular live streams.
This is how I reached this conclusion...
I fetched the views, estimatedMinutesWatched of an old video from my channel. While both these APIs worked, the view count returned by the YouTube Reports API v2 was not accurate and was lagging behind the YouTube Data API v3.
Next, I ran a Livestream (unlisted) and engaged on the stream with a few other accounts. None of these engagements (like, subscribe, views) was shown in the Reports API v2 nor in YouTube Studio Analytics. This proves that the "rows": [[0,0]] returned by YouTube Reports API v2 is completely normal. But surprisingly, the Data API v3 did return the correct metrics as you pointed out.
For live streams with large audience and engagement, the Reports API may work perfectly fine.
Since the Data API doesn't provide watch times of any sort, your best bet would be to use both these APIs in conjunction, Data API v3 to fetch the basic metrics like views, likes,.. and the Reports API v2 for more sophisticated metrics.
Tip: If you are interested in displaying the live stream metrics later on, you can use the dimension=liveOrOnDemand parameter and filter the metrics to the LIVE stream alone.
i am using API Live Streaming youtube to retrieve list of live chat messages on youtube video using id_video, exits serveral properties that appear in this resource such as snippet.liveChatId, snippet.displayMessage which i can found them from this ressource,
so my question is how can i get the title on live video in channel youtube which is not for me ?
thanks
You may want to check this documentation. The items[] property will return a list of live streams that match the request criteria.
{
...
},
"items": [
liveStream Resource
]
}
The following JSON structure shows the format of a liveStreams resource:
{
"kind": "youtube#liveStream",
"etag": etag,
"id": string,
"snippet": {
"publishedAt": datetime,
"channelId": string,
"title": string,
"description": string,
"isDefaultStream": boolean
},
...
}
I am trying to retrieve all comments to a video with all replies, however, using the Test It interface (or the Java library) I have not been able to retrieve all comments - I have following two examples, when I have failed:
Example 1
The example video and comment is https://www.youtube.com/watch?v=xCLy2DZdXhY&lc=z12ei1s5gs2mc303523qsdigcxmphhlrd04
When I retrieve the comment using
GET https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&id=z12ei1s5gs2mc303523qsdigcxmphhlrd04&fields=etag%2CeventId%2Citems%2Ckind%2CnextPageToken%2CpageInfo%2CtokenPagination%2CvisitorId&key={YOUR_API_KEY}
I receive:
And note the "totalReplyCount": 2, line.
However, when I try to obtain all replies using the parentId:
GET https://www.googleapis.com/youtube/v3/comments?part=snippet&parentId=z12ei1s5gs2mc303523qsdigcxmphhlrd04&fields=etag%2CeventId%2Citems%2Ckind%2CnextPageToken%2CpageInfo%2CtokenPagination%2CvisitorId&key={YOUR_API_KEY}
I receive an empty response:
Remarks
I have read Youtube Data API v3: commentThread call doesn't give replies for some comment threads , however, it does not provide me the answer as I do use the comments list with parentId and I am still not getting any replies.
Even if I try the not recommended way - using the part snippet,replies, I do not get any replies:
Request:
GET https://www.googleapis.com/youtube/v3/commentThreads?part=snippet%2Creplies&id=z12ei1s5gs2mc303523qsdigcxmphhlrd04&fields=etag%2CeventId%2Citems%2Ckind%2CnextPageToken%2CpageInfo%2CtokenPagination%2CvisitorId&key={YOUR_API_KEY}
However, if I do not specify the comment thread by its ID and specify that I want all comment threads for the video:
GET https://www.googleapis.com/youtube/v3/commentThreads?part=snippet%2Creplies&videoId=xCLy2DZdXhY&fields=etag%2CeventId%2Citems%2Ckind%2CnextPageToken%2CpageInfo%2CtokenPagination%2CvisitorId&key={YOUR_API_KEY}
Then voila - The comment thread is now with those two replies:
Why do I receive the replies now and not when I either specify the replies by their parentId or when I specify the comment thread by its id?
Moreover, if I take the (weird) id of one of the replies and try to obtain the comment with this reply, I will receive empty response:
GET https://www.googleapis.com/youtube/v3/comments?part=snippet&id=z12ei1s5gs2mc303523qsdigcxmphhlrd04.1443381718685326&fields=etag%2CeventId%2Citems%2Ckind%2CnextPageToken%2CpageInfo%2CtokenPagination%2CvisitorId&key={YOUR_API_KEY}
Example 2
This problem is a bit different.
I have a video https://www.youtube.com/watch?v=-c76GeR2IWg with 7 comments (6 of them are top levels). When I try to obtain all top level comments related to this video I receive only 4 of them.
GET https://www.googleapis.com/youtube/v3/commentThreads?part=snippet%2Creplies&videoId=-c76GeR2IWg&fields=etag%2CeventId%2Citems%2Ckind%2CnextPageToken%2CpageInfo%2CtokenPagination%2CvisitorId&key={YOUR_API_KEY}
One of the missing comments in the response is https://www.youtube.com/watch?v=-c76GeR2IWg&lc=z120d11g2yyjyxcxw04cg1xbaqfnslfaamk0k .
When I train to obtain comment thread with this id, I do obtain the comment thread:
GET https://www.googleapis.com/youtube/v3/commentThreads?part=snippet%2Creplies&id=z120d11g2yyjyxcxw04cg1xbaqfnslfaamk0k&fields=etag%2CeventId%2Citems%2Ckind%2CnextPageToken%2CpageInfo%2CtokenPagination%2CvisitorId&key={YOUR_API_KEY}
And also, when I try to obtain the replies for this comment (there should be 1 reply) I receive an empty response:
GET https://www.googleapis.com/youtube/v3/comments?part=snippet&parentId=z120d11g2yyjyxcxw04cg1xbaqfnslfaamk0k&fields=etag%2CeventId%2Citems%2Ckind%2CnextPageToken%2CpageInfo%2CtokenPagination%2CvisitorId&key={YOUR_API_KEY}
Remarks
For both examples, the number of comments is less than the size of the page. For this simple example, I have skipped pagination and chose examples with only a few comments, in the real application I use the pagination but I do not get more results.
I do not really understand how is the YouTube and G+ integrated together, thus this might be the issue, however, I was always accesing these videos using only youtube, not checking the users' G+ page, thus I would say that this should not be the case.
Similar questions on SO:
How can I see all the comments with the Youtube API? This is about V2 API, thus no use for me.
Youtube Data API v3: commentThread call doesn't give replies for some comment threads This question is very similar and raises similar problems, however, it is exactly the other way around - The author does not receive all replies using the commentThread replies (which is agreeing with the documentation), however, the proposed solution is "Use the comments.listcall instead and specify the commentThread's ID for the parentId." - which is exactly what does not work for me.
YouTube Data API v3 Comment Thread Discrepency The author forgot about pagination.
YouTube Data API v3 - Comment threads request doesn't return all comments Similar question, yet without any answer.
When I do the following via HTTP request:
https://www.googleapis.com/youtube/v3/comments?part=snippet&parentId=z12ei1s5gs2mc303523qsdigcxmphhlrd04&fields=etag%2CeventId%2Citems%2Ckind%2CnextPageToken%2CpageInfo%2CtokenPagination%2CvisitorId&key={YOUR_API_KEY}
I get the following response:
items": [
{
"kind": "youtube#comment",
"etag": "\"0KG1mRN7bm3nResDPKHQZpg5-do/aOipn7OKd9ibVua9TWdtD2vJJgI\"",
"id": "z12ei1s5gs2mc303523qsdigcxmphhlrd04.1443381718685326",
"snippet": {
"textDisplay": "JM",
"parentId": "z12ei1s5gs2mc303523qsdigcxmphhlrd04",
"authorDisplayName": "Asia Price",
"authorProfileImageUrl": "https://lh3.googleusercontent.com/-XdUIqdMkCWA/AAAAAAAAAAI/AAAAAAAAAAA/4252rscbv5M/photo.jpg?sz=50",
"authorChannelUrl": "http://www.youtube.com/channel/UCtUuxM3_g2hWA7qr17d85RQ",
"authorChannelId": {
"value": "UCtUuxM3_g2hWA7qr17d85RQ"
},
"authorGoogleplusProfileUrl": "https://plus.google.com/100662746258967935686",
"canRate": false,
"viewerRating": "none",
"likeCount": 0,
"publishedAt": "2015-09-27T19:21:58.685Z",
"updatedAt": "2015-09-27T19:21:58.685Z"
}
},
{
"kind": "youtube#comment",
"etag": "\"0KG1mRN7bm3nResDPKHQZpg5-do/NtowtHGdhytzw9YY9RxUopEgoTA\"",
"id": "z12ei1s5gs2mc303523qsdigcxmphhlrd04.1443365800258222",
"snippet": {
"textDisplay": "0",
"parentId": "z12ei1s5gs2mc303523qsdigcxmphhlrd04",
"authorDisplayName": "FAY Fay",
"authorProfileImageUrl": "https://lh3.googleusercontent.com/-XdUIqdMkCWA/AAAAAAAAAAI/AAAAAAAAAAA/4252rscbv5M/photo.jpg?sz=50",
"authorChannelUrl": "http://www.youtube.com/channel/UC5b4dTxK4ae_roaMWMYpglQ",
"authorChannelId": {
"value": "UC5b4dTxK4ae_roaMWMYpglQ"
},
"authorGoogleplusProfileUrl": "https://plus.google.com/100517618639903741268",
"canRate": false,
"viewerRating": "none",
"likeCount": 0,
"publishedAt": "2015-09-27T14:56:40.258Z",
"updatedAt": "2015-09-27T14:56:40.258Z"
}
}
I get the same results when I use the API explorer.
For your second example,
https://www.googleapis.com/youtube/v3/comments?part=snippet&parentId=z120d11g2yyjyxcxw04cg1xbaqfnslfaamk0k&fields=etag%2CeventId%2Citems%2Ckind%2CnextPageToken%2CpageInfo%2CtokenPagination%2CvisitorId&key={YOUR_API_KEY}
gives me
"items": [
{
"kind": "youtube#comment",
"etag": "\"0KG1mRN7bm3nResDPKHQZpg5-do/UBoqDwv8bg8xZpbIepzI_M5gp9o\"",
"id": "z120d11g2yyjyxcxw04cg1xbaqfnslfaamk0k.1409319325542384",
"snippet": {
"textDisplay": "Ahoj děkuju :) jo máš fajn videa :) ",
"parentId": "z120d11g2yyjyxcxw04cg1xbaqfnslfaamk0k",
"authorDisplayName": "Gumičkování s Péťou",
"authorProfileImageUrl": "https://lh4.googleusercontent.com/-VJce_PtJx70/AAAAAAAAAAI/AAAAAAAAABI/dabMtsy0haY/photo.jpg?sz=50",
"authorChannelUrl": "http://www.youtube.com/channel/UCAyuADHtiVTpiAbt2VVQhtQ",
"authorChannelId": {
"value": "UCAyuADHtiVTpiAbt2VVQhtQ"
},
"authorGoogleplusProfileUrl": "https://plus.google.com/101894467260220798842",
"canRate": false,
"viewerRating": "none",
"likeCount": 0,
"publishedAt": "2014-08-29T13:35:25.542Z",
"updatedAt": "2014-08-29T13:35:25.542Z"
}
}
It might be an issue with your request or API key. Try making a new one and using that.