Comment scraping
Get the comments on any public post, with replies linked to their parent and pagination handled, in the same JSON on every platform.
The recipe
The calls, in order. Tap a platform to see its endpoint and parameters.
- 1
- 2
- 3
What it costs
16credits
One TikTok video with 5 pages of comments and replies on 10 comments.
Calculated from the live price list. Failed calls are refunded.
In code
javascript
let cursor;
const all = [];
do {
const page = await fetch(`https://api.crawlfeed.dev/v1/tiktok/comments?post_id=${postId}${cursor ? `&cursor=${cursor}` : ''}`, { headers: { Authorization: `Bearer ${process.env.CRAWLFEED_KEY}` } }).then((r) => r.json());
all.push(...page.data); // Comment[]: author, text, likes, reply_to_id
cursor = page.meta.next_cursor;
} while (cursor);Questions
How are replies represented?
Every Comment has reply_to_id. Top-level comments have null; replies carry the id of the comment they answer, so you can rebuild the thread.
Does each page cost credits?
Yes, each page is one call. Repeat reads within the cache window are fast, and failed calls are refunded.