MarkdownCopies this page as Markdown, ready to paste into an AI assistant.
TikTok API
34 TikTok endpoints behind one key, priced in credits per call and routed to the cheapest healthy source.
On this page
Web Intelligence · 34 endpoints · from 1 credit per call
Endpoints
- POSTTikTok Ad Library Ad
/v1/run/tiktok.ad_library_adFull details of one TikTok ad by id or URL: brand, ad text, objective, countries, CTR and spend bucket, engagement, landing page and video.2 creditsper call - POSTTikTok Ad Library Search
/v1/run/tiktok.ad_library_searchSearch TikTok's public Ads Library (Commercial Content Library) by keyword or advertiser: advertiser, format, run dates, audience band, library link and video.3 creditsper call - POSTTikTok Ad Transparency Search
/v1/run/tiktok.ad_transparency_searchSearch TikTok's EU Commercial Content Library (ad transparency) by keyword, optionally narrowed to one advertiser id, region and sort order.3 creditsper call - POSTTikTok Audience Demographics
/v1/run/tiktok.audience_demographicsWhere a TikTok creator's followers are located: follower count and percentage share per country, by handle.62 creditsper call - POSTTikTok Comment Replies
/v1/run/tiktok.comment_repliesReplies to one TikTok comment, with text, likes, language and replier details, paginated by cursor.2 creditsper call - POSTTikTok Followers
/v1/run/tiktok.followersPage of accounts that follow a public TikTok profile, with each follower’s handle, name, bio and counts.2 creditsper call - POSTTikTok Following
/v1/run/tiktok.followingPage of accounts a public TikTok profile follows, with each account’s handle, display name, bio and counts.2 creditsper call - POSTTikTok Hashtag Search
/v1/run/tiktok.search_hashtagTikTok videos posted under a hashtag, as TikTok ranks them, with captions, authors and engagement counts.3 creditsper call - POSTTikTok Hashtag Videos
/v1/run/tiktok.hashtag_videosRecent TikTok videos posted under a hashtag, with caption, creator, sound and view, like, comment and share counts.3 creditsper call - POSTTikTok Keyword Search
/v1/run/tiktok.search_keywordTikTok videos matching a keyword, sortable by relevance, likes or date and filterable by posting window.2 creditsper call - POSTTikTok Live
/v1/run/tiktok.liveWhether a TikTok creator is live right now and, if so, the live room title, viewers, entries and start time, by handle.2 creditsper call - POSTTikTok Photos
/v1/run/tiktok.photosEvery image of a public TikTok photo-mode (slideshow) post, in order, with the caption, author and engagement counts.2 creditsper call - POSTTikTok Playlist Videos
/v1/run/tiktok.playlist_videosVideos inside one public TikTok playlist (collection), in playlist order, with view, like and comment counts.2 creditsper call - POSTTikTok Profile
/v1/run/tiktok.profilePublic profile of one TikTok account: bio, follower, like and video counts, verification, link in bio and stable ids.2 creditsper call - POSTTikTok Profile Contact Info
/v1/run/tiktok.profile_contactPublic contact emails of a TikTok creator, read from the bio and the linked website, each labelled with its source.3 creditsper call - POSTTikTok Profile Region
/v1/run/tiktok.profile_regionCountry code TikTok associates with an account, looked up by handle.2 creditsper call - POSTTikTok Profile Reposts
/v1/run/tiktok.profile_repostsVideos a public TikTok account has reposted to its profile, with the original creator and engagement counts.2 creditsper call - POSTTikTok Profile Videos
/v1/run/tiktok.profile_videosOne page of the public videos a TikTok account has posted, newest or most popular first, with engagement counts.2 creditsper call - POSTTikTok Search Suggestions
/v1/run/tiktok.search_suggestionsSearch terms TikTok suggests for a seed keyword, with language and relative weight: what users type around a topic.2 creditsper call - POSTTikTok Song
/v1/run/tiktok.songDetails of a TikTok sound by clip id: title, artist, album, duration, cover art and how many videos use it.2 creditsper call - POSTTikTok Song Videos
/v1/run/tiktok.song_videosOne page of TikTok videos that use a given sound, with captions, authors and engagement counts.2 creditsper call - POSTTikTok Top Ads Search
/v1/run/tiktok.top_ads_searchSearch TikTok Creative Center top-performing video ads by brand or product keyword, with objective, period and performance filters.2 creditsper call - POSTTikTok Top Search
/v1/run/tiktok.search_topResults of TikTok's "Top" search tab for a keyword: videos and photo carousels with captions and engagement counts.2 creditsper call - POSTTikTok Trending Feed
/v1/run/tiktok.trending_feedA fresh sample of TikTok's For You feed as served from one country, with caption, author and engagement per video.3 creditsper call - POSTTikTok Trending Hashtags
/v1/run/tiktok.trending_hashtagsTikTok Creative Center's trending hashtag board for one market and industry, with post counts, views and a daily popularity curve.2 creditsper call - POSTTikTok User Search
/v1/run/tiktok.search_usersTikTok accounts matching a name or keyword, with handles, ids, follower counts and linked profiles.2 creditsper call - POSTTikTok Video
/v1/run/tiktok.videoCaption, author, sound, engagement counts and a playable media URL for one public TikTok video or photo post.1 creditper call - POSTTikTok Video Comments
/v1/run/tiktok.video_commentsTop-level comments on a public TikTok video or photo post, with author, likes and reply counts, page by page.2 creditsper call - POSTTikTok Video Download
/v1/run/tiktok.video_downloadDirect media links for a public TikTok video: the no-watermark MP4, the watermarked MP4 and the cover, with size and duration.1 creditper call - POSTTikTok Video Transcript
/v1/run/tiktok.video_transcriptThe caption track TikTok already has for a public video, flattened to plain text with timed segments when available.2 creditsper call - POSTTikTok Video Transcript (Speech to Text)
/v1/run/tiktok.video_transcript_fullSpeech-to-text transcript of a public TikTok video with timed segments and optional word timings, billed per started audio minute.3 creditsper call - POSTTikTok Photo SearchPlanned
/v1/run/tiktok.search_photosSearch TikTok photo-mode (slideshow) posts by keyword, with every image of each post and its engagement counts.Planned - POSTTikTok Profile PlaylistsPlanned
/v1/run/tiktok.profile_playlistsThe playlists a TikTok creator has published on their profile, with name, video count and cover image.Planned - POSTTikTok User StoriesPlanned
/v1/run/tiktok.user_storiesA TikTok creator's currently active public stories: video or photo links, posting and expiry times and engagement counts.Planned
Calling them
Every endpoint on this page is one POST to https://api.primaryapi.com/v1/run/{sku} with your API key and a JSON body. Responses share one envelope, so code written for one endpoint handles the others. For example, tiktok.ad_library_ad:
curl -sS -X POST "https://api.primaryapi.com/v1/run/tiktok.ad_library_ad" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"adId":"1881325446248609"}'const res = await fetch('https://api.primaryapi.com/v1/run/tiktok.ad_library_ad', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRIMARYAPI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
adId: '1881325446248609',
}),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.error}`);
// found:false is a successful answer ("does not exist"), not an error
console.log(body.output.found ? body.output.data : body.output.reason, body.credits);import os
import requests
res = requests.post(
"https://api.primaryapi.com/v1/run/tiktok.ad_library_ad",
headers={"Authorization": f"Bearer {os.environ['PRIMARYAPI_API_KEY']}"},
json={
"adId": "1881325446248609",
},
timeout=60,
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['code']}: {body['error']}")
# found=False is a successful answer ("does not exist"), not an error
print(body["output"]["data"] if body["output"]["found"] else body["output"]["reason"], body["credits"])New to PrimaryAPI? Start with the Quickstart, then read Making requests.