Skip to main content

Overview

VidNavigator offers two ways to collect TikTok videos:

Profile Scrape

Walk a single creator’s account and return their videos, filtered by date and likes.

Keyword Search

Search across TikTok by keyword and return matching videos from many creators.
Both are asynchronous: you submit a task, get a task_id back immediately, then poll a GET endpoint until the task is completed. Results are retained for about 1 hour, and large result sets can be downloaded as a single JSON file via a temporary download_url.
The Python and JavaScript SDKs (v2.1.0) wrap the submit-and-poll flow in a single call. Each section below starts with the SDK version, followed by the raw HTTP workflow (cURL, Python requests, and fetch) if you’d rather call the API directly.

Prerequisites

  • A valid VidNavigator API key.
  • Optional: the SDK, version 2.1.0 (pip install vidnavigator==2.1.0 or npm install vidnavigator@2.1.0).

Billing

Both endpoints bill in the background worker, so usage is disclosed on the polling GET (pass include_usage=true there), not at submit time. See Usage & Costs for credit conversions.

Searching a TikTok Profile

Send a public profile_url and optional filters. max_posts and after_datetime let the scraper stop paginating early.

With the SDK

One call submits the scrape, waits for it to finish, and returns the videos. In JavaScript you get every matching video (the SDK walks all pages); in Python you get the first page of limit videos plus the pagination cursor.
To start the scrape without waiting, use client.submit_tiktok_profile_scrape(...) (Python) or vn.tiktokProfile.submit(...) (JavaScript) and collect it later with job.result(). Both accept a webhook_url to be notified when the scrape finishes.

With raw HTTP

1. Submit the scrape

2. Poll until completed and page through results

Poll GET /tiktok/profile/{task_id} while task_status is processing. Once completed, walk the pages using the next_cursor from data.pagination.
For very large profiles, skip pagination and download the whole result at once: once the task is completed, data.download_url holds a short-lived signed URL to the full JSON. Call the GET endpoint again to mint a fresh URL if it expires.

Searching TikTok by Keyword

Keyword search returns videos across many creators, sorted by published_at (newest first) unless you set sort_by (relevance, most_liked, newest). Use published_within (past_24_hours, this_week, this_month, last_3_months, last_6_months) or after_datetime / before_datetime for time windows, and parallel_search_slices (1–4) to lift the result ceiling (~115–140 items per slice) — most useful on searches without a date window.

With the SDK

Python pages through further results with client.get_tiktok_search(task_id, cursor=...), exactly like the profile example. The JavaScript call already returns every result.

With raw HTTP

2. Poll, paginate, and read usage

The polling flow is identical to the profile scrape — just swap the path to /tiktok/search/{task_id} and read data.results instead of data.videos. Pass include_usage=true once the task is completed to see what was billed.
Don’t pass include_usage on the submit (POST) call — it’s ignored because billing happens after the 202 response. Pass it on the polling GET, and only expect a usage block once task_status=completed (failed tasks have all charges refunded).

Next Steps