Skip to Content
tikdataapi.com

Pagination

Cursors, page size and ordering.

List endpoints return a page and, when there is more, a next_cursor. Pass it back as cursor to get the next page.

curl "https://api.tikdataapi.com/v1/users/tiktok/videos?count=16" -H "x-api-key: $KEY"
# ... "next_cursor": "MTczMjk4NjEz..."
curl "https://api.tikdataapi.com/v1/users/tiktok/videos?count=16&cursor=MTczMjk4NjEz..." -H "x-api-key: $KEY"
Endpointcount defaultcount maximumOrder
/v1/users/{user}/videos1650pinned videos first, then newest first
/v1/videos/{id}/comments2050the order of TikTok: pinned first, then the most relevant
/v1/videos/{id}/comments/{comment_id}/replies2050oldest first
/v1/hashtags/{name}/videos3050the order of the hashtag page on TikTok: popular, not newest first
/v1/search/videos1250the order of the general search of TikTok
/v1/search/users1050the order of the account search of TikTok
/v1/search/music1250the order of the sound search of TikTok
/v1/search/live1250the order of the live search of TikTok
/v1/users/{user}/followers3050newest first, as TikTok gives them
/v1/users/{user}/following3050newest first, as TikTok gives them
/v1/users/{user}/reposts1650the order of TikTok
/v1/users/{user}/playlists2050the order of TikTok
/v1/playlists/{id}/videos3050the order of the playlist
/v1/music/{id}/videos3050the order of TikTok
/v1/videos/{id}/related1616the order of TikTok; one page, no next_cursor
/v1/trending/videos1650the explore feed of TikTok; no pages, no next_cursor
/v1/search/hashtags1030most used first in the videos of the general search; no pages, no next_cursor
  • Cursors are opaque strings. Do not parse them or store them for longer than a session.
  • A page without next_cursor is the last one.
  • You are charged for the items you receive.
  • TikTok decides how many items one of its pages holds: about 30 videos of an account, 20 comments or replies, 30 videos of a hashtag, 12 videos of a video search, about 10 accounts of an account search (one page in our tests had 30), 30 accounts of a follower or following list, 12 sounds of a sound search and up to 12 rooms of a live search. The default count is one TikTok page, and for account search one call with the default count is one read of TikTok. The videos of an account are the exception: their default count of 16 is about half a TikTok page, so the next page comes mostly from cache at half price.
  • A larger count fills the page from more TikTok pages in the same call, so the call takes longer. One call reads TikTok at most 6 times, and starts no new read after 8 seconds. A page can therefore hold fewer than count items while the list goes on. next_cursor then continues with no gap.
  • A smaller count cuts a TikTok page. next_cursor then continues from the cut with no gap, and the rest of that TikTok page comes from cache at half price. Pass cursors back as they are.
  • The video list of a private account is empty, and so are its reposts and playlists. The comment list of a video with comments turned off is empty too. All are free.
  • Three lists have no pages. /v1/videos/{id}/related is one TikTok page of up to 16 videos. /v1/trending/videos is the explore feed of TikTok for a logged-out visitor: each read of TikTok gives a new set of about 16 videos, and a larger count reads more sets in the same call and drops repeated videos. /v1/search/hashtags ranks the hashtags of about 24 videos of the general search, up to 30. None of them takes a cursor.
  • POST /v1/users/videos/batch gives the first page of up to 20 accounts at once, 1 to 16 videos for each. The next_cursor of an entry continues that list on /v1/users/{user}/videos. See Batch reads.