Answers

How do I convert a Douyin share link (v.douyin.com) into a video ID and its data?

Short answer

Send the link as url to the okdata Douyin video detail endpoint; v.douyin.com short links are resolved for you and the response carries the numeric video ID (aweme_id) along with caption, likes, comments, shares, saves and author, for $0.002 per link. A batch of 500 links costs $1.00.

People share Douyin videos as a paragraph of text: "7.12 复制打开抖音,看看【某某的作品】… https://v.douyin.com/iAbCdEf/ …". Your sheet of creator submissions, customer tickets or competitor examples is full of these. To do anything with them, comments, metrics, tracking, you need the numeric video ID, the 19-digit aweme_id. Short links need a redirect to resolve, some tools reject share text outright, and a tool that worked on /video/ links may fail on ?modal_id= or photo-post /note/ links. One call to video detail with the link returns the ID and the video's numbers.

Douyin video detail takes url or id. Accepted links:

  • https://v.douyin.com/... short links, resolved on our side;
  • douyin.com/video/<id> and douyin.com/note/<id> (photo posts);
  • any douyin.com page with ?modal_id=<id>, such as search or user pages with a video open;
  • iesdouyin.com share pages.

The response has id (the aweme_id), url, caption, publish time, likes, comments, shares, saves, hashtags, music and duration under ext with view=full, and the author's sec_uid and name.

Cost

Links Calls Cost
1 1 $0.002
500 500 $1.00
500 links, then 2 comment pages each 1,500 {{cost:douyin.videos.get500+douyin.videos.comments.list1000}}

From share text to ID

import os, re, requests

share = "7.12 复制打开抖音,看看【某某的作品】露营必带清单 https://v.douyin.com/iAbCdEf/ Kjc:/ 08/15"
link = re.search(r"https?://v\.douyin\.com/[\w-]+/?", share).group(0)

item = requests.get(
    "https://api.okdata.online/v1/douyin/videos/get",
    headers={"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"},
    params={"url": link, "fields": "id,text,metrics,author.id,author.name"},
    timeout=60,
).json()["data"]["item"]
print(item["id"])

Store the ID. Comments need it, and later refreshes can call by id directly.

Gotchas

  • The endpoint wants a link, not the whole share message; extract it first as above.
  • A short link to an account, not a video, belongs to account profile, which accepts v.douyin.com links too.
  • Deleted or private videos return not_found and are not charged.
  • metrics.views is usually null: Douyin does not publish play counts on other people's videos.

Doing it yourself

Resolving a short link is a single redirect: request it without following redirects and read the number from the Location header. That is fine for a few links and needs no service. You will still need something to fetch the video's data afterwards, which is where signatures and cookies come back in. For tracking many videos over time, see competitor monitoring.

Updated