TikTok Scraping API Guide 2026: Python, Node and cURL

Last Updated on September 24, 2026
by InsightSocial Team
10 min read
Follow:
T

This guide is for people who write code. If you just want a spreadsheet of a creator's videos, you don't need any of this: our TikTok profile scraping walkthrough uses the free Chrome extension and takes two minutes, and the TikTok scraper page covers everything else it can export.

If you're building something (a creator database, a brand monitor, a trend dashboard, an AI agent that needs TikTok context), read on. By the end you'll have working code for every common TikTok read, a pagination loop you can reuse, and a way to price a job before you run it.

Why not just use TikTok's official API?

Because for most developers it isn't an option. TikTok offers two relevant products, and neither fits a commercial "read public data" use case:

  • The Research API is limited to qualifying academic and non-profit researchers in specific regions, and TikTok's own FAQ says commercial users are not eligible. Approved projects get a daily quota (1,000 requests per day on the standard endpoints, as of September 2026).
  • The Display API only reads the account of a user who has signed in with TikTok and granted your app permission. It cannot look up an arbitrary public creator.

So if you need to read public accounts you don't control, you either run your own scraper or call a third-party API. Running your own means headless browsers, rotating residential proxies, request signing that TikTok changes without notice, and a parser you'll rewrite every few months. We compare the API options in Best TikTok data APIs for developers. This post shows the InsightSocial route.

What do you need before the first call?

One key and nothing else. Sign in, open the API section of the portal, and your first key is created automatically. Keys start with isk_live_ and are shown once, so put it in an environment variable:

export INSIGHTSOCIAL_API_KEY="isk_live_..."

Every request is a GET to https://api.insightsocial.app/v1/... with an x-api-key header. There's no OAuth dance and no per-platform setup. The full walkthrough is in the quickstart.

You also get your first 10 calls free (any call priced at 200 credits or less), and the free plan includes 500 credits a month. That's enough to run every example in this post.

How do you scrape a TikTok profile?

GET /v1/tiktok/profile takes a handle (no @) or a numeric user_id and costs 20 credits.

curl "https://api.insightsocial.app/v1/tiktok/profile?handle=nasa" \
  -H "x-api-key: $INSIGHTSOCIAL_API_KEY"

The payload sits under data.author: display name, bio, follower count, likes, verification and user id. Store the user_id. It survives username changes, and the docs note it gives faster responses.

If you want the profile plus recent performance in one shot, GET /v1/tiktok/profile/full (100 credits) returns the profile, its latest videos, and computed stats such as engagement rate by views and by followers, posting cadence and the top post. For a creator-vetting tool, that one call often replaces three.

How do you get a creator's videos?

GET /v1/tiktok/profile/videos returns a page of recent public videos with caption, views, likes, comments, shares and a thumbnail. It's metered at 20–100 credits per page, depending on how much the call reads.

Here's a Python helper we'll reuse for the rest of the post:

import os
import requests

BASE = "https://api.insightsocial.app/v1"
HEADERS = {"x-api-key": os.environ["INSIGHTSOCIAL_API_KEY"]}


def get(path, **params):
    body = requests.get(f"{BASE}/{path}", params=params, headers=HEADERS, timeout=120).json()
    if not body["success"]:
        raise RuntimeError(f'{body["error"]["type"]}: {body["error"]["message"]}')
    return body


page = get("tiktok/profile/videos", handle="nasa")
for item in page["data"]["items"]:
    post = item["post"]
    views = (post.get("engagement") or {}).get("views")
    print(views, post["url"])
print("cost:", page["credits_used"], "left:", page["credits_remaining"])

Every post comes back in the same unified post shape regardless of platform: content.text for the caption, engagement.views/likes/comments/shares/saves, published_at as ISO 8601. TikTok extras live under ext, including ext.music_id (feed it to /v1/tiktok/song/videos) and ext.region.

For a single video you already have a link to, GET /v1/tiktok/post?url=... (20 credits) returns it in full, including any on-screen text the creator typed with TikTok's text tool.

How does pagination work?

Every list endpoint uses the same rule: send pagination.next_cursor back as the cursor parameter, unchanged, and stop when pagination.has_more is false. Cursors are opaque strings starting with is2.. Don't decode or edit them. Details are on the pagination page.

In Node:

const BASE = "https://api.insightsocial.app/v1";

async function* paginate(path, params, maxPages = 5) {
  let cursor = null;
  for (let n = 0; n < maxPages; n++) {
    const url = new URL(`${BASE}/${path}`);
    for (const [k, v] of Object.entries(params)) url.searchParams.set(k, v);
    if (cursor) url.searchParams.set("cursor", cursor);

    const res = await fetch(url, {
      headers: { "x-api-key": process.env.INSIGHTSOCIAL_API_KEY },
    });
    const body = await res.json();
    if (!body.success) throw new Error(`${body.error.type}: ${body.request_id}`);

    yield* body.data.items;
    if (!body.pagination?.has_more) return;
    cursor = body.pagination.next_cursor;
  }
}

for await (const item of paginate("tiktok/profile/videos", { handle: "nasa" }, 3)) {
  console.log(item.post.engagement?.views, item.post.url);
}

Note the maxPages cap. Every page is billed as its own call, so an uncapped walk of a prolific creator can cost more than you meant to spend.

For a daily poll, profile/videos also takes since (a date or ISO timestamp) and stop_at_id (the newest video you already hold). The walk ends as soon as it reaches known territory, so a creator who posted once yesterday costs you one page, not ten.

How do you scrape TikTok comments and replies?

GET /v1/tiktok/post/comments?url=... returns a page of comments with the commenter's username, text, like count, reply count and timestamp, metered at 20–140 credits per page. Add sort=recent for newest first, and scan_pages (1 to 3) to read several pages and drop duplicates in one request.

