Skip to main content

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 on httpx
  • Typed, documented method for every endpoint — great autocomplete for humans and AI coding agents
  • Errors always raise CaptapiError with 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": { ... } }

Metadata

Release files for captapi 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for captapi 0.3.0
File Size Uploaded Provenance Actions
captapi-0.3.0.tar.gz 38.2 kB Without provenance Details for captapi-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for captapi 0.3.0
File Interpreter ABI Platform Actions
captapi-0.3.0-py3-none-any.whl Python 3 none any Details for captapi-0.3.0-py3-none-any.whl

Total release size: 76.9 kB

Release files / captapi-0.3.0.tar.gz

Download URL captapi-0.3.0.tar.gz
Size 38.2 kB
Tags Source
SHA-256 checksum
How to use checksums
64ae6d6b7658f946aef639f4b265318c6fec4fd7bd93d118bc373e8115ed268d
BLAKE2b-256 checksum
How to use checksums
f01314c451b9bb76f0ffa5e4ec52c1e49a3ca78cf17eabce8915b711efdc5f69
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.3.0-py3-none-any.whl

Download URL captapi-0.3.0-py3-none-any.whl
Size 38.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70af10b3c4df789639ecc1f8c43a6f3a04a1f2b3b2e31d7ed58abde5953c97b5
BLAKE2b-256 checksum
How to use checksums
7aacfc92d6ba5037f33372a1874ec07ece1da0a09125305ccae49ff4dfdc5898
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.3.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page