# Video data sync

- API version: 1.11.0
- Last updated: 2026-11-16
- Server: `https://api.ailingtu.com`
- Web document: [Video data sync](/en/openapi/material-fetch)
- Full schema: [JSON Schema](/en/openapi/operations/fetchPublicVideoData.json)
- Discovery: [Operation index](/en/openapi/operations/index.json)

## POST /v1/material/fetch

Operation ID: `fetchPublicVideoData`

Fetch public video views and engagement metrics from TikTok, Instagram, Douyin, Xiaohongshu, WeChat Channels, and YouTube.

Authentication: Request header `x-api-key: <YOUR_API_KEY>`; keep the key on the server and never expose it in client code, logs or shared files.

Success criteria: HTTP 2xx with code=0; for asynchronous tasks, also query the final status.

### Request parameters

| Field | Location | Type | Required | Description |
|---|---|---|---|---|
| `videoUrl` | body | string(uri) | Yes | Public http/https URL of the content |

Request format: `application/json`

### Request example

```json
{
  "videoUrl": "https://www.tiktok.com/@creator/video/7123456789012345678"
}
```

### Success response

```json
{
  "code": 0,
  "data": {
    "videoId": "7624922739500993822",
    "uniqueId": "creator",
    "playCount": 2109422,
    "diggCount": 143027,
    "commentCount": 1320,
    "shareCount": 36150,
    "collectCount": 17710,
    "coverUrl": "https://cdn.example.com/cover.jpg",
    "videoDesc": "caption #tag",
    "releaseAt": 1775315687
  },
  "message": "success"
}
```

### Response fields

Main levels are listed below. The endpoint JSON Schema is authoritative for the full structure, unions and validation rules; Required refers to the containing object.

| Field | Type | Required | Description |
|---|---|---|---|
| `code` | integer | Yes | Fixed value: 0 |
| `message` | string | No | — |
| `data` | object | Yes | Normalized fields plus platform-specific public content fields. |
| `data.videoId` | string | No | — |
| `data.uniqueId` | string | No | — |
| `data.playCount` | integer | No | — |
| `data.diggCount` | integer | No | — |
| `data.commentCount` | integer | No | — |
| `data.shareCount` | integer | No | — |
| `data.collectCount` | integer | No | — |
| `data.coverUrl` | string | No | — |
| `data.videoDesc` | string | No | — |
| `data.releaseAt` | integer | No | — |

### Error handling

| HTTP | Description |
|---|---|
| 400 | The request parameters or body are invalid. Fix them and retry. |
| 401 | The API key is missing or invalid. Check x-api-key. |
| 403 | The API key has no permission to call this endpoint. |
| 404 | The public post does not exist or has been deleted. |
| 429 | Too many requests. Retry with exponential backoff. |
| 500 | The server failed. Retry transient failures with exponential backoff. |

Treat any non-zero business code as a failure. Do not blindly retry parameter, permission or authorization errors. If creating a publishing or generation task times out, query the existing task first instead of creating another one.
