๐ŸŽต TikTok MPP API

April 1, 2026 ยท View on GitHub

A pay-per-request TikTok scraper API powered by the Machine Payments Protocol (MPP) and Apify.

AI agents and clients pay in Tempo/PathUSD stablecoins on each request โ€” no subscriptions, no API keys.


Endpoints

EndpointPriceDescription
GET /healthFreeService info & endpoint list
GET /api/tiktok/user$0.05Scrape user profile + recent videos
GET /api/tiktok/hashtag$0.10Scrape posts under a hashtag
GET /api/tiktok/video$0.02Single video metadata
GET /api/tiktok/search$0.05Search TikTok by keyword

Query params

# User scrape
GET /api/tiktok/user?handle=@charlidamelio&limit=10

# Hashtag scrape
GET /api/tiktok/hashtag?tag=fyp&limit=20

# Single video
GET /api/tiktok/video?url=https://www.tiktok.com/@user/video/123456789

# Search
GET /api/tiktok/search?q=funny+cats&limit=10

How MPP works

  1. Client makes a normal HTTP request
  2. Server responds with 402 Payment Required + payment instructions
  3. Client pays with Tempo/PathUSD (stablecoin)
  4. Client retries with Authorization header containing payment proof
  5. Server verifies payment โ†’ returns TikTok data + receipt

Setup

1. Install deps

bun install

2. Configure environment

cp .env.example .env

Edit .env:

APIFY_TOKEN=apify_api_your_token_here
RECIPIENT_ADDRESS=0xYourWalletAddress
PORT=3000
  • APIFY_TOKEN โ€” get at apify.com
  • RECIPIENT_ADDRESS โ€” your EVM wallet address for receiving payments

3. Run

# Development (hot reload)
bun run dev

# Production
bun run start

Tech stack

LayerTool
RuntimeBun
FrameworkHono
Paymentsmppx โ€” MPP TypeScript SDK
StablecoinTempo PathUSD (testnet โ†’ Base mainnet)
ScraperApify TikTok Scraper

Going to mainnet

In src/index.ts, update:

testnet: false,

And update RECIPIENT_ADDRESS in .env to your mainnet wallet.


License

MIT