captapi 0.1.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- captapi-0.3.0/.gitignore +75 -0
- captapi-0.3.0/PKG-INFO +91 -0
- captapi-0.3.0/README.md +67 -0
- {captapi-0.1.0 → captapi-0.3.0}/captapi/__init__.py +21 -21
- captapi-0.3.0/captapi/_generated.py +3946 -0
- captapi-0.3.0/captapi/_transport.py +166 -0
- {captapi-0.1.0 → captapi-0.3.0}/pyproject.toml +48 -46
- captapi-0.1.0/.gitignore +0 -40
- captapi-0.1.0/PKG-INFO +0 -0
- captapi-0.1.0/README.md +0 -0
- captapi-0.1.0/captapi/_generated.py +0 -3164
- captapi-0.1.0/captapi/_transport.py +0 -99
captapi-0.3.0/.gitignore
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# =====================================================
|
|
2
|
+
# Secrets / environment
|
|
3
|
+
# =====================================================
|
|
4
|
+
.env
|
|
5
|
+
.env.*
|
|
6
|
+
!.env.example
|
|
7
|
+
*.pem
|
|
8
|
+
|
|
9
|
+
# =====================================================
|
|
10
|
+
# Python (backend)
|
|
11
|
+
# =====================================================
|
|
12
|
+
__pycache__/
|
|
13
|
+
*.py[cod]
|
|
14
|
+
*.egg-info/
|
|
15
|
+
.venv/
|
|
16
|
+
venv/
|
|
17
|
+
env/
|
|
18
|
+
.pytest_cache/
|
|
19
|
+
.mypy_cache/
|
|
20
|
+
.ruff_cache/
|
|
21
|
+
build/
|
|
22
|
+
dist/
|
|
23
|
+
|
|
24
|
+
# =====================================================
|
|
25
|
+
# Node / Next.js (frontend)
|
|
26
|
+
# =====================================================
|
|
27
|
+
node_modules/
|
|
28
|
+
.next/
|
|
29
|
+
out/
|
|
30
|
+
.vercel/
|
|
31
|
+
*.tsbuildinfo
|
|
32
|
+
next-env.d.ts.bak
|
|
33
|
+
|
|
34
|
+
# =====================================================
|
|
35
|
+
# OS / editor
|
|
36
|
+
# =====================================================
|
|
37
|
+
.DS_Store
|
|
38
|
+
Thumbs.db
|
|
39
|
+
*.log
|
|
40
|
+
.commitmsg.tmp
|
|
41
|
+
|
|
42
|
+
# Generated marketing-agent artifacts
|
|
43
|
+
marketing/blog-drafts/
|
|
44
|
+
marketing/instagram-runs/
|
|
45
|
+
|
|
46
|
+
# Local probes / live audits (never publish)
|
|
47
|
+
backend/_probe*.py
|
|
48
|
+
backend/_audit*/
|
|
49
|
+
backend/_live_*
|
|
50
|
+
backend/_tmp*
|
|
51
|
+
backend/_trend*
|
|
52
|
+
backend/scripts/_probe*.py
|
|
53
|
+
backend/scripts/_spike*.py
|
|
54
|
+
**/comprehensive-live-audit*
|
|
55
|
+
**/playground-defaults-*.json
|
|
56
|
+
**/*-live-audit-report.json
|
|
57
|
+
**/*-live-audit-live.jsonl
|
|
58
|
+
scripts/.env
|
|
59
|
+
scripts/_ad_library_ads_groups.py
|
|
60
|
+
|
|
61
|
+
# TikTok mobile-signing device pool (secret device identities)
|
|
62
|
+
backend/secrets/
|
|
63
|
+
**/tiktok_devices*.json
|
|
64
|
+
|
|
65
|
+
# Cursor API-surface sync marker
|
|
66
|
+
.cursor/.api-surface-dirty
|
|
67
|
+
|
|
68
|
+
# Credit-restore audits: customer URLs and response bodies, never committed
|
|
69
|
+
**/restore-candidates*
|
|
70
|
+
**/restore-list*
|
|
71
|
+
**/*-restore-verdicts*
|
|
72
|
+
**/*response-samples*.json
|
|
73
|
+
**/*response-samples*.md
|
|
74
|
+
**/*response_samples*.json
|
|
75
|
+
**/*response_samples*.jsonl
|
captapi-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: captapi
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Official typed Python SDK for the Captapi social media API - 178 endpoints across 32 platforms (YouTube, TikTok, Instagram, Facebook, X, Reddit, Threads, Bluesky, Pinterest, LinkedIn, Twitch, Spotify, and more).
|
|
5
|
+
Project-URL: Homepage, https://captapi.com
|
|
6
|
+
Project-URL: Documentation, https://captapi.com/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/CDCStream/captapi
|
|
8
|
+
Author-email: Captapi <support@captapi.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
Keywords: api-client,captapi,instagram,reddit,scraping,sdk,social-media,tiktok,transcript,twitter,youtube
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Requires-Dist: httpx>=0.24
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# captapi
|
|
26
|
+
|
|
27
|
+
Official typed Python SDK for the [Captapi](https://captapi.com) 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).
|
|
28
|
+
|
|
29
|
+
- Sync **and** async clients (`Captapi` / `AsyncCaptapi`), built on `httpx`
|
|
30
|
+
- Typed, documented method for every endpoint — great autocomplete for humans and AI coding agents
|
|
31
|
+
- Errors always raise `CaptapiError` with status code and detail — no silent failures
|
|
32
|
+
- One bounded retry on 502/503 (skipped when the API says the failure is persistent or already cached)
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install captapi
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from captapi import Captapi
|
|
44
|
+
|
|
45
|
+
client = Captapi(api_key="YOUR_KEY") # or set CAPTAPI_API_KEY
|
|
46
|
+
|
|
47
|
+
transcript = client.youtube.transcript(url="https://youtube.com/watch?v=dQw4w9WgXcQ")
|
|
48
|
+
print(transcript["data"])
|
|
49
|
+
|
|
50
|
+
profile = client.tiktok.channel_details(url="https://tiktok.com/@nba")
|
|
51
|
+
posts = client.reddit.subreddit_posts(url="https://reddit.com/r/programming", limit=25)
|
|
52
|
+
ads = client.google_ad_library.company_ads(advertiser="nike.com")
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Async
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from captapi import AsyncCaptapi
|
|
59
|
+
|
|
60
|
+
async with AsyncCaptapi() as client:
|
|
61
|
+
result = await client.instagram.channel_details(url="https://instagram.com/nba")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Error handling
|
|
65
|
+
|
|
66
|
+
Every failed request raises — nothing fails silently:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from captapi import Captapi, CaptapiError
|
|
70
|
+
|
|
71
|
+
try:
|
|
72
|
+
client.instagram.channel_details(url="https://instagram.com/whoever")
|
|
73
|
+
except CaptapiError as err:
|
|
74
|
+
print(err.status_code, err.code, err.detail)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Responses
|
|
78
|
+
|
|
79
|
+
All methods return the standard Captapi envelope as a `dict`:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{ "success": true, "data": { ... } }
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Links
|
|
86
|
+
|
|
87
|
+
- [Documentation](https://captapi.com/docs)
|
|
88
|
+
- [Get an API key (100 free credits)](https://captapi.com/dashboard/api-keys)
|
|
89
|
+
- TypeScript SDK: [`npm install @captapi/sdk`](https://www.npmjs.com/package/@captapi/sdk)
|
|
90
|
+
- MCP server for AI agents: [`@captapi/mcp`](https://www.npmjs.com/package/@captapi/mcp)
|
|
91
|
+
- CLI: [`@captapi/cli`](https://www.npmjs.com/package/@captapi/cli)
|
captapi-0.3.0/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# captapi
|
|
2
|
+
|
|
3
|
+
Official typed Python SDK for the [Captapi](https://captapi.com) 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).
|
|
4
|
+
|
|
5
|
+
- Sync **and** async clients (`Captapi` / `AsyncCaptapi`), built on `httpx`
|
|
6
|
+
- Typed, documented method for every endpoint — great autocomplete for humans and AI coding agents
|
|
7
|
+
- Errors always raise `CaptapiError` with status code and detail — no silent failures
|
|
8
|
+
- One bounded retry on 502/503 (skipped when the API says the failure is persistent or already cached)
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install captapi
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Quick start
|
|
17
|
+
|
|
18
|
+
```python
|
|
19
|
+
from captapi import Captapi
|
|
20
|
+
|
|
21
|
+
client = Captapi(api_key="YOUR_KEY") # or set CAPTAPI_API_KEY
|
|
22
|
+
|
|
23
|
+
transcript = client.youtube.transcript(url="https://youtube.com/watch?v=dQw4w9WgXcQ")
|
|
24
|
+
print(transcript["data"])
|
|
25
|
+
|
|
26
|
+
profile = client.tiktok.channel_details(url="https://tiktok.com/@nba")
|
|
27
|
+
posts = client.reddit.subreddit_posts(url="https://reddit.com/r/programming", limit=25)
|
|
28
|
+
ads = client.google_ad_library.company_ads(advertiser="nike.com")
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Async
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from captapi import AsyncCaptapi
|
|
35
|
+
|
|
36
|
+
async with AsyncCaptapi() as client:
|
|
37
|
+
result = await client.instagram.channel_details(url="https://instagram.com/nba")
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Error handling
|
|
41
|
+
|
|
42
|
+
Every failed request raises — nothing fails silently:
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from captapi import Captapi, CaptapiError
|
|
46
|
+
|
|
47
|
+
try:
|
|
48
|
+
client.instagram.channel_details(url="https://instagram.com/whoever")
|
|
49
|
+
except CaptapiError as err:
|
|
50
|
+
print(err.status_code, err.code, err.detail)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Responses
|
|
54
|
+
|
|
55
|
+
All methods return the standard Captapi envelope as a `dict`:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{ "success": true, "data": { ... } }
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Links
|
|
62
|
+
|
|
63
|
+
- [Documentation](https://captapi.com/docs)
|
|
64
|
+
- [Get an API key (100 free credits)](https://captapi.com/dashboard/api-keys)
|
|
65
|
+
- TypeScript SDK: [`npm install @captapi/sdk`](https://www.npmjs.com/package/@captapi/sdk)
|
|
66
|
+
- MCP server for AI agents: [`@captapi/mcp`](https://www.npmjs.com/package/@captapi/mcp)
|
|
67
|
+
- CLI: [`@captapi/cli`](https://www.npmjs.com/package/@captapi/cli)
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"""Official Python SDK for the Captapi social media API.
|
|
2
|
-
|
|
3
|
-
Usage:
|
|
4
|
-
from captapi import Captapi
|
|
5
|
-
|
|
6
|
-
client = Captapi(api_key="YOUR_KEY") # or set CAPTAPI_API_KEY
|
|
7
|
-
result = client.youtube.transcript(url="https://youtube.com/watch?v=...")
|
|
8
|
-
print(result["data"])
|
|
9
|
-
|
|
10
|
-
Async:
|
|
11
|
-
from captapi import AsyncCaptapi
|
|
12
|
-
|
|
13
|
-
async with AsyncCaptapi() as client:
|
|
14
|
-
result = await client.tiktok.profile(url="https://tiktok.com/@user")
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
from ._generated import AsyncCaptapi, Captapi
|
|
18
|
-
from ._transport import DEFAULT_BASE_URL, CaptapiError
|
|
19
|
-
|
|
20
|
-
__version__ = "0.
|
|
21
|
-
__all__ = ["Captapi", "AsyncCaptapi", "CaptapiError", "DEFAULT_BASE_URL", "__version__"]
|
|
1
|
+
"""Official Python SDK for the Captapi social media API.
|
|
2
|
+
|
|
3
|
+
Usage:
|
|
4
|
+
from captapi import Captapi
|
|
5
|
+
|
|
6
|
+
client = Captapi(api_key="YOUR_KEY") # or set CAPTAPI_API_KEY
|
|
7
|
+
result = client.youtube.transcript(url="https://youtube.com/watch?v=...")
|
|
8
|
+
print(result["data"])
|
|
9
|
+
|
|
10
|
+
Async:
|
|
11
|
+
from captapi import AsyncCaptapi
|
|
12
|
+
|
|
13
|
+
async with AsyncCaptapi() as client:
|
|
14
|
+
result = await client.tiktok.profile(url="https://tiktok.com/@user")
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from ._generated import AsyncCaptapi, Captapi
|
|
18
|
+
from ._transport import DEFAULT_BASE_URL, CaptapiError
|
|
19
|
+
|
|
20
|
+
__version__ = "0.3.0"
|
|
21
|
+
__all__ = ["Captapi", "AsyncCaptapi", "CaptapiError", "DEFAULT_BASE_URL", "__version__"]
|