Integrations › Python

Zapi for Python

Call any source from Python: one key, one URL shape, JSON back. No SDK to install.

LanguagePython 3.8+REST
  1. 01
    Install requests

    Any HTTP client works. We use requests here.

    pip install requests
  2. 02
    Set your API key

    Create a free key in the dashboard and keep it out of your code.

    export ZAPI_KEY="zpi_..."
  3. 03
    Call any source

    Every source is a GET on /v1/<category>:<source>/<endpoint>. The answer is JSON.

    import os, requests
    
    r = requests.get(
        "https://api.zapi.ink/v1/social-media:tiktok-scraper/profile",
        params={"username": "tiktok"},
        headers={"x-api-key": os.environ["ZAPI_KEY"]},
        timeout=60,
    )
    r.raise_for_status()
    print(r.json()["data"]["followerCount"])
  4. 04
    Handle limits

    A 429 means you hit your plan’s per-minute limit. Wait a moment and try again.

    import time
    
    if r.status_code == 429:
        # per-minute limit reached: wait, then retry
        time.sleep(5)

The response

200 OK
{
  "project": "social-media:tiktok-scraper:profile",
  "data": {
    "username": "tiktok",
    "nickname": "TikTok",
    "verified": true,
    "followerCount": 92400000,
    "videoCount": 1310
  },
  "timestamp": "2026-12-01T07:00:00.000Z"
}

Questions

Is there a Python SDK?

Not yet. The REST API is small enough that requests or httpx is all you need. JavaScript and TypeScript have zpi-sdk.

Does it work with async code?

Yes. Use httpx.AsyncClient or aiohttp with the same URL and header.

How do I run thousands of requests?

Submit them as one bulk job and download the results when it finishes.

Your first call in a minute.

Free key, every source, and the same JSON shape from anywhere.