# YouTube Comments

Extract YouTube comments — text, likes, reply threads, and creator engagement — from video URLs, specifying max comments and sort order

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

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

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

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `urls` | array | Yes | YouTube video URLs to scrape comments from. One per line. |
| `maxComments` | integer | No | Max comments per video. Use 0 for all. |
| `sortBy` | string | No | Sort order for comments. |

## Example

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

```python
import requests

resp = requests.post(
    "https://api.mindcase.co/api/v1/agents/youtube/comments/run",
    headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
    json={"params": {
    "urls": [
        "..."
    ]
}},
)
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 |
|-------|--------------|------|
| `commentText` | Comment Text | text |
| `author` | Author | text |
| `authorChannelUrl` | Author Channel URL | url |
| `isReply` | Is Reply | boolean |
| `parentCommentId` | Parent Comment ID | text |
| `commentId` | Comment ID | text |
| `commentUrl` | Comment URL | url |
| `likes` | Likes | number |
| `replyCount` | Reply Count | number |
| `edited` | Edited | boolean |
| `postedRelative` | Posted (Relative) | text |
| `channelOwner` | Channel Owner | boolean |
| `heartedByCreator` | Hearted by Creator | boolean |
| `videoUrl` | Video URL | url |
