# Douyin Link recognition API (douyin.resolve_links)

- Canonical page: [https://everyinfra.com/en/douyin-api/resolve_links](https://everyinfra.com/en/douyin-api/resolve_links?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "douyin", "action": "resolve_links", "params": {...}}
- Price: $0.000792 per call ($0.79 per 1,000 requests); failed calls and empty results are not charged
- Returns: list
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=douyin&action=resolve_links

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| text | not declared | yes | not declared | 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. |
| limit | integer (1–) | no | not declared | 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 fields (items in `results`)

| field | meaning |
|---|---|
| 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. |
| url | Link 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. |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```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"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "douyin",
        "action": "resolve_links",
        "params": {
            "text": "https://www.douyin.com/video/7539330955225484584",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "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": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=douyin
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
