Developer

API Documentation

DouChong OpenAPI reference: extract video transcripts and image text via API with task create, query, usage, and concurrency endpoints.

Manage API Keys

Quick Start

  1. 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.
  2. Send the X-API-Key and X-API-Secret headers with every request.
  3. 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/v1

Authentication

Pass your API credentials via request headers; every endpoint requires authentication:

HeaderRequiredDescription
X-API-KeyYesThe apiKey returned when the API Key was created
X-API-SecretYesThe apiSecret returned when the API Key was created (visible only at creation)

Error Codes

codeMeaning
200Success
401Authentication failed: incorrect API Key or Secret, or the key has been disabled or deleted
601Insufficient entitlement: the API is an Ultra-plan exclusive benefit; upgrade to Ultra

Downloads

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

MethodEndpointDescription
POST/task/createCreate a single transcript task
POST/batch/task/createCreate transcript tasks in batch (up to 10 links)
GET/task/queryQuery transcript task status and results
POST/image/task/createCreate an image text extraction task
GET/image/task/queryQuery image task status and results
GET/quota/usageQuery transcript duration usage
GET/quota/concurrencyQuery concurrency usage
POST

/task/create

Create Transcript Task

Submit a post link to create a video transcript extraction task; returns a taskId for polling.

Request Parameters

ParameterTypeRequiredDescription
workUrlstringYesPublic post share link; supports Douyin, Xiaohongshu, Kuaishou, Bilibili, TikTok, and more
targetLanguagestringNoTarget 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"
  }
}
POST

/batch/task/create

Batch Create Transcript Tasks

Submit up to 10 post links at once; each link creates a transcript task.

Request Parameters

ParameterTypeRequiredDescription
workUrlsstring[]YesList 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"
      }
    ]
  }
}
GET

/task/query

Query Task Status & Result

Query 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

ParameterTypeRequiredDescription
taskIdstringYesTask 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.

POST

/image/task/create

Create Image Extraction Task

Submit 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

ParameterTypeRequiredDescription
typestringYesTask type: workUrl (post link) or imageUrl (image URLs)
workUrlstringRequired when type=workUrlXiaohongshu / Douyin gallery post share link (these two platforms only)
imageUrlsstring[]Required when type=imageUrlList 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"
  }
}
GET

/image/task/query

Query Image Task Status & Result

Query 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

ParameterTypeRequiredDescription
taskIdstringYesTask 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.

GET

/quota/usage

Query Transcript Duration Usage

Query 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.

GET

/quota/concurrency

Query Concurrency Usage

Query 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.