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
Metadata
Release files for captapi 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| captapi-0.2.0.tar.gz | 34.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| captapi-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 68.7 kB
Release files / captapi-0.2.0.tar.gz
| Download URL | captapi-0.2.0.tar.gz |
|---|---|
| Size | 34.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71f3623d42544ebdddb2b1874844f76178f39d3882c507a8424df7449a27a860
|
|
BLAKE2b-256 checksum How to use checksums |
250088a1b24c5a646324ae34d924f8c81d09123dfc829116b0a72f25ed0656ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / captapi-0.2.0-py3-none-any.whl
| Download URL | captapi-0.2.0-py3-none-any.whl |
|---|---|
| Size | 34.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eaf4a43c29325934a39b168678733d5e412a1776b639148890ef21a3e04b722b
|
|
BLAKE2b-256 checksum How to use checksums |
b660f7e3f7e24e4df0b3f8853e550387158305ee9b0bf8e471ce0948e118425f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|