comments = get(
    "tiktok/post/comments",
    url="https://www.tiktok.com/@nasa/video/<video_id>",
    sort="recent",
)
for item in comments["data"]["items"]:
    c = item.get("comment") or {}
    print((c.get("engagement") or {}).get("likes"), c.get("text"))

Rows also carry free computed.labels judgments, so you get a sentiment read on each comment without calling a model yourself. Replies to a specific comment come from GET /v1/tiktok/video/comment/replies with comment_id and the video url.

How do you search TikTok by keyword or hashtag?

Four search endpoints cover most discovery work:

EndpointFindsCredits
/v1/tiktok/search/topVideos TikTok ranks highest for a keyword20
/v1/tiktok/searchVideos for a keyword, with date and sort filters20–840
/v1/tiktok/search/hashtagVideos under a hashtag20–100
/v1/tiktok/search/usersAccounts matching a term20–2,000

The video searches accept filters that run on our side: min_views, max_age_days and sort_rows=views, plus country on /search and /search/top (keep videos registered to, say, US,GB; /search/hashtag takes region instead). They also take max_pages (1 to 5), which walks several pages in one request and uses only one slot of your rate limit.

curl -G "https://api.insightsocial.app/v1/tiktok/search/hashtag" \
  --data-urlencode "hashtag=skincare" \
  --data-urlencode "min_views=100000" \
  --data-urlencode "max_pages=2" \
  -H "x-api-key: $INSIGHTSOCIAL_API_KEY"

With max_pages=2 on a 20–100 credit endpoint, the most that call can cost is 200 credits. The ceiling is always the listed maximum times max_pages.

Can you get a TikTok video's transcript?

Yes. GET /v1/tiktok/post/transcript?url=... returns the spoken text as a single string in data.transcript, for 200 credits. It reads the video's captions, and use_ai_as_fallback=true switches to AI transcription when there are none. Pass language=es (or another two-letter code) to pick a caption track.

curl -G "https://api.insightsocial.app/v1/tiktok/post/transcript" \
  --data-urlencode "url=https://www.tiktok.com/@nasa/video/<video_id>" \
  --data-urlencode "use_ai_as_fallback=true" \
  -H "x-api-key: $INSIGHTSOCIAL_API_KEY"

If the text you care about is burned into the video rather than spoken, GET /v1/tiktok/video/screen-text (100 credits) returns native text stickers plus OCR of the cover frame. Our video transcription recipe covers the same idea across platforms.

What does a real TikTok job cost?

Say you're vetting 10 creators for an influencer campaign. For each one you want the profile, one page of recent videos, the comments on their three best videos, and a transcript of their top video so you can check how they talk about sponsors.

StepCallsCredits per callCredits
Profiles1020200
Recent videos (1 page each)1020–100200–1,000
Comments (1 page, top 3 videos each)3020–140600–4,200
Transcripts (top video each)102002,000
Total603,000–7,400

Metered endpoints are billed on what the call actually read, so the real number lands somewhere in that range. Before the call runs we hold the ceiling against your balance, then settle the actual and release the rest. You never pay more than the ceiling.

On the Pro plan ($9.99/month for 10,000 credits), the worst case for that job is about three-quarters of a month's credits. On the free plan's 500 credits you could run the profiles and a few video pages. A few things make it cheaper in practice:

  • Failed or empty calls cost 0. A deleted video or a typo'd handle is free.
  • Repeats are free inside a window. Re-run the exact same profile call within 24 hours, or a list call within 6 hours, and it's charge_reason: "owned" at 0 credits. Search windows are 1 hour.
  • Shared-cache hits cost 5 credits. If someone recently requested the same public data, you get it for 5 instead of the full price.
  • dry_run=1 on supported endpoints returns an estimate in data.estimate without charging anything.

Every endpoint's price is on the TikTok platform page and the full endpoint pricing table. GET /v1/endpoints?platform=tiktok returns the same catalogue as JSON, needs no key, and costs nothing, which makes it the right thing to hand an AI coding agent before it writes your integration.

What are the rate limits?

Each key gets 60 requests per minute and 10 in flight at once. Over either limit you get a 429 with a Retry-After header, and a rejected request is never charged. On a 429 or 503, wait and retry the same cursor. Don't skip ahead past a page you didn't read. If one key isn't enough, you can create up to 25 on an account; they share one credit balance. See rate limits.

Add an Idempotency-Key header with a fresh UUID per logical request. A retry after a timeout then comes back as a replay at 0 credits instead of a second charge.

FAQ

Reading publicly visible data is generally treated differently from accessing private accounts or bypassing a login, but the rules depend on your jurisdiction and what you do with the data, especially personal data under laws like GDPR. Don't collect more personal data than you need, and get legal advice for anything sensitive.

Do I need a TikTok account or TikTok's approval?

No. You need an InsightSocial API key. You don't log in to TikTok, connect an account, or apply to TikTok for access.

Which language should I use?

Any language that can send an HTTP GET with a header. The examples here are Python, Node and cURL because they cover most teams, but there's no SDK to install.

How do I get all of a creator's videos?

Walk /v1/tiktok/profile/videos with the cursor loop above until has_more is false. For recurring jobs, pass since or stop_at_id so you only pay for pages with new videos.

Can I use the same key for other platforms?

Yes. The same key and the same credit balance cover Instagram, YouTube, X, Facebook, LinkedIn, Threads, Reddit and Pinterest, and posts come back in the same shape on every platform. See the social media API overview.

How do I start for free?

Create an account and get a key. Your first 10 calls (priced 200 credits or less) are free, and the free plan adds 500 credits every month. Upgrade on the pricing page when you need more.

#api#tiktok#developers#python#node#scraping