Guide - TikTok analytics tool
How to build a TikTok analytics tool
A script, a CSV file, and a chart. Build a TikTok tracker for 5 creators in an afternoon, for about a dollar a month in API calls.
Short answer: You can build a basic TikTok analytics tool in an afternoon with three parts: an API that returns TikTok profiles, videos and comments as JSON, a small script that pulls them on a schedule, and a spreadsheet or chart to show the numbers. This guide builds exactly that in Python, with copy-paste code, and it costs about $0.96 a month in API calls to track 5 creators daily.
Social Data API is a single API key for TikTok, X, Instagram and Reddit. TikTok and X are live now. Instagram is next, then Reddit, all on the same key.
What you are building
A small tool that tracks a few TikTok creators for you: how fast their followers grow, which videos perform, and what their engagement rate looks like. No dashboard framework, no database server. A script, a CSV file, and a chart.
Pick 5 creators in one niche to start. Five is enough to see patterns and small enough to keep the data cost near zero.
Step 1: get one API key
Sign up at Social Data API and start the 3-day free trial. It gives you 100 calls on TikTok, card required, $29 a month after trial unless you cancel. Your key goes in the x-api-key header of every call. The trial covers TikTok only, which is fine here, because this whole tool is TikTok.
Step 2: pull a profile and its videos
Two calls per creator. First the profile, which gives you the follower count and the secUid. Then the videos endpoint with that secUid, which gives you the videos and their view, like and comment counts.
import requests
API = "https://social-data-api.chideraezeudu2.workers.dev"
KEY = "YOUR_API_KEY"
headers = {"x-api-key": KEY, "Content-Type": "application/json"}
profile = requests.post(API + "/v1/tiktok/profile",
headers=headers, json={"uniqueId": "example_creator"}).json()
sec_uid = profile["result"]["user"]["secUid"]
videos = requests.post(API + "/v1/tiktok/videos",
headers=headers, json={"secUid": sec_uid, "count": 20}).json()
for video in videos["result"]["videos"]:
print(video["desc"], video["stats"]["playCount"])Response shape, example values only, not real data. Field names inside result come from the upstream provider and vary by endpoint. The wrapper is always the same: platform, endpoint, credits_used, key_id, plan_type, result. Check the JSON your first call returns and adjust the field names to match.
Use the secUid, not the username, for the videos call. Videos by username costs 2 credits because it does a profile lookup first. Videos by secUid costs 1 credit.
Step 3: store the numbers
Append one row per creator per day to a CSV file: date, handle, followers, total likes, video count. Then append the top videos the same way. A CSV is enough for 5 creators. When you outgrow it, the same rows go into SQLite with no code changes beyond the write step.
import csv
from datetime import date
with open("tiktok_tracker.csv", "a", newline="") as f:
w = csv.writer(f)
w.writerow([date.today(), "example_creator",
profile["result"]["user"]["followerCount"],
profile["result"]["user"]["totalFavorited"]])Step 4: work out the engagement rate
For each video, engagement rate is likes plus comments, divided by views. That one number lets you compare a video with 10,000 views against a video with 1,000,000 views, which raw view counts never do.
for video in videos["result"]["videos"]:
s = video["stats"]
rate = (s["diggCount"] + s["commentCount"]) / max(s["playCount"], 1)
print(round(rate * 100, 2), "%", video["desc"][:60])Compare creators inside one niche only. A comedy creator and a finance creator will never have the same engagement rate, and the comparison tells you nothing.
Step 5: run it every day
Put the script on a schedule. A cron job, a scheduled GitHub Action, or a small server that runs it once a morning all work. Daily is enough. Follower counts move slowly, and hourly polling burns calls for no new information.
What it costs to run
- 5 creators, daily: 1 profile call plus 1 videos call each, 10 calls a day, 300 calls a month.
- 300 calls a month is $0.90 on pay as you go ($0.003 a call), or inside the $29 Basic plan, which includes 10,000 calls.
- Add comments for the top 5 videos each week: 5 calls a week, 20 calls a month, $0.06 on pay as you go.
- Total: about 320 calls a month, about $0.96 on pay as you go. The data is the cheap part. Your time building and reading the tool is the real cost.
Doing it without our API
You can build the same tool by hand: open each creator's profile once a day and type the numbers into a spreadsheet. It is free, and it works fine for 1 or 2 creators. It breaks at 5, because the typing takes longer than the thinking. The official TikTok Display API only returns your own account, so it cannot track other creators at all. Writing your own scraper works until TikTok changes something, and then you are fixing the scraper instead of reading the numbers. Our API is the part that makes the scheduled version work: the same two calls, every day, no maintenance.
Frequently asked questions
How often should I refresh the data?
Daily is enough for follower counts and video stats. Hourly polling burns calls for no new information. If a creator posts several times a day, run the videos call twice a day instead of once.
What is a good engagement rate on TikTok?
There is no universal number. Compare creators inside one niche only, and compare a creator against their own past videos. A rate that beats their own average is the signal, not a fixed percentage.
Can I add Instagram later?
Yes, when the Instagram endpoints go live they will use the same key and the same wrapper. The tool only needs a new fetch step, the storage and charting stay the same.
What if a creator's account is private?
You get no data back, the same as on TikTok itself. Skip private accounts and pick public creators for the tracker.
Start the 3-day free trial: 100 calls on TikTok, card required, $29/mo after trial unless you cancel. Get your API key or try it in the Playground.
Prices checked on 2026-11-08. Instagram is next after X, then Reddit, all on the same single API key.