Back to Blog
General

TikTok Comments Scraper API: Extract Comments & Sentiment Data

January 24, 2026
4 min read
S
By SociaVault Team
tiktokcomments scraperapisentiment analysis

TikTok Comments Scraper API: Extract & Analyze Video Comments

Need to analyze what people are saying on TikTok videos? This guide shows you how to scrape comments from any TikTok video for sentiment analysis, audience research, and engagement monitoring.

Why Scrape TikTok Comments?

Comments reveal valuable insights that metrics alone can't capture:

  • Sentiment Analysis - Understand audience reactions to content
  • Brand Monitoring - Track what people say about your brand
  • Product Feedback - Collect user opinions and feature requests
  • Influencer Vetting - Assess comment authenticity (spot fake engagement)
  • Trend Research - Discover emerging topics and concerns
  • Customer Support - Find and respond to questions

What Comment Data Can You Extract?

The API returns rich comment data:

FieldDescription
Comment IDUnique identifier
TextFull comment content
UsernameCommenter's handle
User IDCommenter's account ID
Like CountLikes on the comment
Reply CountNumber of replies
Create TimeWhen comment was posted
Is AuthorIf video creator commented
RepliesNested reply comments

How to Use the Comments API

Extract comments from any TikTok video:

const response = await fetch('https://api.sociavault.com/tiktok/comments', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    url: 'https://www.tiktok.com/@user/video/7234567890123456789',
    amount: 100
  })
});

const comments = await response.json();

Sample Response

{
  "comments": [
    {
      "id": "7234567890123456790",
      "text": "This is absolutely amazing! 🔥",
      "username": "fan_account",
      "userId": "6987654321",
      "likes": 1523,
      "replyCount": 12,
      "createTime": "2026-01-05T15:30:00Z",
      "isAuthor": false,
      "replies": [
        {
          "id": "7234567890123456791",
          "text": "Thank you! ❤️",
          "username": "mrbeast",
          "isAuthor": true
        }
      ]
    }
  ],
  "totalComments": 89000,
  "hasMore": true,
  "cursor": "next_page_cursor"
}

Practical Use Cases

Sentiment Analysis

Run comment text through sentiment analysis to gauge audience reception:

const positive = comments.filter(c => 
  c.text.match(/love|amazing|great|best|perfect/i)
).length;

const negative = comments.filter(c => 
  c.text.match(/hate|bad|worst|boring|waste/i)
).length;

const sentimentScore = (positive - negative) / comments.length;

Finding Top Commenters

Identify your most engaged audience members:

const commenterCounts = {};
comments.forEach(c => {
  commenterCounts[c.username] = (commenterCounts[c.username] || 0) + 1;
});

const topCommenters = Object.entries(commenterCounts)
  .sort((a, b) => b[1] - a[1])
  .slice(0, 10);

Detecting Bot/Fake Comments

Look for patterns that indicate inauthentic engagement:

const suspiciousPatterns = comments.filter(c => 
  c.text.length < 5 || // Very short
  c.text.match(/check my bio|dm me|link in bio/i) // Spam patterns
);

Extracting Questions

Find comments asking questions for FAQ content:

const questions = comments.filter(c => 
  c.text.includes('?') || 
  c.text.match(/^(how|what|where|when|why|who|can|do|does|is|are)/i)
);

Pagination for Videos with Many Comments

For viral videos with thousands of comments:

async function getAllComments(videoUrl) {
  let allComments = [];
  let cursor = null;
  
  do {
    const response = await fetch('https://api.sociavault.com/tiktok/comments', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        url: videoUrl,
        amount: 100,
        cursor: cursor
      })
    });
    
    const data = await response.json();
    allComments = [...allComments, ...data.comments];
    cursor = data.hasMore ? data.cursor : null;
    
  } while (cursor);
  
  return allComments;
}

Frequently Asked Questions

How many comments can I scrape per video?

You can scrape all available comments on a video. The API supports pagination to handle videos with millions of comments.

Can I get replies to comments?

Yes, the API returns nested replies for each comment. You can expand replies by setting the includeReplies parameter.

Does the API return deleted comments?

No, only currently visible comments are returned. Previously deleted comments are not accessible.

How do I identify spam or bot comments?

Look for patterns like very short comments, promotional content, or accounts with suspicious usernames. The likes count can also indicate authenticity—real comments typically have more engagement.

Can I scrape comments from live videos?

No, the comments API works with posted videos only. Live stream comments are ephemeral and not stored.

Is comment scraping against TikTok's terms?

SociaVault accesses publicly visible data similar to any TikTok user. Always use scraped data responsibly and in compliance with applicable laws.

Start Extracting TikTok Comments

Get your API key and start analyzing TikTok comments in minutes.

Full API documentation: /docs/api-reference/tiktok/comments

Found this helpful?

Share it with others who might benefit

Ready to Try SociaVault?

Start extracting social media data with our powerful API. No credit card required.