# Can you tell when a TikTok video was posted from its ID?

> The top 32 bits of a TikTok video ID are a Unix timestamp in seconds. The bit layout, a worked example, how close it is to the real posting time, and when to ask the API.

Canonical page: https://okdata.online/answers/tiktok-video-id-timestamp/

**Short answer: **Yes, roughly: shift the 64-bit video ID right by 32 bits and the result is a Unix timestamp in seconds, usually within seconds of the posting time. It works offline, even for deleted videos. When you need the exact time, okdata TikTok video detail returns it as published_at, with the stats, for $0.002.

A TikTok video ID such as `7685272005228685423` is not a random number. It is a 64-bit integer, and its highest 32 bits are the Unix time, in seconds, when TikTok created the ID. Read those bits and you know roughly when the video went up, without opening TikTok and even after the video is gone.

## The bit layout

| Bits | Holds |
|---|---|
| 63 to 32 | Unix timestamp in seconds |
| 31 to 0 | Milliseconds, a sequence number, an object type and a machine number, as decoded by forensic tools |

The same scheme numbers other TikTok objects too, user and music IDs among them, so the trick dates those as well. Treat the lower 32 bits as opaque unless you have a reason to dig in; the timestamp is the useful part.

## Worked example

Take `7685272005228685423`.

1. Shift right by 32 bits (the same as integer division by 4,294,967,296): `7685272005228685423 >> 32 = 1789366827`.
2. Read that as Unix seconds: 1789366827 is 14 September 2026, 06:20:27 UTC, which is 14:20:27 in Beijing.

Treat the string as a number: shifting the characters of the ID gives nonsense. In JavaScript use `BigInt`, because the ID is larger than a regular number can hold exactly.

## How close is it?

The ID is minted just before the post is saved, so the decoded time is usually a little earlier than the posting time TikTok shows. Ryan Benson, whose write-up the Bellingcat tool is based on, found most within 5 seconds and none more than 18 seconds apart. In our own check of a dozen videos from search results, most were within half a minute, but one was almost a day apart, so use the ID for ordering and rough dating, not as evidence of the exact minute.

## When to ask the API instead

[TikTok video detail](/apis/tiktok/videos/get/) takes the ID or link and returns `published_at` in UTC, plus the caption, author and plays, likes, comments and shares.

| You need | Do | Cost |
|---|---|---|
| Rough dates for a list of IDs | Decode locally | free |
| Exact posting time and current stats | One detail call per video | $0.002 |
| 500 videos from a campaign sheet | 500 calls | $1.00 |

## Example

```python
import os, requests
from datetime import datetime, timezone

def id_time(video_id: str) -> datetime:
    return datetime.fromtimestamp(int(video_id) >> 32, tz=timezone.utc)

vid = "7685272005228685423"
print("from the ID:", id_time(vid).isoformat())

body = requests.get("https://api.okdata.online/v1/tiktok/videos/get", timeout=60,
    headers={"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"},
    params={"id": vid, "fields": "id,published_at,metrics.views"}).json()
if body["code"] == "ok":
    print("published_at:", body["data"]["item"]["published_at"])
else:
    print(body["code"])  # not_found for a deleted video, still charged
```

## Limits

- The ID tells you when, not who or what. For the caption and author of a deleted video there is nothing to fetch; detail returns `not_found`, which is still charged as one call.
- Video detail also accepts photo-post links (`/photo/` instead of `/video/`).
- Short links like vm.tiktok.com hide the ID until resolved; see [getting the video ID from a TikTok short link](/answers/tiktok-short-link-video-id/).

## Endpoints used

- [TikTok video detail](https://okdata.online/apis/tiktok/videos/get/) `tiktok.videos.get`: $0.002 per call

## More about TikTok

- [TikTok API](https://okdata.online/apis/tiktok/)
- [TikTok comments in Python for sentiment analysis (2026)](https://okdata.online/guides/tiktok-comments-python/)
- [How to get TikTok Creative Center top ads by API](https://okdata.online/guides/tiktok-creative-center-top-ads/)
- [How to collect TikTok Shop product reviews by keyword](https://okdata.online/guides/tiktok-shop-product-reviews/)
- [How fresh is the data from a social media API?](https://okdata.online/answers/how-fresh-is-social-media-api-data/)
- [How do I track clip views on TikTok, YouTube Shorts, Instagram Reels and X to pay clippers per 1,000 views?](https://okdata.online/answers/clipper-payout-view-tracking/)
- [How do I export all the comments on a TikTok video to CSV or Excel?](https://okdata.online/answers/export-tiktok-comments-csv/)
- [Why are some fields empty in my social data API results, and do I still pay?](https://okdata.online/answers/null-fields-still-charged/)
- [Can the TikTok Display API read other people's videos or comments?](https://okdata.online/answers/tiktok-display-api-other-accounts/)
- [TikTok's Research API is only for academics. What can a company use instead?](https://okdata.online/answers/tiktok-research-api-alternative/)
- [Official platform APIs vs third-party data APIs (2026)](https://okdata.online/compare/official-apis-vs-data-apis/)
- [How to choose a social media data API (2026)](https://okdata.online/compare/social-media-data-apis/)
- [Post detail API](https://okdata.online/roles/posts-get/)

## Sources

- [Tinkering with TikTok Timestamps (Ryan Benson)](https://hindsig.ht/blog/tinkering-with-tiktok-timestamps/) (read 2026-11-12)
- [unfurl: TikTok ID parser and bit layout](https://github.com/obsidianforensics/unfurl/blob/main/unfurl/parsers/parse_tiktok.py) (read 2026-11-12)
- [bellingcat/tiktok-timestamp](https://github.com/bellingcat/tiktok-timestamp) (read 2026-11-12)
- [Just Another Hour on TikTok: ID sampling to obtain a complete slice of TikTok (arXiv 2504.13279)](https://arxiv.org/abs/2504.13279) (read 2026-11-12)

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

- https://github.com/davidteather/TikTok-Api/issues/318
- https://github.com/davidteather/TikTok-Api/issues/1022

Updated 2026-11-12
