Developer
API Documentation
DouChong OpenAPI reference: extract video transcripts and image text via API with task create, query, usage, and concurrency endpoints.
Quick Start
- After subscribing to the Ultra plan, go to API Key Management to create an API Key;the API Secret is shown only once at creation — save it immediately.
- Send the
X-API-KeyandX-API-Secretheaders with every request. - Call Create Transcript Task or Create Image Extraction Task to submit a link, then poll the matching Query Task endpoint with the returned taskId to fetch the result.
Base URL
https://www.dousnap.com/prod-api/douchong-api/v1Authentication
Pass your API credentials via request headers; every endpoint requires authentication:
| Header | Required | Description |
|---|---|---|
| X-API-Key | Yes | The apiKey returned when the API Key was created |
| X-API-Secret | Yes | The apiSecret returned when the API Key was created (visible only at creation) |
Error Codes
| code | Meaning |
|---|---|
| 200 | Success |
| 401 | Authentication failed: incorrect API Key or Secret, or the key has been disabled or deleted |
| 601 | Insufficient entitlement: the API is an Ultra-plan exclusive benefit; upgrade to Ultra |
Downloads
Python Example
Video + image text extraction, ready to run
Markdown API Doc
Kept in sync with this page; readable offline
The Python example walks through the full create → poll → print flow; the Markdown doc includes the parameter reference and request/response examples for every endpoint.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /task/create | Create a single transcript task |
| POST | /batch/task/create | Create transcript tasks in batch (up to 10 links) |
| GET | /task/query | Query transcript task status and results |
| POST | /image/task/create | Create an image text extraction task |
| GET | /image/task/query | Query image task status and results |
| GET | /quota/usage | Query transcript duration usage |
| GET | /quota/concurrency | Query concurrency usage |
/task/create
Create Transcript TaskSubmit a post link to create a video transcript extraction task; returns a taskId for polling.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| workUrl | string | Yes | Public post share link; supports Douyin, Xiaohongshu, Kuaishou, Bilibili, TikTok, and more |
| targetLanguage | string | No | Target language; defaults to auto (no translation, keeps the original language) — see the note below for accepted values |
Accepted targetLanguage values: auto (default — no translation, keep the original language), zh Chinese, zh-TW Traditional Chinese, en English, ja Japanese, ko Korean, fr French, de German, es Spanish, pt Portuguese, ru Russian. Values outside this list are not guaranteed to translate correctly.
Request Example
curl -X POST 'https://www.dousnap.com/prod-api/douchong-api/v1/task/create' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: your-api-key' \
-H 'X-API-Secret: your-api-secret' \
-d '{"workUrl": "https://v.douyin.com/xxxxxxxx/", "targetLanguage": "zh"}'Response Example
{
"code": 200,
"msg": "Task submitted",
"data": {
"taskId": "1758518400123456789",
"status": "WAITING",
"message": "Task submitted, processing"
}
}/batch/task/create
Batch Create Transcript TasksSubmit up to 10 post links at once; each link creates a transcript task.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| workUrls | string[] | Yes | List of post share links, up to 10 per request |
Request Example
curl -X POST 'https://www.dousnap.com/prod-api/douchong-api/v1/batch/task/create' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: your-api-key' \
-H 'X-API-Secret: your-api-secret' \
-d '{"workUrls": ["https://v.douyin.com/xxxxxxxx/", "https://www.xiaohongshu.com/explore/yyyyyyyy"]}'Response Example
{
"code": 200,
"msg": "Batch submission finished",
"data": {
"total": 2,
"success": 1,
"failed": 1,
"results": [
{
"workUrl": "https://v.douyin.com/xxxxxxxx/",
"success": true,
"data": {
"taskId": "1758518400123456789",
"status": "WAITING"
}
},
{
"workUrl": "https://www.xiaohongshu.com/explore/yyyyyyyy",
"success": false,
"error": "Link is too long, please check and retry"
}
]
}
}/task/query
Query Task Status & ResultQuery task progress by taskId; once the task completes, the full transcript and post details are returned. Poll every few seconds while the task is processing.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| taskId | string | Yes | Task ID returned when the task was created |
Request Example
curl 'https://www.dousnap.com/prod-api/douchong-api/v1/task/query?taskId=1758518400123456789' \
-H 'X-API-Key: your-api-key' \
-H 'X-API-Secret: your-api-secret'Response Example (task succeeded)
{
"code": 200,
"msg": "Success",
"data": {
"taskId": "1758518400123456789",
"status": "SUCCESS",
"title": "Sample post title",
"content": "Post body (the author’s caption; may be empty for some posts)",
"platform": "DOUYIN",
"duration": 125,
"textContent": "Video transcript (translated)...",
"sourceText": "Video transcript (original)...",
"videoUrl": "https://example.com/video.mp4",
"workUrl": "https://v.douyin.com/xxxxxxxx/",
"cover": "https://example.com/cover.jpg"
}
}duration is in seconds; textContent is the translated transcript and sourceText the original; content is the post body (the author’s caption, which may be empty); videoUrl / cover are the watermark-free video and cover URLs and may be time-limited. Task status is text: WAITING / SUCCESS / FAILURE.
/image/task/create
Create Image Extraction TaskSubmit a Xiaohongshu / Douyin gallery post link, or a list of image URLs directly, to create an image text extraction task; returns a taskId for polling.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | Task type: workUrl (post link) or imageUrl (image URLs) |
| workUrl | string | Required when type=workUrl | Xiaohongshu / Douyin gallery post share link (these two platforms only) |
| imageUrls | string[] | Required when type=imageUrl | List of image URLs; the recognition quota is deducted per image submitted |
Request Example (direct image URLs)
curl -X POST 'https://www.dousnap.com/prod-api/douchong-api/v1/image/task/create' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: your-api-key' \
-H 'X-API-Secret: your-api-secret' \
-d '{"type": "imageUrl", "imageUrls": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"]}'To submit a gallery post link instead, use:{"type": "workUrl", "workUrl": "https://www.xiaohongshu.com/explore/yyyyyyyy"} (Xiaohongshu and Douyin gallery posts only).
Response Example
{
"code": 200,
"msg": "Task submitted",
"data": {
"taskId": "1758518400987654321",
"status": "WAITING",
"message": "Task submitted, processing"
}
}/image/task/query
Query Image Task Status & ResultQuery image extraction progress by taskId; once the task completes, the recognized text of each image is returned. Poll every few seconds while processing.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| taskId | string | Yes | Task ID returned when the image task was created |
Request Example
curl 'https://www.dousnap.com/prod-api/douchong-api/v1/image/task/query?taskId=1758518400987654321' \
-H 'X-API-Key: your-api-key' \
-H 'X-API-Secret: your-api-secret'Response Example (task completed)
{
"code": 200,
"msg": "Success",
"data": {
"type": "imageUrl",
"status": 2,
"taskId": "1758518400987654321",
"content": null,
"dataList": [
{
"id": 1,
"status": 2,
"content": "Recognized text of image 1...",
"imageUrl": "https://example.com/image1.jpg"
},
{
"id": 2,
"status": 2,
"content": "Recognized text of image 2...",
"imageUrl": "https://example.com/image2.jpg"
}
]
}
}Note: unlike the text statuses WAITING / SUCCESS / FAILURE used by video tasks, image task statuses are numeric — task-level status: 1=processing, 2=completed; per-image status inside dataList: 0=failed or timed out (content holds the failure reason), 1=processing, 2=recognized. content is the post body, returned only when type=workUrl (gallery post link) and empty when type=imageUrl; read the per-image recognized text from dataList.
/quota/usage
Query Transcript Duration UsageQuery the transcript duration quota and usage of the current account; shares the same duration pool as the in-app Video Transcript Extraction feature.
Request Example
curl 'https://www.dousnap.com/prod-api/douchong-api/v1/quota/usage' \
-H 'X-API-Key: your-api-key' \
-H 'X-API-Secret: your-api-secret'Response Example
{
"code": 200,
"msg": "Success",
"data": {
"unlimited": false,
"totalSeconds": 360000,
"usedSeconds": 4200,
"availableSeconds": 355800,
"availableMinutes": "5930.0"
}
}unlimited=true means the duration is unlimited, in which case the seconds fields may be empty. The image text extraction quota is shared with the in-app Image Text Extraction feature and can be viewed under My Benefits.
/quota/concurrency
Query Concurrency UsageQuery current concurrent task usage; the concurrency quota is shared with in-app tasks. When canAddTask is false, wait for running tasks to finish first.
Request Example
curl 'https://www.dousnap.com/prod-api/douchong-api/v1/quota/concurrency' \
-H 'X-API-Key: your-api-key' \
-H 'X-API-Secret: your-api-secret'Response Example
{
"code": 200,
"msg": "Success",
"data": {
"currentConcurrency": 3,
"maxConcurrency": 20,
"availableConcurrency": 17,
"canAddTask": true
}
}Quota & Limits
- The Open API is anUltra-plan exclusive benefit; other plans will get a 601 response and can upgrade in-app.
- API scope: only Video Transcript Extraction and Image Text Extraction are currently available via API; other in-app features are not exposed to the API yet.
- API transcript duration shares the same quota pool as the in-app Video Transcript Extraction feature; API calls are also deducted by video duration.
- Image text extraction deducts the recognition quota by the number of images submitted, shared with the in-app feature; image task concurrency shares the in-app image recognition concurrency quota.
- API task concurrency is shared with in-app tasks (20 for the Ultra plan); when concurrency is full, wait for running tasks to finish first.
- Each account can create up to 10 API Keys; calls using a deleted key fail immediately.
- workUrl must be a public post share link from a supported platform (Douyin, Xiaohongshu, Kuaishou, Bilibili, TikTok, etc.), following the same rules as in-app extraction; image tasks support Xiaohongshu and Douyin gallery posts only.
- Keep your API Secret safe and never expose it in plain text in front-end pages, public repositories, or similar places.