Skip to main content
POST
/
youtube
/
video
/
comment
YouTube Video Comment
curl --request POST \
  --url https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "video_id": "Y2y4OpzKIK4",
  "page_size": 100,
  "next_page_token": null
}
'
{
  "code": 200,
  "msg": "success",
  "data": {
    "data": [
      {
        "comment_id": "UgwNEbW4EeYHeo7wBOp4AaABAg",
        "video_id": "otECntwBTVU",
        "reply_count": "74",
        "comment": {
          "comment_id": "UgwNEbW4EeYHeo7wBOp4AaABAg",
          "parent_comment_id": null,
          "text": "SUPPORT THE RESTAURANTS! ...",
          "author_name": "@StevenSchapiro",
          "author_url": "http://www.youtube.com/@StevenSchapiro",
          "publish_time": "2026-01-10T14:31:50Z",
          "like_count": "3676"
        }
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt

Use this file to discover all available pages before exploring further.

Product: Visual Intelligence — Social Media Scraping Use case: Fetch video metadata, transcripts, captions, and comments from YouTube, Instagram, TikTok, and Twitter/X Host: https://mavi-backend.memories.ai/serve/api/v2 Auth: Authorization: sk-mavi-... (no Bearer prefix)
This API is used to get the comment list for YouTube videos with pagination support.
Channel routing guide: see Social Media Scraping Overview. Endpoints with a channel request field let you choose apify, rapid, or memories.ai; endpoints without this field use managed routing.
Each API call costs $0.01 USD.

Channel Options

If your request supports a channel option, use it to control how scraper data is sourced:
ChannelWhat it meansTypical trade-off
apifyUses Apify, a dedicated web scraping platform with broad content coverage.Most stable and most complete results, but usually more expensive.
rapidUses RapidAPI, a lower-cost aggregation platform.Lower cost, but less stable and often narrower coverage.
memories.aiManaged routing by Memories.ai.Automatically selects the best price/performance path for your request.
Recommendation: Start with memories.ai unless you need to force a specific provider.
  • The maximum value for pagination parameter page_size is 100
  • next_page_token should be null for the first request, use the next_page_token returned from the previous response for subsequent requests
  • When next_page_token in the response is null, it indicates all comments have been retrieved

Code Example

import requests

BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
API_KEY = "sk-mavi-..."
HEADERS = {
    "Authorization": f"{API_KEY}",
    "Content-Type": "application/json"
}

def youtube_video_comment(video_id: str):
    url = f"{BASE_URL}/youtube/video/comment"
    page_size = 100
    next_page_token = None
    all_comments = []
    while True:
        data = {"video_id": video_id, "page_size": page_size, "next_page_token": next_page_token}
        resp = requests.post(url, json=data, headers=HEADERS).json()
        comments = resp.get("items", [])
        all_comments.extend(comments)
        next_page_token = resp.get("next_page_token")
        if not next_page_token:
            break
    return all_comments

# Usage example
comments = youtube_video_comment("your_youtube_video_id")
print(comments)

Request Body

FieldTypeRequiredDescription
video_idstringYesYouTube video ID (the v parameter from a YouTube URL, e.g., Y2y4OpzKIK4)
page_sizenumberNoNumber of comments returned per page, maximum value is 100, default is 100
next_page_tokenstring | nullNoNext page token, should be null for the first request, use the value returned from the previous response for subsequent requests

Response

Returns the standard envelope (code / msg / data) wrapping a data.data array of comments.
{
  "code": 200,
  "msg": "success",
  "data": {
    "data": [
      {
        "comment_id": "UgwNEbW4EeYHeo7wBOp4AaABAg",
        "video_id": "otECntwBTVU",
        "reply_count": "74",
        "comment": {
          "comment_id": "UgwNEbW4EeYHeo7wBOp4AaABAg",
          "parent_comment_id": null,
          "text": "SUPPORT THE RESTAURANTS! ...",
          "author_name": "@StevenSchapiro",
          "author_url": "http://www.youtube.com/@StevenSchapiro",
          "publish_time": "2026-01-10T14:31:50Z",
          "like_count": "3676"
        }
      }
    ]
  }
}

Response Parameters

ParameterTypeDescription
codeintegerResponse code (200 on success)
msgstringResponse message
dataobjectWrapper object
data.dataarray[object]Comment list
data.data[].comment_idstringComment ID (also repeated inside comment.comment_id)
data.data[].video_idstringEcho of the requested YouTube video ID
data.data[].reply_countstringReply count, returned as a string
data.data[].commentobjectThe comment payload
data.data[].comment.comment_idstringSame comment ID, repeated
data.data[].comment.parent_comment_idstring | nullAlways null for top-level comments (this endpoint only returns top-level)
data.data[].comment.textstringComment text
data.data[].comment.author_namestringAuthor handle (e.g. @StevenSchapiro) — flat, not nested under author
data.data[].comment.author_urlstringAuthor channel URL
data.data[].comment.publish_timestringPublished time, ISO 8601
data.data[].comment.like_countstringLike count, returned as a string
Pagination is asserted in the page Warning but the live response examined in this audit did not include a next_page_token or page_info block at any level. If your script depends on pagination, verify the field path against your own request before shipping — it may live on a different envelope or only appear when there are more pages than page_size.
| next_page_token | string | null | Next page token, used to get the next page of data, null indicates all data has been retrieved | | page_info | object | Pagination information | | page_info.total_results | number | Total number of comments | | page_info.results_per_page | number | Number of results per page |

Authorizations

Authorization
string
header
required

Body

application/json
video_id
string
required

YouTube video ID

Example:

"Y2y4OpzKIK4"

page_size
integer
default:100

Number of comments returned per page, maximum value is 100, default is 100

Required range: x <= 100
Example:

100

next_page_token
string | null

Next page token, should be null for the first request, use the value returned from the previous response for subsequent requests

Example:

null

Response

200 - application/json

Successfully returned comment list

items
object[]

Comment list array

next_page_token
string | null

Next page token, used to get the next page of data, null indicates all data has been retrieved

page_info
object

Pagination information