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. 1

    Post

    1–2 credits per call

    Resolve the post and its engagement counts.

    GET/v1/{platform}/postPost
  2. 2

    Comments

    1–2 credits per call

    Page through its comments with meta.next_cursor.

    GET/v1/{platform}/commentsComment[]
  3. 3

    Replies

    1 credit per call

    Expand the replies under a comment where the platform supports it.

    GET/v1/{platform}/repliesComment[]
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.

Related recipes