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
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment"
payload = {
"video_id": "Y2y4OpzKIK4",
"page_size": 100,
"next_page_token": None
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({video_id: 'Y2y4OpzKIK4', page_size: 100, next_page_token: null})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'video_id' => 'Y2y4OpzKIK4',
'page_size' => 100,
'next_page_token' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment"
payload := strings.NewReader("{\n \"video_id\": \"Y2y4OpzKIK4\",\n \"page_size\": 100,\n \"next_page_token\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"video_id\": \"Y2y4OpzKIK4\",\n \"page_size\": 100,\n \"next_page_token\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"video_id\": \"Y2y4OpzKIK4\",\n \"page_size\": 100,\n \"next_page_token\": null\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}
]
}
}
YouTube
YouTube Video Comment
Get the comment list for YouTube videos.
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
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment"
payload = {
"video_id": "Y2y4OpzKIK4",
"page_size": 100,
"next_page_token": None
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({video_id: 'Y2y4OpzKIK4', page_size: 100, next_page_token: null})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'video_id' => 'Y2y4OpzKIK4',
'page_size' => 100,
'next_page_token' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment"
payload := strings.NewReader("{\n \"video_id\": \"Y2y4OpzKIK4\",\n \"page_size\": 100,\n \"next_page_token\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"video_id\": \"Y2y4OpzKIK4\",\n \"page_size\": 100,\n \"next_page_token\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"video_id\": \"Y2y4OpzKIK4\",\n \"page_size\": 100,\n \"next_page_token\": null\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}
]
}
}
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)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 achannel option, use it to control how scraper data is sourced:
| Channel | What it means | Typical trade-off |
|---|---|---|
apify | Uses Apify, a dedicated web scraping platform with broad content coverage. | Most stable and most complete results, but usually more expensive. |
rapid | Uses RapidAPI, a lower-cost aggregation platform. | Lower cost, but less stable and often narrower coverage. |
memories.ai | Managed 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_sizeis 100 next_page_tokenshould be null for the first request, use thenext_page_tokenreturned from the previous response for subsequent requests- When
next_page_tokenin the response isnull, 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)
const axios = require('axios');
const BASE_URL = 'https://mavi-backend.memories.ai/serve/api/v2';
const API_KEY = 'sk-mavi-...';
const headers = {
'Authorization': API_KEY,
'Content-Type': 'application/json'
};
async function youtubeVideoComment(videoId) {
const response = await axios.post(
`${BASE_URL}/youtube/video/comment`,
{ video_id: videoId, page_size: 100, next_page_token: null },
{ headers }
);
return response.data;
}
// Usage example
youtubeVideoComment('your_youtube_video_id')
.then(result => console.log(result));
curl -X POST "https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment" \
-H "Authorization: sk-mavi-..." \
-H "Content-Type: application/json" \
-d '{
"video_id": "your_youtube_video_id",
"page_size": 100,
"next_page_token": null
}'
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| video_id | string | Yes | YouTube video ID (the v parameter from a YouTube URL, e.g., Y2y4OpzKIK4) |
| page_size | number | No | Number of comments returned per page, maximum value is 100, default is 100 |
| next_page_token | string | null | No | Next 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
| Parameter | Type | Description |
|---|---|---|
| code | integer | Response code (200 on success) |
| msg | string | Response message |
| data | object | Wrapper object |
| data.data | array[object] | Comment list |
| data.data[].comment_id | string | Comment ID (also repeated inside comment.comment_id) |
| data.data[].video_id | string | Echo of the requested YouTube video ID |
| data.data[].reply_count | string | Reply count, returned as a string |
| data.data[].comment | object | The comment payload |
| data.data[].comment.comment_id | string | Same comment ID, repeated |
| data.data[].comment.parent_comment_id | string | null | Always null for top-level comments (this endpoint only returns top-level) |
| data.data[].comment.text | string | Comment text |
| data.data[].comment.author_name | string | Author handle (e.g. @StevenSchapiro) — flat, not nested under author |
| data.data[].comment.author_url | string | Author channel URL |
| data.data[].comment.publish_time | string | Published time, ISO 8601 |
| data.data[].comment.like_count | string | Like 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.Authorizations
Body
application/json
YouTube video ID
Example:
"Y2y4OpzKIK4"
Number of comments returned per page, maximum value is 100, default is 100
Required range:
x <= 100Example:
100
Next page token, should be null for the first request, use the value returned from the previous response for subsequent requests
Example:
null
