Migrate from Apify TikTok Scrapers to Synchronous <1s REST API
Eliminate 15–45 second Actor container startups, dataset polling webhooks, and platform compute surcharges. Query public TikTok profiles, search feeds, 1080p unwatermarked MP4s, comments, followers, and Creative Center ads in a single synchronous HTTP request.
$0.20 / 1K Videos · $0.10 / 1K Comments · $0.10 / 1K Followers · One-time packs from $9 (never expire)
Replace Async Actor Runs + Dataset Polling with One HTTP GET
# ❌ BEFORE: Async Apify Container Run + Compute Units + Dataset Polling (15–45s)
# from apify_client import ApifyClient
# client = ApifyClient(APIFY_TOKEN)
# run = client.actor("clockworks/tiktok-scraper").call(
# run_input={"profiles": ["tiktok"], "resultsPerPage": 30}
# )
# items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
# ✅ AFTER: Synchronous <1s HTTP GET via TikTokAPI.io ($0.20 / 1K videos, 0 cold starts)
import os
import requests
resp = requests.get(
"https://api.tiktokapi.io/v1/user/posts",
params={"unique_id": "tiktok", "count": 30, "cursor": 0},
headers={"x-api-key": os.environ["TIKTOK_API_KEY"]},
timeout=15,
)
body = resp.json()
videos = body["data"]["videos"] # Ready in ~650ms — no polling loop needed
next_cursor = body["data"]["cursor"] # Deterministic cursor paginationWhy Engineering Teams Switch from Async Actors to Direct REST
Batch Actor containers work well for manual CSV exports, but introduce latency, webhook complexity, and compute overhead when embedded inside production applications or AI agent toolchains:
| Dimension | Async Apify Scraper Actors | TikTokAPI.io Direct REST Gateway |
|---|---|---|
| Response Latency | 15s – 45s container cold start + dataset polling | <1s synchronous JSON response (0 cold starts) |
| Video Feed Cost (per 1,000) | $0.70 – $2.50+ (PPR fee + Compute Units + proxy surcharges) | $0.20 base ($0.08 – $0.115 effective on Pro/Business) |
| Comments & Followers Cost | $0.50 – $2.00+ / 1,000 items + memory compute billing | $0.10 / 1,000 items ($0.06 effective with bonus) |
| Failed / Empty Run Billing | Actor startup & RAM compute billed even on 0-result runs | 0 Credits charged on 404, empty pages, or upstream errors |
| Edge & AI Agent Compatibility | Requires webhook callbacks or long-polling timeouts | Single fetch() + Remote MCP Server (mcp.tiktokapi.io/v1/mcp) |
Translate Apify Actor Input JSON → Synchronous REST Call
Select an Actor template or paste your existing input.json payload to generate drop-in Python, TypeScript, and cURL code.
import os
import requests
# Replaces async Apify client.actor(...).call() + dataset.iterate_items()
# Returns structured JSON synchronously in <1 second (zero container cold start)
resp = requests.get(
"https://api.tiktokapi.io/v1/user/posts",
params={
"unique_id": "tiktok",
"count": "30",
"cursor": "0"
},
headers={"x-api-key": os.environ["TIKTOK_API_KEY"]},
timeout=15,
)
resp.raise_for_status()
payload = resp.json()
assert payload["code"] == 0, payload.get("msg")
print(payload["data"])Complete Apify Actor → TikTokAPI.io Endpoint Mapping Table
Every asynchronous dataset job maps cleanly to a deterministic, paginated HTTP GET endpoint. Click any row to load its sample schema into the converter above.
| Apify Scraper Archetype | Actor Input Fields | Direct REST Endpoint | Direct Unit Rate |
|---|---|---|---|
Profile Posts Scraper / clockworks/tiktok-scraper (profiles) tiktok-profile-posts-scraper | usernames / profiles, maxPostsPerProfile / resultsPerPage | GET /v1/user/posts unique_id={handle}&count=33&cursor=0 | $0.20 / 1,000 videos (2 Credits / video) |
Keyword Video Search Scraper tiktok-search-scraper | keywords / searchQueries, region, sortType, publishTime, maxResultsPerKeyword | GET /v1/video/search keywords={query}®ion=US&sort_type=0&publish_time=0&count=30&cursor=0 | $0.20 / 1,000 videos (2 Credits / video) |
Comments & Nested Replies Scraper tiktok-comments-scraper | videoUrls / postURLs, maxCommentsPerVideo, includeReplies | GET /v1/comment/list (+ /v1/comment/reply) url={video_url_or_id}&count=50&cursor=0 | $0.10 / 1,000 comments (1 Credit / comment) |
1080p HD Video Downloader & Metadata Parser tiktok-video-downloader-hd | videoUrls / postURLs, hd | GET /v1/video/detail url={video_url_or_id}&hd=1 | $1.00 / 1,000 lookups (10 Credits / call) |
Creator Followers & Following Graph Scraper tiktok-followers-following-scraper | usernames, listType ('followers' | 'following'), maxUsersPerAccount | GET /v1/user/followers & GET /v1/user/following user_id={uid}&count=200&cursor=0 (resolve handle via /v1/user/info) | $0.10 / 1,000 users (1 Credit / user) |
Hashtag / Challenge Feed Scraper tiktok-hashtag-scraper | hashtags, maxVideosPerHashtag | GET /v1/challenge/info -> GET /v1/challenge/posts challenge_name={tag} -> challenge_id={cid}&count=30&cursor=0 | $0.20 / 1,000 videos (2 Credits / video) |
Sound / Original Audio Videos Scraper tiktok-sound-music-scraper | musicUrls, maxVideosPerSound | GET /v1/music/info & GET /v1/music/posts music_id={id_or_url}&count=30&cursor=0 | $0.20 / 1,000 videos (2 Credits / video) |
Regional Trending Feed Scraper tiktok-trending-feed-scraper | regions, maxVideosPerRegion | GET /v1/feed/list region=US&count=20 | $0.20 / 1,000 videos (2 Credits / video) |
Creator Discovery & Bio Email Leads Scraper tiktok-user-search-scraper | keywords, followerCount, profileType | GET /v1/user/search (+ /v1/user/info for bio & email) keywords={niche}&count=30&cursor=0 | $0.10 / 1,000 creators (1 Credit / user) |
Creative Center Commercial Ads Library Scraper tiktok-ads-library-scraper | keyword, countryCode, period (7|30|180), orderBy, includeAdDetails | GET /v1/ads/top/ads (+ /v1/ads/top/ads/detail) keyword={kw}&country_code=US&period=30&order_by=impression&page=1&limit=20 | $1.00 / 1,000 ads (10 Credits / ad) |
Migration FAQ
- Why switch from asynchronous Apify TikTok Actors to a synchronous REST API?
- Apify Actors spin up a container per run (15–45s startup overhead), write results into an asynchronous dataset, and bill platform compute units plus pay-per-result fees ($0.70–$2.50+ per 1,000 items). TikTokAPI.io responds synchronously over standard HTTP GET in under 1 second at $0.20 per 1,000 videos and $0.10 per 1,000 comments or followers — ideal for user-facing SaaS apps, AI agents, serverless functions, and real-time webhooks.
- How do I replace ApifyClient().actor(...).call() and dataset.iterate_items() in Python or Node.js?
- Remove the apify-client SDK dependency and call GET https://api.tiktokapi.io/v1/... directly with an x-api-key header. Instead of polling run status and downloading dataset items, each HTTP response immediately returns structured JSON with data, hasMore, and cursor for deterministic pagination.
- Do I need residential proxies, browser cookies, or TikTok OAuth tokens?
- No. TikTokAPI.io manages signature generation and residential routing at the gateway layer. You can call all 16 endpoints directly from AWS Lambda, GCP Cloud Run, Cloudflare Workers, Vercel, or Hetzner.
- What happens if a lookup returns 0 results, 404, or an upstream error?
- Failed lookups, private/deleted resources, 0-item pages, and non-200 responses cost 0 Credits. You only pay for valid data returned (code === 0).
- Can I test all endpoints for free before migrating production workloads?
- Yes. Every new account receives 10,500 free Credits ($1.05 — enough for up to 5,250 searched/profile videos or 10,500 comments/followers) immediately on signup with no credit card required, plus one-time Pay-As-You-Go packs starting at $9 that never expire.
Instant Production Sandbox
Test Your Migration with 10,500 Free Credits ($1.05)
Instant API key on signup · No credit card required · Pay-As-You-Go packs from $9 (Stripe Card, Apple Pay, or 0%-fee Crypto).