API documentation / TikTok

TikTok API

Read any public TikTok profile as JSON: exact follower count, videos, likes, plus video metrics, comments, and the only follower and following list we expose.

The SocialLens API is one generic API: you call an endpoint by data type and pass platform=tiktok. The response schema is the same across every network. Authenticate with a Bearer key from /keys; start with 250 free reads, no card. Full reference, credits, rate limits and errors are on the main docs.

TikTok is the one network with a full follower and following list (paginated by cursor). For every other network only the follower count is available, through /v1/profile.

Public profile

GET/v1/profile

Reads the public TikTok profile and returns normalized counters and identity (including the follower count).

bash
curl "https://api.sociallens.dev/v1/profile?username=tiktok&platform=tiktok" \
  -H "Authorization: Bearer sk_live_your_key"
python · requests
import requests
res = requests.get(
    "https://api.sociallens.dev/v1/profile",
    params={ "username": "tiktok", "platform": "tiktok" },
    headers={"Authorization": "Bearer sk_live_your_key"},
)
data = res.json()
node · fetch
const res = await fetch("https://api.sociallens.dev/v1/profile?username=tiktok&platform=tiktok", {
  headers: { Authorization: "Bearer sk_live_your_key" },
});
const data = await res.json();
php
$ch = curl_init("https://api.sociallens.dev/v1/profile?username=tiktok&platform=tiktok");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["Authorization: Bearer sk_live_your_key"],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);

Post metrics

GET/v1/post

Public metrics of a single TikTok post: likes, views, comments, shares and author.

bash
curl "https://api.sociallens.dev/v1/post?url=https://www.tiktok.com/@nasa/video/7665075736742530317&platform=tiktok" \
  -H "Authorization: Bearer sk_live_your_key"
python · requests
import requests
res = requests.get(
    "https://api.sociallens.dev/v1/post",
    params={ "url": "https://www.tiktok.com/@nasa/video/7665075736742530317", "platform": "tiktok" },
    headers={"Authorization": "Bearer sk_live_your_key"},
)
data = res.json()
node · fetch
const res = await fetch("https://api.sociallens.dev/v1/post?url=https://www.tiktok.com/@nasa/video/7665075736742530317&platform=tiktok", {
  headers: { Authorization: "Bearer sk_live_your_key" },
});
const data = await res.json();
php
$ch = curl_init("https://api.sociallens.dev/v1/post?url=https://www.tiktok.com/@nasa/video/7665075736742530317&platform=tiktok");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["Authorization: Bearer sk_live_your_key"],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);

Profile posts

GET/v1/profile-posts

Recent posts of a TikTok profile, one page per credit.

bash
curl "https://api.sociallens.dev/v1/profile-posts?username=tiktok&platform=tiktok" \
  -H "Authorization: Bearer sk_live_your_key"
python · requests
import requests
res = requests.get(
    "https://api.sociallens.dev/v1/profile-posts",
    params={ "username": "tiktok", "platform": "tiktok" },
    headers={"Authorization": "Bearer sk_live_your_key"},
)
data = res.json()
node · fetch
const res = await fetch("https://api.sociallens.dev/v1/profile-posts?username=tiktok&platform=tiktok", {
  headers: { Authorization: "Bearer sk_live_your_key" },
});
const data = await res.json();
php
$ch = curl_init("https://api.sociallens.dev/v1/profile-posts?username=tiktok&platform=tiktok");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["Authorization: Bearer sk_live_your_key"],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);

Post comments

GET/v1/post-comments

Public comments of a single TikTok post: text, author, likes and replies, one page per credit.

bash
curl "https://api.sociallens.dev/v1/post-comments?url=https://www.tiktok.com/@nasa/video/7665075736742530317&platform=tiktok" \
  -H "Authorization: Bearer sk_live_your_key"
python · requests
import requests
res = requests.get(
    "https://api.sociallens.dev/v1/post-comments",
    params={ "url": "https://www.tiktok.com/@nasa/video/7665075736742530317", "platform": "tiktok" },
    headers={"Authorization": "Bearer sk_live_your_key"},
)
data = res.json()
node · fetch
const res = await fetch("https://api.sociallens.dev/v1/post-comments?url=https://www.tiktok.com/@nasa/video/7665075736742530317&platform=tiktok", {
  headers: { Authorization: "Bearer sk_live_your_key" },
});
const data = await res.json();
php
$ch = curl_init("https://api.sociallens.dev/v1/post-comments?url=https://www.tiktok.com/@nasa/video/7665075736742530317&platform=tiktok");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["Authorization: Bearer sk_live_your_key"],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);

Followers and following list

GET/v1/followers

The list of accounts that follow a TikTok profile (and /v1/following for the accounts it follows), paginated by cursor. Available for TikTok only.

bash
curl "https://api.sociallens.dev/v1/followers?username=tiktok&platform=tiktok" \
  -H "Authorization: Bearer sk_live_your_key"
python · requests
import requests
res = requests.get(
    "https://api.sociallens.dev/v1/followers",
    params={ "username": "tiktok", "platform": "tiktok" },
    headers={"Authorization": "Bearer sk_live_your_key"},
)
data = res.json()
node · fetch
const res = await fetch("https://api.sociallens.dev/v1/followers?username=tiktok&platform=tiktok", {
  headers: { Authorization: "Bearer sk_live_your_key" },
});
const data = await res.json();
php
$ch = curl_init("https://api.sociallens.dev/v1/followers?username=tiktok&platform=tiktok");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ["Authorization: Bearer sk_live_your_key"],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);

See also, guides on the blog: How to Track TikTok Follower Growth Programmatically, Enrich a Clay Table with Follower Counts via HTTP API, Followers Count API for SMM Panels, Engagement Rate API for Indie Influencer Apps, Social Media Data for Academic Research After CrowdTangle, Data365 and EnsembleData Alternatives, and all guides.

Back to the full API documentation