Youtube Data API v3: commentThread call fails for some comment threads

I have a problem calling the comments API. Here's one specific case: comment id: z13ocxipdz3hwxqqe04cgbuadtmnhhmybyc0k

https://www.googleapis.com/youtube/v3/commentThreads?id=z13ocxipdz3hwxqqe04cgbuadtmnhhmybyc0k&part=snippet%2C+replies&key= {YOUR_DEVELOPER_KEY} & = json & order = time

There are currently 44 responses on the site.

But if you are using video_id (not a comment like we did above). Reference: https://www.googleapis.com/youtube/v3/commentThreads?videoId=Ui-ulCWmpOU&maxResults=100&pageToken=ChYQp7fipbfsxgIYkNGqiobjxQIgACgDEhQIABCQ0aqKhuPFAhiMqqKive-5AhgCIKwC&part=snippet%2C+replies&key= {} & YOUR_DEVELOPER_KEY alt = alt = & json & json; order = time) and bump into a comment (you may have to use pageToken to iterate over pages), you will see this:

39 replies but no replies section

(Screenshot: https://www.dropbox.com/s/d4bf9tk51eaw7dr/Screenshot%202015-07-21%2021.08.31.png?dl=0 )

As you noticed; there are 39 replies (comments) which is not correct. And even if we have the answers; in the answer section no. Did I miss something?

Two questions: why doesn't the number of answers match? Why does this comment Thread have no answers even though it has 39 answers?

Notes: How part

I am using 'snippet, replies'. I am not getting an API error (like throttle or limitation violation)

+3


source to share


2 answers


While I could not answer your questions exactly, I was able to find useful information that can give you some clarity and direction.

Regarding the specific case outlined in your question, a user "authorDisplayName": "Tammy L."

commented on a video "videoId": "Ui-ulCWmpOU"

from 11/16/2013 and received responses between 11/16/2013 and 11/18/2013. According to Tammy L.'s Google+ post, her original comment from this date is 44 replies:

enter image description here



Although, according to the YouTube post, it seems like there are 42 responses in her comment, which doesn't match any of the values ​​returned from the API calls. Even weirder still, Google won't display comments when I click "See all 42 replies":

enter image description here

The challenge seems to commentId

provide the correct number of responses made to Tammy L.'s original comment, which is consistent with the number of responses shown on her Google+ account. Perhaps the calling issues videoId

(including the fact that this call does not provide replies

) relate to the changes Google is implementing around the time Tammy L. made his initial comment (November 2013), although I'm not entirely sure.

+1


source


From the comments of the Threads documentation :

The commentThread resource does not necessarily contain all the responses to a comment, and you need to use the comments.list method if you want to get all the responses for a particular comment.

Use comment.list instead and give the id of commentThread for parentId

.

When I call the following call:

https://www.googleapis.com/youtube/v3/comments?part=snippet,id&parentId=z13ocxipdz3hwxqqe04cgbuadtmnhhmybyc0k&key=[API_KEY_HERE]&order=time&maxResults=50

      

I get all (44) responses for the comment topic you mentioned.



To ask your questions:

Why doesn't the number of responses match?

If I had to guess, I would say it might have to do with the way the API distinguishes between comments and comment streams (where it looks at replies to other answers in the stream, not related to the video itself). Since the documentation states that the commentThread resource may not contain all the responses to the comment, I think this still works as intended. Anyway, in the future it will generally be better to just go with a higher number of reported posts, as the API is more likely to miss some results than reporting additional results. Also, remember that you must use comment.list if you want all responses to be piped into a specific comment thread.

Why does this comment Thread have no answers even though it has 39 answers?

To be honest, I'm not sure if it's a YouTube thing or a G + thing. When I looked at some of the other comment threads that had responses, I was able to see them through an API call when the video id is specified. However, as Daniel said, you cannot see the responses to the thread you specified on the video itself (but you can see them when you go to this G + page). The user may have done something with their G + settings in relation to comments on their general posts, so they don't appear on the video itself and therefore don't appear in the comment list request. It's hard to tell unless you've spoken to someone familiar with G + / YouTube integration.

+1


source







All Articles