For AI

Answers

What are aweme_id and modal_id in Douyin links?

Short answer

They are the same number. aweme_id is Douyin's ID for a post, a 19-digit integer, and modal_id is the parameter douyin.com uses to open that post in an overlay on another page. Send the number as id, or the whole link as url, to okdata's Douyin video detail for $0.002; every search result carries it as id as well.

In Douyin's own API every post is an "aweme", and aweme_id is the post's ID: a plain integer, 19 digits long for anything posted in recent years, such as 7428815302664207643. Videos and photo posts (图文) share the same kind of number. modal_id is not a second ID. It is a query parameter on douyin.com pages that opens a post in a pop-up layer over whatever you were browsing: search results, a creator's page, your own likes, the 精选 feed. Its value is the aweme_id, so douyin.com/search/露营?modal_id=7428815302664207643 and douyin.com/video/7428815302664207643 point at the same post. Tools that only look for /video/ in the path fail on the first kind of link, which is why "unsupported URL" reports with modal_id keep turning up in downloader issue trackers.

Where the number shows up

Where Example What it is
Video page douyin.com/video/7428815302664207643 aweme_id in the path
Photo post page douyin.com/note/7428815302664207643 same ID space, different path
Overlay on another page douyin.com/user/MS4w...?modal_id=7428815302664207643 aweme_id as a parameter
Share link v.douyin.com/iAbCdEf/ a short code that redirects to one of the above
okdata response id on a post aweme_id as a string

Look-alikes to keep apart

  • Comment IDs are also 19-digit numbers that start with 7. Keep them in their own column so they never get joined to posts.
  • sec_uid (MS4wLjABAAAA…) identifies an account, not a post. See how to get a sec_uid.
  • The numeric uid and the Douyin number (抖音号) are account identifiers too.
  • The code in a v.douyin.com link is not an ID. It only means something after the redirect.

One more property: divide an aweme_id by 2^32 and you get a Unix time close to when the post was uploaded. Douyin does not document this, and scheduled posts go live hours after that moment, so report published_at instead.

How the API takes it and returns it

Douyin video detail takes id=7428815302664207643, or url= with any link from the table, modal_id links and v.douyin.com short links included. It returns the post with id (the aweme_id as a string), url, type (video or image), caption, publish time, author and counts. Every result of Douyin video search carries the same id, and video comments take it as id.

Step Calls Cost
One link or ID to post data 1 $0.002
300 links from a spreadsheet 300 $0.60
One search page, IDs included 1 $0.02

Example

curl -G "https://api.okdata.online/v1/douyin/videos/get" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'url=https://www.douyin.com/search/露营?modal_id=7428815302664207643' \
  --data-urlencode 'fields=id,url,type,published_at,metrics.likes'

The url in the answer is the canonical /video/ or /note/ link, whichever kind of post it is.

Limits

  • Store the ID as text. A 19-digit number is too large for a double to hold exactly: JavaScript rounds it, and Excel keeps 15 significant digits, so the last four become zeros.
  • A modal_id copied from a logged-in page such as /user/self still works, because only the number is read.
  • Deleted or private posts return not_found, which is not charged.
  • Turning share text into an ID step by step is covered in Douyin share link to video ID.

Sources

  1. Douyin /user/self link with modal_id reported as unsupported (VidBee issue #502)github.com · read
  2. Search page link with ?modal_id= not recognised (TikTokDownloader issue #147)github.com · read
  3. Excel specifications and limits: number precision of 15 digitssupport.microsoft.com · read

Where people asked this (read 2026-11-12)

Updated

Connect once, then just ask.

Every new key comes with $0.10 to try it. One sentence connects your agent.

Start free
Connect your AI

Paste this into your agent

Read https://okdata.online/agents.md and set up okdata for me; my key is in the OKDATA_API_KEY environment variable.

Claude Code, Cursor, Codex and other agents that can open a link set themselves up from it.

MCP serverhttps://api.okdata.online/mcp