SuperAPI AI Directory

douyin-works-crawler

General & other

View repository

Updated 10-16 08:41

About this skill

Douyin Account Content Collection · Account Profile (DouBaoYa)

This duck pulls for you by accountDouyin profile + recent content list——Give it an account (Chinese account name or Douyin ID both work), and you can see its fundamentals, what it recently posted, which one popped off the most, and conveniently break down its content strategy.

Data goes through doubaoya.com one line, authentication uses your own token (environment variable DOUBAOYA_API_KEY, in the form dyh_…)。


Applicable scenarios

Scenario How to use What you get
Account profile Pull target account profile + content A complete account profile
Break down viral hits Look at the like distribution of recent content Which content is the most viral, and why
Benchmark research Collect benchmark accounts in the same niche Transferable content strategy
Topic inspiration Scan through the other party's recent topics A batch of topic directions worth borrowing from

Workflow

1. Provide an account

Pass in areal, existingaccount——Chinese account nameorDouyin ID both work; the system will automatically identify it (Chinese name goes by account name, otherwise by account ID).Don't make up a name / Douyin ID out of thin air to "give it a try"——an account that can't be found will only return NO_DATA. When you don't have the exact account on hand, first ask the user for the real account name or Douyin ID.

2. Call the script

python3 "$SKILL_PATH/scripts/fetch_user_works.py" "某某账号"

Passing a Douyin ID also works:

python3 "$SKILL_PATH/scripts/fetch_user_works.py" "douyin12345"

The script outputs the data from the success envelope to stdout as JSON.Only run the script once each time, read the full stdout, don't use head/tail preview.

3. Present the account profile + content table

First from data.profile get the account fundamentals (nickname, followers, bio, etc., read defensively, leave blank if missing) and write a short profile; then from data.items get title (title)、likeCount (likes)、workUrl (content link) and other fields, and lay them out as a Markdown table:

Title Likes Content link
A certain piece of content xxxx https://...

Only present fields actually returned by the API (profile.* and items[].title/likeCount/workUrl). "Play rate / completion rate / some kind of index" that the API did not return must never be made up.

4. Give one sentence of content strategy insight

After the table, add one sentence in this duck's tone: what content format this account used to gain traction, which types of topics the viral hits cluster around, what patterns its pacing and hooks have, and which strategies can be transferred to your own account or other platforms. Short, useful, don't pile on clichés.


Get Key (Passcode)

  1. Open doubaoya.com
  2. Log in
  3. Go to Passcode Center
  4. Generate Passcode(in the form dyh_…)

Configure into environment variables (the script only recognizes this one):

export DOUBAOYA_API_KEY="dyh_你的口令"

Iron rule: the passcode is never printed, never written to a file, and never echoed to the user. The script itself also never outputs the passcode. All requests are sent only to doubaoya.com。


Interface and Envelope

  • POST https://doubaoya.com/api/apis/douyin/douyin-user-works/call
  • Auth header:Authorization: Bearer $DOUBAOYA_API_KEY
  • Request body:{ "account": "某某账号" }
    • account:Required, account name or account ID is acceptable; if a Chinese account name is passed, account name matching is used, otherwise matching is by Douyin account ID (automatically detected by the backend)
  • Return envelope:
    { "success": true, "requestId": "...", "data": { "profile": { ... }, "items": [ { "title": "...", "likeCount": 0, "workUrl": "..." } ] }, "error": null }
    
  • First check success: it is true only then read data; otherwise read error.code / error.message。

Error Handling

When the script fails, it prints to stderr [error] CODE: message and exits with exit code 1. Common cases:

HTTP code Meaning Handling
401 MISSING_API_KEY / UNAUTHORIZED No passcode provided or passcode invalid Check DOUBAOYA_API_KEY, go to the Passcode Center to regenerate
400 VALIDATION_ERROR Invalid parameter (e.g. account is empty) Complete the account name/Douyin ID and retry
— NO_DATA No matching account found Try a different form (Chinese name/Douyin ID) and retry
402 INSUFFICIENT_CREDITS Insufficient quota Go to doubaoya.com to top up/renew quota
502 PROVIDER_FAILED Temporary upstream failure (automatically refunded) safe to retry

502 PROVIDER_FAILED will automatically refund; retrying is safe and will not result in duplicate charges.


Directory Structure

douyin-works-crawler/
├── SKILL.md                  # 本文件
└── scripts/
    └── fetch_user_works.py   # 零依赖脚本(urllib),调用 doubaoya.com