TikTok API

Get TikTok data as clean JSON with one key: 39 endpoints, 1 to 3 credits per call, the same response shape as every other platform.

What you get#

Onekey exposes TikTok as 39 endpoints behind one API key: 13 endpoints return one record (data is an object) and 26 endpoints return a list (data is an array). Every answer uses the same envelope (success, data, metadata, error), the cost is reported in metadata.credits_charged, and fields are mapped onto the unified schema so the code you write for TikTok also works for the rest of the social networks category.

Endpoints#

EndpointWhat it doesParametersCreditsStatus
adlibrary_adGet a TikTok Ad Library ad.url, ad_id2beta needs a pack
adlibrary_searchSearch the TikTok Ad Library.query, advertiser_name, cursor3beta needs a pack
ads_topTop-performing ads board for a market and time window.country, period3beta needs a pack
collection_videosList videos in a TikTok collection.url*, cursor2beta needs a pack
commentLook up one TikTok comment by URL.comment_url*2beta needs a pack
comment_repliesReplies to a TikTok comment.id*, comment_id*, cursor2beta may need a pack
commentsComments on a TikTok video.id*, cursor2beta may need a pack
effect_videosList TikTok videos made with an effect.effect_id*, cursor2beta needs a pack
effectsGet TikTok effects by id.ids*2beta needs a pack
followersFollowers of a TikTok user (login-gated on the web: needs a session).sec_uid*, cursor2beta may need a pack
followingAccounts a TikTok user follows (login-gated on the web: needs a session).sec_uid*, cursor2beta may need a pack
hashtagTikTok hashtag (challenge) details: id, description, video and view counts.tag*1beta may need a pack
hashtag_videosVideos under a TikTok hashtag (needs the challenge id from tiktok.hashtag).challenge_id*, cursor2beta may need a pack
hashtags_popularTrending hashtag board for a market and time window.country, period3beta needs a pack
location_postsList TikTok videos tagged at a place.location_id*, cursor2beta needs a pack
musicTikTok sound/music details: title, artist, duration, video count.id*2beta may need a pack
music_videosVideos that use a TikTok sound.id*, cursor2beta may need a pack
oembedTikTok oEmbed for a public video (title, author, thumbnail).handle*, id*1beta may need a pack
playlist_videosList videos in a TikTok playlist.playlist_id, url, cursor2beta needs a pack
post_transcriptGet TikTok video transcript.url*2beta needs a pack
profileTikTok user profile: nickname, bio, followers, following, likes, video count, secUid.handle*2beta may need a pack
profile_fullTikTok profile, recent posts, and computed analytics in one call.handle, user_id2beta needs a pack
profile_regionGet TikTok profile region.handle*2beta needs a pack
relatedVideos related to a TikTok video.id*2beta may need a pack
search_mentionsSearch TikTok videos that mention an account (keyword search for @handle).handle*, cursor2beta needs a pack
search_musicSearch TikTok sounds.query*, cursor2beta needs a pack
search_suggestionsGet TikTok search suggestions.query*2beta needs a pack
search_topTikTok top search results.query*, cursor2beta needs a pack
search_usersSearch TikTok users by keyword.q*, cursor2beta may need a pack
search_videosSearch TikTok videos by keyword.q*, cursor2beta may need a pack
trendingTikTok For You / trending feed (anonymous).-2beta may need a pack
user_audienceGet TikTok user audience demographics.handle*2beta needs a pack
user_likedList the videos a TikTok account has liked.handle, user_id, cursor2beta needs a pack
user_liveGet TikTok user live stream.handle*2beta needs a pack
user_playlistsPlaylists (collections) of a TikTok user.sec_uid*2beta may need a pack
user_videosRecent videos posted by a TikTok user.sec_uid*, cursor2beta may need a pack
videoA single TikTok video: caption, author, plays, likes, comments, shares.id*2beta may need a pack
video_screen_textGet TikTok video on-screen text.url*2beta needs a pack
videos_popularTop Videos board for a supported market.country3beta needs a pack

A * marks a required parameter. Each endpoint name links to its reference page with the full parameter table, caching window and a recorded response.

Make a request#

This calls tiktok.hashtag (1 credit, beta). Replace YOUR_API_KEY with your key; sign up, no card. 1,000 free credits cover the open-platform endpoints. Hard-to-reach platforms (X, TikTok, Instagram, Reddit, and others marked on their page) need a verified email and a purchased pack.

curl "https://api.onekey.dev/v1/tiktok/hashtag?tag=fyp" \
  -H "x-api-key: YOUR_API_KEY"

Fields you get back#

These unified fields come back from TikTok, with the same names as on every other platform. The count is how many of its 39 mapped endpoints return the field; a field the source lacks is null, never missing. 14 platform-specific fields (ext.<name>) come on top, documented on each endpoint page.

FieldTypeEndpoints
content.textstring27
author.usernamestring25
engagement.likesinteger24
media.thumbnailUrlURL22
engagement.viewsinteger21
content.createdAtISO 8601 date20
author.displayNamestring19
content.idstring19
engagement.commentsinteger14
author.avatarUrlURL13
author.idstring13
engagement.sharesinteger12
entity.idstring9
media.durationSecondsnumber9
content.titlestring8
entity.namestring7
entity.urlURL7
content.urlURL6
engagement.bookmarksinteger6
author.followersinteger5
author.verifiedboolean4
media.urlURL3
author.contentCountinteger2
author.followinginteger2
author.urlURL2
content.languagestring2
entity.stats.itemCountinteger2
entity.statusstring2
author.biostring1
author.countrystring1
entity.descriptionstring1
media.audioUrlURL1

The full schema is in Unified schema.

Pricing#

TikTok calls cost 1 to 3 credits, flat per endpoint. Free when served from cache (0.2 credit for a cached response over 100 KB). Invalid, failed or not-found calls are not charged. See pricing for credit packs.