# YouTube Comments API

Extract YouTube comments — text, likes, replies, author details, and publish date — from any video URL

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

**Endpoint:** `POST /v1/data/youtube/comments/run`

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

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `videoUrl` | string | Yes | YouTube video URL to scrape comments from. E.g. https://www.youtube.com/watch?v=dQw4w9WgXcQ |
| `maxResults` | integer | No | Total number of comments to return. Use 0 for all. |

## Example

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

```python
import requests

resp = requests.post(
    "https://api.mindcase.co/v1/data/youtube/comments/run",
    headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
    json={"params": {
    "videoUrl": "..."
}},
)
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/v1/jobs/JOB_ID \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"

# 2) when status == completed, fetch the rows
curl https://api.mindcase.co/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 |
|-------|--------------|------|
| `comment` | Comment | text |
| `likes` | Likes | number |
| `replies` | Replies | number |
| `author` | Author | text |
| `authorChannelId` | Author Channel ID | text |
| `authorVerified` | Author Verified | boolean |
| `authorIsArtist` | Author Is Artist | boolean |
| `authorIsOwner` | Author Is Owner | boolean |
| `authorThumbnail` | Author Thumbnail | url |
| `published` | Published | text |
| `commentId` | Comment ID | text |
| `videoUrl` | Video URL | url |
| `commentUrl` | Comment URL | url |
