# TikTok Comments

Extract top-level comments from TikTok videos — comment text, likes, reply counts, commenter handle and profile, timestamps, and mentions — from video URLs or by profile.

**Pricing:** $0.5 / 1k comments

**Endpoint:** `POST /api/v1/agents/tiktok/comments/run`

**Auth:** `Authorization: Bearer mk_live_...`

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `postURLs` | array | No | TikTok video URLs to get comments from. One per line. E.g. https://www.tiktok.com/@username/video/1234567890. |
| `profiles` | array | No | TikTok usernames whose videos' comments you want (with or without @). One per line. The actor pulls comments from each profile's videos — use Videos Per Profile to control how many. |
| `commentsPerPost` | integer | No | Maximum comments extracted per video. Actual counts can vary on very high-comment videos due to TikTok API limits. |
| `topLevelCommentsPerPost` | integer | No | Optional cap on top-level (non-reply) comments per video. |
| `resultsPerPage` | integer | No | By Profile mode only. Number of videos to pull comments from per profile. |
| `profileScrapeSections` | array | No | By Profile mode only. Which sections to pull videos from. |
| `profileSorting` | string | No | By Profile mode only. Order videos by latest, most popular, or oldest. |
| `excludePinnedPosts` | boolean | No | By Profile mode only. Skip pinned videos at the top of a profile. |

## Example

```bash
curl -X POST https://api.mindcase.co/api/v1/agents/tiktok/comments/run \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"params":{}}'
```

```python
import requests

resp = requests.post(
    "https://api.mindcase.co/api/v1/agents/tiktok/comments/run",
    headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
    json={"params": {}},
)
data = resp.json()
```

## Get the results

`run` is async and returns a `job_id`. Poll until `status` is `completed`, then read the rows:

```bash
# 1) check status
curl https://api.mindcase.co/api/v1/jobs/JOB_ID \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"

# 2) when status == completed, fetch the rows
curl https://api.mindcase.co/api/v1/jobs/JOB_ID/results \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"
```

Full API reference (auth, jobs, balance, endpoints): https://mindcase.co/skills.md

## Response columns

| Field | Display name | Type |
|-------|--------------|------|
| `commentId` | Comment ID | text |
| `commenterUrl` | Commenter URL | url |
| `comment` | Comment | text |
| `likes` | Likes | number |
| `replies` | Replies | number |
| `postedDate` | Posted Date | date |
| `mentions` | Mentions | array |
| `postUrl` | Post URL | url |
