TikTok Scraper - Search, User Posts & Stories avatar

TikTok Scraper - Search, User Posts & Stories

Pricing

from $0.00005 / actor start

Go to Apify Store
TikTok Scraper - Search, User Posts & Stories

TikTok Scraper - Search, User Posts & Stories

Scrape TikTok videos by keyword search, or fetch all posts/stories from one or more usernames. No login required for search and public posts.

Pricing

from $0.00005 / actor start

Rating

0.0

(0)

Developer

Muhamad Wildan

Muhamad Wildan

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

0

Monthly active users

a month ago

Last modified

Share

TikTok Scraper (Search, User Posts & User Stories)

Scrape TikTok videos by keyword/hashtag search, or pull every post/story from one or more usernames — no TikTok login required for search and public posts.

This Actor is an Apify wrapper around the tiktok-end-to-end-crawler engine: the same async TikTokAPI client (pagination, retries, rate-limiting) that already powers the original CLI tool / Kafka+Elasticsearch pipeline, just re-pointed at the Apify dataset and Apify Proxy instead of Kafka/ES/argparse.

Input

FieldTypeNotes
operationsearch | userPosts | userStoryWhat to scrape
searchQuerystringRequired for search
usernamesarray of stringsRequired for userPosts / userStory. Multiple usernames run in one job.
resultsPerPageint (1-50)Items requested per page, default 12
maxPagesPerQueryintPages to paginate per keyword/username, default 1
maxItemsintHard stop for the whole run, default 50 (0 = unlimited)
hdboolRequest HD video links, default true
proxyConfigurationobjectApify Proxy — recommended, the upstream API rate-limits by IP
cookiesstring (secret)Only needed if userPosts/userStory return HTTP 403
rateLimitRpsintRequests/second cap for this run, default 5

Output (one dataset row per video)

Each row is the full TikTokPost model (id, title, description, author, music, video, stats, hashtags) plus a few flattened convenience fields: authorUsername, playUrlNoWatermark, playUrlWatermark, diggCount, playCount, commentCount, shareCount, operation, queryValue, scrapedAt.

What changed vs. the original CLI project

  • Dropped: Kafka/Elasticsearch output drivers, the Controllers/Input/ Output abstraction layer, env/YAML settings loading. Apify's dataset + input schema already cover that role, so keeping them would just add unused dependencies (slower builds = more compute cost on every run).
  • Kept as-is: TikTokAPI (tiktok_api.py) and the Pydantic schemas (schemas.py) — same pagination/retry/backoff logic, same field aliases, same model_dump(by_alias=True, exclude_none=True) shape. KafkaEvent was renamed ScrapeEvent since there's no Kafka here.
  • Added: Apify Proxy wiring (proxy_url was already a config field in the original CrawlerSettings — it just wasn't connected to anything before), and PPE charging via Actor.push_data(item, charged_event_name=...).

Monetizing this Actor

  1. Push this folder to a GitHub repo (or use apify push from the Apify CLI).
  2. In Apify Console → Actor → Monetization, set up Pay per event (PPE) and define an event named post-scraped (matches CHARGED_EVENT_NAME in src/main.py) — e.g. price it somewhere in the $1–10 per 1,000 results range, in line with typical Store pricing.
  3. You don't need to touch the code further — Actor.push_data(..., charged_event_name="post-scraped") only actually charges once that event exists in Console; until then it's a no-op.

Possible follow-ups (not built into v1, to keep the build light)

  • Optional second output: also forward each item to your own Kafka topic or Elasticsearch index (you already have working drivers for both in the original project's helpers/output/driver/) — could be pitched as an "enterprise" / advanced-input toggle on top of the free dataset output.
  • A 4th postDetail operation that re-uses fetch_post() to grab a single video by ID/URL.