captapi
Official typed Python SDK for the Captapi social media API — 178 endpoints across 32 platforms (YouTube, TikTok, Instagram, Facebook, X/Twitter, Reddit, Threads, Bluesky, Pinterest, LinkedIn, Twitch, Spotify, SoundCloud, GitHub, and more).
- Sync and async clients (
Captapi/AsyncCaptapi), built onhttpx - Typed, documented method for every endpoint — great autocomplete for humans and AI coding agents
- Errors always raise
CaptapiErrorwith status code and detail — no silent failures - One bounded retry on 502/503 (skipped when the API says the failure is persistent or already cached)
Install
pip install captapi
Quick start
from captapi import Captapi
client = Captapi(api_key="YOUR_KEY") # or set CAPTAPI_API_KEY
transcript = client.youtube.transcript(url="https://youtube.com/watch?v=dQw4w9WgXcQ")
print(transcript["data"])
profile = client.tiktok.channel_details(url="https://tiktok.com/@nba")
posts = client.reddit.subreddit_posts(url="https://reddit.com/r/programming", limit=25)
ads = client.google_ad_library.company_ads(advertiser="nike.com")
Async
from captapi import AsyncCaptapi
async with AsyncCaptapi() as client:
result = await client.instagram.channel_details(url="https://instagram.com/nba")
Error handling
Every failed request raises — nothing fails silently:
from captapi import Captapi, CaptapiError
try:
client.instagram.channel_details(url="https://instagram.com/whoever")
except CaptapiError as err:
print(err.status_code, err.code, err.detail)
Responses
All methods return the standard Captapi envelope as a dict:
{ "success": true, "data": { ... } }
Links
- Documentation
- Get an API key (100 free credits)
- TypeScript SDK:
npm install @captapi/sdk - MCP server for AI agents:
@captapi/mcp - CLI:
@captapi/cli
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file captapi-0.2.0.tar.gz.
File metadata
- Download URL: captapi-0.2.0.tar.gz
- Upload date:
- Size: 34.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71f3623d42544ebdddb2b1874844f76178f39d3882c507a8424df7449a27a860
|
|
| MD5 |
8831c528aee05634813a095a658342c5
|
|
| BLAKE2b-256 |
250088a1b24c5a646324ae34d924f8c81d09123dfc829116b0a72f25ed0656ce
|
File details
Details for the file captapi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: captapi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 34.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaf4a43c29325934a39b168678733d5e412a1776b639148890ef21a3e04b722b
|
|
| MD5 |
4a1dbfdb33f773c957911d8d3f58c552
|
|
| BLAKE2b-256 |
b660f7e3f7e24e4df0b3f8853e550387158305ee9b0bf8e471ce0948e118425f
|