google-cloud-platformgoogle-apiyoutube-apiyoutube-data-apigoogle-apis-explorer

Why can't I get all comments by a specific user using the YouTube Data API?


The question

My application needs to check if a specific comment, on a known video was successful sent by a user of the app.

To do this, I need to use the YouTube Data API (or perhaps so other method).

There seems to be two ways I can do this:

  1. I get all comments sent by the channel, and filter for the specific video.
  2. I get all comments from the specific video, and filter for the specific channel.

CommentThreads (list by channelId) CommentThreads (list by videoId)

However, "list by video" isn't ideal since if the video has a large amount of comments, it'd be hard to find the comments by the user / take longer.

To be clear, it's not a random user, the user will give the YouTube scopes required to find such information.

The Problem

When I use the samples with the API Explorer from the YouTube Data API reference page, it simply doesn't work.

Here's the error I get:

{
  "error": {
    "code": 400,
    "message": "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the request's input is invalid. Check the structure of the \u003ccode\u003ecommentThread\u003c/code\u003e resource in the request body to ensure that it is valid.",
    "errors": [
      {
        "message": "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the request's input is invalid. Check the structure of the \u003ccode\u003ecommentThread\u003c/code\u003e resource in the request body to ensure that it is valid.",
        "domain": "youtube.commentThread",
        "reason": "processingFailure",
        "location": "body",
        "locationType": "other"
      }
    ]
  }
} 

To be clear: I'm using the pre-made samples provided by Google themselves.

1st screenshot of "code" 2nd screenshot of "code"

So, how would I fix this and make CommentThreads (list by channelId) work?

Similar Questions

Get list of all comments made by a given user with Youtube Data API? - This question isn't exactly answered, and since it seems they don't want to request the user's consent the comments say that it's against YouTube policy and don't really mention the YouTube Data API. But most importantly, does not mention CommentThreads (channelId). For this reason, mainly the difference in consent, I don't think my question is a duplicate.

How to get comments posted by a specific account (channel) through YouTube Data API? - This question is much closer to mine, and even mentions CommentThreads, but they ignored the obvious "list by channelId" (unless it was implemented into the API after the question was asked), regardless there was no answer to my question.


Solution

  • Thanks to the suggest made by @Marco Aurelio Fernandez Reyes, I looked at the IssueTracker and found that an issue that explained that this is an intended feature.

    "CommentThreads (find by channelId)" is no longer supported and hasn't been for several months now.

    Source material