Douyin Link recognition API

Pass a piece of text (a whole share text, for example) as text and find the Douyin video, user, music, collection and live room links and IDs inside it; each one found is one row, for $0.79 per 1,000 calls.

  • resource_type says which kind it is, and resource_id can go straight to the matching endpoint.
  • needs_expansion is true for a short link that has not been expanded yet.
  • Failed calls and empty results are not charged.

API health

24h health
Normal
  • Healthy / normal
  • Available
  • Limited
  • Mostly down
Normal

Last 24 hours

Last 30 days

  1. 1Request

    POST /api/v1/social
    {
      "platform": "douyin",
      "action": "resolve_links",
      "params": {
        "text": "https://www.douyin.com/video/7539330955225484584"
      }
    }
  2. 2JSON response

    {
      "results": [
        {
          "matched_text": …,
          "match_type": …,
          "resource_type": …,
          "resource_id": …
        },
        …
      ]
    }
  3. 3Rows

    matched_textmatch_typeresource_typeresource_id
    …………
  4. 4CSV

    douyin-resolve_links-sample.csv matched_text,match_type,resource_type,resource_id,handle,url,needs_expansion,id_created_at,platform

A request with text goes in, and every link or ID found comes back; each row in results is one, listed as a field table and a CSV file.

What data you get

This endpoint has no public real sample yet. The table lists the fields, types and meanings that each row returns, with no values.

FieldTypeMeaning
matched_text—The exact piece of the text that matched (resolve_links).
match_type—How the match appears in the text (resolve_links): link for a link, id for a bare ID, and so on.
resource_type—What the match is (resolve_links): video, user, music, mix for a collection, live for a live room, and others.
resource_id—ID of the matched item (resolve_links): a video ID, secUid, music ID and so on, ready to pass to the matching action.
handle—The Douyin ID or name when the match is a user (resolve_links); absent otherwise.
urlstringLink to the record on the platform.
needs_expansion—Whether the match is a short link that must be expanded before you know what it points to (resolve_links); when true, resource_id may be empty.
id_created_at—Creation time read from the ID itself (resolve_links, ISO 8601, UTC): a Douyin video ID carries its publish time.
platformstringSource platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).

Use cases

  • Get the video ID from a share text

    Pass the whole share text as text and read the row whose resource_type is video; its resource_id is the video ID.

  • Find the author, then read the profile

    When the text contains a user profile link, the row whose resource_type is user gives the secUid, which you can pass to profiles_batch or profile.

  • Sort a pile of links by kind

    Use resource_type (video, user, music, collection, live room and so on) to send each recognized item to the matching endpoint.

  • Work out when a video was posted

    Read id_created_at, the creation time worked out from the video ID itself.

Limits and gotchas

  • text is required and is a piece of text, for example a whole share text.
  • Each item found is one row; match_type says whether it was found as a link (link) or a plain ID (id) and so on.
  • needs_expansion is true for a short link that still has to be expanded before you know what it points to; then resource_id may be empty.
  • handle exists only when the item found is a user, and it is the Douyin ID or the name.
  • id_created_at is the creation time worked out from the ID itself; a Douyin video ID carries its posting time.

Pricing

Each call costs $0.000792 and is billed per call, not per row found; one call handles one piece of text. Failed calls and empty results are not charged.

CallsCost
10,000$7.92
100,000$79.17
1,000,000$791.67

Totals use the list price per call.

Code samples

#
bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "douyin",
  "action": "resolve_links",
  "params": {
    "text": "https://www.douyin.com/video/7539330955225484584"
  }
}'

OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.

API reference

See the parameters, response fields, errors and billing for resolve_links, and copy the page or open it as Markdown for an AI assistant.

POST

AI prompt

#
Please help me write a data collection script with the EveryInfra Douyin Link recognition endpoint (douyin/resolve_links).

How the endpoint works:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to douyin and action to resolve_links, and put the parameters inside params.
- Required parameters:
  - text: A piece of text, such as a whole share text, in which resolve_links looks for Douyin video, user, music, collection and live-room links and IDs.
- Optional parameters:
  - limit: The most rows to return in this call, an integer of 1 or more. The default applies when you leave it out, and a call can return fewer rows.
- Returns a list of records. Main fields of each record: matched_text (The exact piece of the text that matche…), match_type (How the match appears in the text (reso…), resource_type (What the match is (resolve_links): vide…), resource_id (ID of the matched item (resolve_links):…), handle (The Douyin ID or name when the match is…), url, needs_expansion (Whether the match is a short link that…), id_created_at (Creation time read from the ID itself (…).
- Example request body:
{
  "platform": "douyin",
  "action": "resolve_links",
  "params": {
    "text": "https://www.douyin.com/video/7539330955225484584"
  }
}
- Price: $0.79 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.

Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.

Request parameters

#
NameInTypeRequiredDefaultDescription
AuthorizationheaderstringYes-Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository.
platformbodystringYesdouyinPlatform identifier, fixed value.
actionbodystringYesresolve_linksCapability identifier, fixed value.
textbody.paramsstringYes-A piece of text, such as a whole share text, in which resolve_links looks for Douyin video, user, music, collection and live-room links and IDs.
limitbody.paramsinteger (1–)No-The most rows to return in this call, an integer of 1 or more. The default applies when you leave it out, and a call can return fewer rows.

Response example

#
No sample response is available for these parameters yet. This preview shows the response shape and fields from the API definition, with … as placeholders; it is not the result of a live call.
json
{  "id": "req_…",  "platform": "douyin",  "action": "resolve_links",  "results": [    {      "matched_text": …,      "match_type": …,      "resource_type": …,      "resource_id": …,      "handle": …,      "url": …,      "needs_expansion": …,      "id_created_at": …,      "platform": …    }  ],  "count": …,  "billing": {    "charged": …,    "charged_usd": …,    "balance_after_usd": …,    …  },  "quota": { … }}

Response fields

#

Business data is in results. The table lists the fields a record can contain; values the platform does not show are never made up.

FieldMeaning
matched_textThe exact piece of the text that matched (resolve_links).
match_typeHow the match appears in the text (resolve_links): link for a link, id for a bare ID, and so on.
resource_typeWhat the match is (resolve_links): video, user, music, mix for a collection, live for a live room, and others.
resource_idID of the matched item (resolve_links): a video ID, secUid, music ID and so on, ready to pass to the matching action.
handleThe Douyin ID or name when the match is a user (resolve_links); absent otherwise.
urlLink to the record on the platform.
needs_expansionWhether the match is a short link that must be expanded before you know what it points to (resolve_links); when true, resource_id may be empty.
id_created_atCreation time read from the ID itself (resolve_links, ISO 8601, UTC): a Douyin video ID carries its publish time.
platformSource platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).

Errors and billing

#
401
Missing or invalid key.
402
Insufficient balance. Top up first.
422
Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
429
Per-minute request limit reached. Wait for Retry-After, then try again.
503
Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
200 empty
No data. No charge.

Errors

FAQ

What does the link recognition API return?

One row for each link or ID found in the text: matched_text, match_type, resource_type, resource_id, handle, url, needs_expansion and id_created_at.

What does needs_expansion true mean?

The item found is a short link that still has to be expanded before you know what it points to; then resource_id may be empty.

What if the text contains several links?

Each item found is one row; tell them apart with resource_type and resource_id.

How much does it cost to recognize one text?

It costs $0.000792 per call, or $0.79 per 1,000 calls, billed per call and not per row found. Failed calls and empty results are not charged.

You can call the other Douyin endpoints with the same EveryInfra API key.

Google Analytics needs consent. Privacy