# TikTok / Comments

Fetch comments for a video. Provide exactly one of id or url.

```
GET /api/v1/tiktok/comments
```

Auth: `Authorization: Bearer <SOCIFY_KEY>`  
Credits: 1 credit per request

## Parameters

| Name | Required | Description | Example |
|------|----------|-------------|---------|
| `id` | no | Video id (not comment id). Exactly one of id or url. Prefer id. | `7165262254722534698` |
| `url` | no | Full TikTok video URL (alternative to id). | `https://www.tiktok.com/@daviddobrik/video/7165262254722534698` |
| `cursor` | no | Pagination cursor from a previous response. |  |

## Example

```bash
curl -s 'https://trysocify.com/api/v1/tiktok/comments?id=7165262254722534698' \
  -H "Authorization: Bearer $SOCIFY_KEY"
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `comments` | array | Comments for this page. |
| `comments[].id` | string | Comment id. |
| `comments[].text` | string | Comment text. |
| `comments[].likes` | number | Like count. |
| `comments[].created_at` | number | Unix timestamp, when available. |
| `comments[].author` | object | Author username and id. |
| `cursor` | string | Pass as cursor for the next page. |
## Sample response

Successful lookups wrap the payload in `{ ok, platform, resource, params, data, meta }`. `data` is shown below.

```json
{
  "ok": true,
  "platform": "tiktok",
  "resource": "comments",
  "params": {
    "id": "7165262254722534698"
  },
  "data": {
    "comments": [
      {
        "author": {
          "id": "6919985905534190598",
          "username": "viewer123"
        },
        "created_at": 1667844000,
        "id": "7123456789012345678",
        "likes": 1200,
        "text": "this is hilarious"
      }
    ],
    "cursor": "30"
  },
  "meta": {
    "credits_charged": 1,
    "latency_ms": 420,
    "platform": "tiktok",
    "resource": "comments",
    "path": "/api/v1/tiktok/comments"
  }
}
```

## Links

- HTML docs: https://trysocify.com/docs/api/tiktok/comments
- SEO page: https://trysocify.com/tiktok/comments
- OpenAPI: https://trysocify.com/openapi.json
- Catalog: https://trysocify.com/catalog.json
