How to Use the TikTok API in Python — Complete Guide

TikTokAPI.store Team · · 2 min read

The official TikTok API requires app approval that can take weeks. This guide shows you how to access TikTok data with Python in under 5 minutes using the TikTokAPI.store unofficial REST API — no approval needed, free plan available.

What you can fetch

  • TikTok video metadata and watermark-free download URLs
  • User profiles, follower counts, and post lists
  • Trending feeds by region
  • Hashtag search results
  • Comments and replies

Step 1 — Get your free API key

Sign up at tiktokapi.store and grab your API key from the dashboard. The free plan gives you 1,000 requests/month — no credit card required.

Step 2 — Install requests

pip install requests

Step 3 — Fetch a TikTok user profile

import requests

API_KEY = "your_api_key_here"
BASE    = "https://api.tiktokapi.store/api/v1"

headers = {"Authorization": f"Bearer {API_KEY}"}

resp = requests.get(f"{BASE}/user/info", headers=headers, params={"unique_id": "charlidamelio"})
data = resp.json()

print(data["data"]["nickname"])       # charli d'amelio
print(data["data"]["follower_count"]) # 153400000

Step 4 — Download a TikTok video without watermark

video_url = "https://www.tiktok.com/@user/video/7123456789"

resp = requests.get(f"{BASE}/video/info", headers=headers, params={"url": video_url})
download_url = resp.json()["data"]["play"]

# Stream the video to disk
with requests.get(download_url, stream=True) as r:
    with open("video.mp4", "wb") as f:
        for chunk in r.iter_content(chunk_size=8192):
            f.write(chunk)

print("Downloaded!")

Step 5 — Get the trending feed for a region

resp = requests.get(f"{BASE}/feed/trending", headers=headers, params={"region": "US", "count": 20})
videos = resp.json()["data"]["videos"]

for v in videos:
    print(v["desc"], "-", v["stats"]["play_count"], "views")

Rate limits and pricing

The free plan allows 10 requests/minute and 1,000 requests/month. For production workloads, the Starter plan ($9/mo) gives you 30 req/min and 10,000 requests/month — still far cheaper than building and maintaining your own TikTok scraper.

Error handling

resp = requests.get(f"{BASE}/user/info", headers=headers, params={"unique_id": "someuser"})

if resp.status_code == 200:
    print(resp.json()["data"])
elif resp.status_code == 401:
    print("Invalid API key")
elif resp.status_code == 429:
    print("Rate limited — slow down requests")
else:
    print(f"Error {resp.status_code}: {resp.text}")

That's it. The TikTok unofficial API works with any Python HTTP library — requests, httpx, aiohttp for async. The same Bearer token pattern works in Node.js, Ruby, Go, or any language that can make HTTP requests.

Start using the TikTok API for free

100 requests/day free. No credit card required. Instant API key.

Get your free API key