Answers
How do I track clip views on TikTok, YouTube Shorts, Instagram Reels and X to pay clippers per 1,000 views?
Short answer
Read each clip's public view count from its link with one key. okdata has a detail endpoint per platform that takes the link and returns views: $0.002 for a TikTok, $0.002 for a YouTube Short, $0.004 for an Instagram Reel and $0.0003 for an X post. Snapshot every clip on a schedule and pay on the views added since the last payout. 200 clips read twice a week for four weeks, plus a twice-weekly look at 40 clipper accounts for new posts, costs $4.232.
An agency runs a clipping campaign for a podcast. Forty clippers cut short clips and post them on TikTok, YouTube Shorts, Instagram Reels and X, and the agency pays a fixed rate per 1,000 views. By the end of week one there are 200 links in a spreadsheet, and someone has to open each one every few days, copy the number under it and work out who is owed what. The clippers will not hand over their logins, and each platform's analytics belong to the account owner. What everyone can see is the public count under each post, and that is the number you can read with an API.
The easy route: connect once, then ask
Connect okdata to the assistant you already use. In Claude it is a custom connector you sign in to, with no key to copy (Claude setup); in Cursor, Claude Code and other MCP clients you add https://api.okdata.online/mcp with your key (MCP page); or you hand your agent the one-sentence setup in agents.md. Then ask in plain words:
- "Here is our clip sheet with columns clipper, link and views paid so far. Get the current views of every link, add the new views since the last payout and the payout at our rate per 1,000 views, and give the sheet back with the time you read each number. Tell me the cost before you start."
- "List the Shorts @clipper_one posted on YouTube this week and the reels @clipper_one posted on Instagram, with views, and flag any that are not in our sheet."
The agent picks the right endpoint for each link and can tell you what the run will cost before it starts.
Which endpoint reads which clip
Every detail endpoint takes the link as url, so you can paste links as clippers submit them. Views come back in metrics.views on all four.
| Clip | Endpoint | What metrics.views holds |
Price |
|---|---|---|---|
| TikTok video, full or short link | TikTok video detail | plays | $0.002 |
YouTube Short (/shorts/ link) |
YouTube video detail | views | $0.002 |
Instagram Reel (/reel/ or /p/ link) |
Instagram post detail | plays | $0.004 |
| X post | X post detail | views | $0.0003 |
To find clips nobody has submitted yet, read each clipper's newest posts: TikTok account videos (10 a page), YouTube channel videos with type=short (about 30 a page), Instagram account posts with type=reel (12 a page) and X account posts (20 a page). Each item carries its link and its views, so the newest page of a busy clipper also gives you their latest numbers.
A month of tracking, priced
The campaign: 200 clips (80 TikTok, 50 YouTube Shorts, 40 Instagram Reels, 30 X posts) read every Monday and Thursday for four weeks, and 40 clipper accounts (10 per platform) checked for new posts on the same days.
| Job | Calls | Cost |
|---|---|---|
| 80 TikTok clips, 8 reads each | 640 | $1.28 |
| 50 YouTube Shorts, 8 reads each | 400 | $0.80 |
| 40 Instagram Reels, 8 reads each | 320 | $1.28 |
| 30 X posts, 8 reads each | 240 | $0.072 |
| 40 clipper accounts, newest page, 8 times | 320 | $0.80 |
| The month | 1,920 | $4.232 |
You pay per call, with no subscription, and every endpoint has its own price. Top-ups start at $10 and the credit does not expire; a new key comes with $0.10 of trial credit.
Code: a CSV of clip links in, payouts out
clips.csv has the columns clipper, url and paid_views (the views you have already paid for; empty for a new clip). The script reads every link once, flags the same clip submitted twice and writes payouts.csv.
import csv, os, requests
from datetime import datetime, timezone
from urllib.parse import urlparse
API = "https://api.okdata.online"
H = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}
RATE = 1.50 # what you pay per 1,000 views
DETAIL = {"tiktok.com": "/v1/tiktok/videos/get", "youtube.com": "/v1/youtube/videos/get",
"youtu.be": "/v1/youtube/videos/get", "instagram.com": "/v1/instagram/posts/get",
"x.com": "/v1/x/posts/get", "twitter.com": "/v1/x/posts/get"}
def detail_path(url):
host = urlparse(url).hostname or ""
return next((p for d, p in DETAIL.items() if host == d or host.endswith("." + d)), None)
def views(url):
path = detail_path(url)
if not path:
return None, None, "not a TikTok, YouTube, Instagram or X link"
body = requests.get(API + path, headers=H, timeout=60,
params={"url": url, "fields": "id,metrics.views"}).json()
if body["code"] != "ok":
return None, None, body["code"]
item = body["data"]["item"]
return f"{path}:{item['id']}", item.get("metrics", {}).get("views"), "ok"
now = datetime.now(timezone.utc).isoformat(timespec="seconds")
seen, out = set(), []
with open("clips.csv", newline="") as f:
for row in csv.DictReader(f):
key, current, status = views(row["url"])
if key in seen:
current, status = None, "duplicate"
elif key:
seen.add(key)
new = max(0, current - int(row["paid_views"] or 0)) if current is not None else 0
out.append({**row, "views_now": current, "new_views": new,
"payout": round(new / 1000 * RATE, 2), "status": status, "read_at": now})
with open("payouts.csv", "w", newline="") as f:
w = csv.DictWriter(f, fieldnames=list(out[0]))
w.writeheader()
w.writerows(out)
print(f"{sum(r['payout'] for r in out):.2f} owed across {len(out)} clips")
After you pay, copy views_now into paid_views and keep the old payouts.csv as the record of that run.
Things that decide whether the payout is fair
- Snapshot on a schedule, pay on the delta. No platform hands you a view history; each read is the count at that moment. Read on fixed days, keep every run with its time (
meta.fetched_atin the response) and pay only the views added since the last payout. If a count goes down between two reads, the script pays zero rather than a negative amount. - Set a tracking window. Write into the campaign rules how many days after posting a clip keeps earning, then stop reading clips past it. That also caps the cost.
- Dedupe. A short link and a full link to the same clip resolve to the same ID, and the script marks the second one
duplicate. A clip re-uploaded by another clipper is a separate post with its own ID; compare captions, length and posting times to catch it, and say in the rules whether reposts are paid. - Views are what the platform shows publicly when you read it. Each platform counts its own way. YouTube counts a view the moment a video starts to play, Shorts included, and from November 2026 adds estimated co-views from TV screens to watch-page counts. Instagram's developer docs describe views as the number of times the media was played. X's developer docs say a post's impressions count every time it appears on someone's screen, and not uniquely: one person seeing it twice counts twice. You may want a separate rate per platform for this reason.
- Photo posts and dead links. An Instagram photo post has no plays, so
metrics.viewsis null. A deleted or private clip returnsnot_found: keep the last count you paid on and stop reading it.
Related answers
- One platform at a time: TikTok stats from a link, YouTube Shorts views, X post views.
- Why TikTok's own API does not cover other people's accounts: TikTok Display API and other accounts.
Sources
Where people asked this (read 2026-11-19)
Updated