๐ต 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
| Endpoint | Price | Description |
|---|---|---|
GET /health | Free | Service info & endpoint list |
GET /api/tiktok/user | $0.05 | Scrape user profile + recent videos |
GET /api/tiktok/hashtag | $0.10 | Scrape posts under a hashtag |
GET /api/tiktok/video | $0.02 | Single video metadata |
GET /api/tiktok/search | $0.05 | Search 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
- Client makes a normal HTTP request
- Server responds with 402 Payment Required + payment instructions
- Client pays with Tempo/PathUSD (stablecoin)
- Client retries with
Authorizationheader containing payment proof - 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
| Layer | Tool |
|---|---|
| Runtime | Bun |
| Framework | Hono |
| Payments | mppx โ MPP TypeScript SDK |
| Stablecoin | Tempo PathUSD (testnet โ Base mainnet) |
| Scraper | Apify TikTok Scraper |
Going to mainnet
In src/index.ts, update:
testnet: false,
And update RECIPIENT_ADDRESS in .env to your mainnet wallet.
License
MIT