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.4.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 | Provenance | Actions |
|---|---|---|---|---|
| captapi-0.4.0.tar.gz | 39.4 kB | Without provenance | Details for captapi-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| captapi-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for captapi-0.4.0-py3-none-any.whl |
Total release size: 79.3 kB
Release files / captapi-0.4.0.tar.gz
| Download URL | captapi-0.4.0.tar.gz |
|---|---|
| Size | 39.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
154dca6dc6294a37a0fdc9d5f77b57f07a0bed5ea4c8c7e5ae2bbb3001d66fe5
|
|
BLAKE2b-256 checksum How to use checksums |
9342f21e23a0959b368e7110745081ad0ee28095670f74722385175b437989d0
|
| 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.4.0-py3-none-any.whl
| Download URL | captapi-0.4.0-py3-none-any.whl |
|---|---|
| Size | 39.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0149f0f7518d40901e579c097b25272b641734970d7fd51cd495ce0ddf27599
|
|
BLAKE2b-256 checksum How to use checksums |
b8b1dcfd514a5e5e27f078f55613bafafab01c80b01ad6c3faa608d73de98b9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for captapi 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.