YouTube data

YouTube Comments Scraper (no author data)

Comments from YouTube videos for sentiment, FAQ mining and research: text, likes, reply count, publication time, pinned and owner flags, top or newest first, up to 200 videos per run. Deliberately without commenter names, handles or channel ids. Pay only for delivered comments.

$0.35per 1,000 · Comment listed

One comment (or reply) delivered to the dataset. Videos that fail or have no comments are never charged.

Call it from your code

curl
ACTOR=steadydata~youtube-comments
URL="https://api.apify.com/v2/acts/$ACTOR/run-sync-get-dataset-items"

curl -X POST "$URL?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"], "maxCommentsPerVideo": 100, "sort": "top"}'
python
import os, requests

ACTOR = "steadydata~youtube-comments"
URL = f"https://api.apify.com/v2/acts/{ACTOR}/run-sync-get-dataset-items"

rows = requests.post(
    URL,
    params={"token": os.environ["APIFY_TOKEN"]},
    json={'videos': ['https://www.youtube.com/watch?v=dQw4w9WgXcQ'], 'maxCommentsPerVideo': 100, 'sort': 'top'},
    timeout=900,
).json()

# every row carries a status; failures are records, not exceptions
ok = [r for r in rows if r.get("status") == "ok"]
print(len(ok), "rows delivered")
javascript
const ACTOR = "steadydata~youtube-comments";
const url =
  `https://api.apify.com/v2/acts/${ACTOR}/run-sync-get-dataset-items` +
  `?token=${process.env.APIFY_TOKEN}`;

const rows = await fetch(url, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"], "maxCommentsPerVideo": 100, "sort": "top"}),
}).then((r) => r.json());

// one object per delivered row, same shape every time
console.log(rows.filter((r) => r.status === "ok").length, "rows");

Use it in an agent

Point an MCP client at Apify's hosted server with this dataset in the tools list, or run our own server locally. The field explanations in the table below travel with the schema, so your agent reads them straight from the platform instead of from this page.

mcp url
https://mcp.apify.com?tools=steadydata/youtube-comments

# the tool arrives in your agent as steadydata--youtube-comments

Input

FieldTypeNameWhat it does
videos
required
array of stringVideosVideo URLs or 11-character video ids, one per row. Each video is one input; a video without comments comes back as a free error record.
maxCommentsPerVideointegerMax comments per videoCost ceiling: at most this many top-level comments per video, in YouTube's order. One delivered comment is one charged event.
sortstringOrderTop comments (YouTube's ranking) or newest first.
includeRepliesbooleanInclude repliesAlso fetch the replies under each comment (each reply is a charged comment too, with `parentCommentId` set). Off by default: top-level comments only.
maxRepliesPerCommentintegerMax replies per commentOnly used when replies are on.
languagestringLanguageInterface language for relative dates such as '2 weeks ago' (hl).

What you get back

output schema, one object per delivered row
{
  "videoId": string | null,
  "commentId": string | null,
  "parentCommentId": string | null,
  "rank": integer | null,
  "text": string | null,
  "likeCount": integer | null,
  "replyCount": integer | null,
  "publishedText": string | null,
  "isOwner": boolean | null,
  "isPinned": boolean | null,
  "hasCreatorHeart": boolean | null,
  "isReply": boolean | null,
  "commentUrl": string | null,
  "status": string | null,
  "input": string | null,
  "errorCode": string | null,
  "error": string | null
}
FieldTypeWhen it is filled
videoIdstring, null
commentIdstring, null
parentCommentIdstring, null
rankinteger, null
textstring, null
likeCountinteger, null
replyCountinteger, null
publishedTextstring, null
isOwnerboolean, null
isPinnedboolean, null
hasCreatorHeartboolean, null
isReplyboolean, null
commentUrlstring, null
statusstring, nullEither 'ok' or 'error'. An error row carries errorCode and error, and leaves the data fields empty; it is never charged.
inputstring, nullThe input this row was built from, so a row can always be traced back.
errorCodestring, nullFilled on an error row only; a delivered row leaves it empty.
errorstring, nullFilled on an error row only; a delivered row leaves it empty.

Related datasets

Already using this one? Ratings are the first thing other buyers look at, and this dataset has none yet. If it does a job for you, a rating on its Apify page is the one thing that helps. It takes a minute and it is the only thing we ask for.

Open the Apify page