# TikTok / Videos

Fetch recent public videos for a username.

```
GET /api/v1/tiktok/videos
```

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

## Parameters

| Name | Required | Description | Example |
|------|----------|-------------|---------|
| `username` | yes | TikTok username without @. | `lilyachty` |
| `cursor` | no | Pagination cursor from a previous response. |  |

## Example

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

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `videos` | array | Videos for this page. |
| `videos[].id` | string | Video id. |
| `videos[].url` | string | Video URL. |
| `videos[].caption` | string | Caption. |
| `videos[].created_at` | number | Unix publish timestamp. |
| `videos[].plays` | number | Play count. |
| `videos[].likes` | number | Like count. |
| `videos[].comments` | number | Comment count. |
| `videos[].shares` | number | Share count. |
| `videos[].duration` | number | Duration in seconds. |
| `videos[].cover` | string | Cover image URL. |
| `videos[].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": "videos",
  "params": {
    "username": "lilyachty"
  },
  "data": {
    "cursor": "1699553318000",
    "videos": [
      {
        "author": {
          "id": "7119601",
          "username": "lilyachty"
        },
        "caption": "behind the scenes",
        "comments": 4200,
        "cover": "https://p16-sign-va.tiktokcdn.com/example.jpeg",
        "created_at": 1667843879,
        "duration": 42,
        "id": "7165262254722534698",
        "likes": 890000,
        "plays": 12450000,
        "shares": 31000,
        "url": "https://www.tiktok.com/@lilyachty/video/7165262254722534698"
      }
    ]
  },
  "meta": {
    "credits_charged": 1,
    "latency_ms": 420,
    "platform": "tiktok",
    "resource": "videos",
    "path": "/api/v1/tiktok/videos"
  }
}
```

## Links

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