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": { ... } }

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

captapi-0.2.0.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

captapi-0.2.0-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

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

Hashes for captapi-0.2.0.tar.gz
Algorithm Hash digest
SHA256 71f3623d42544ebdddb2b1874844f76178f39d3882c507a8424df7449a27a860
MD5 8831c528aee05634813a095a658342c5
BLAKE2b-256 250088a1b24c5a646324ae34d924f8c81d09123dfc829116b0a72f25ed0656ce

See more details on using hashes here.

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

Hashes for captapi-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eaf4a43c29325934a39b168678733d5e412a1776b639148890ef21a3e04b722b
MD5 4a1dbfdb33f773c957911d8d3f58c552
BLAKE2b-256 b660f7e3f7e24e4df0b3f8853e550387158305ee9b0bf8e471ce0948e118425f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page