Python SDK for the Trawl unified content API
Project description
Trawl Python SDK
The official Python SDK for the Trawl API — extract transcripts from YouTube, podcasts, TikTok, earnings calls, SEC filings, news, and academic papers.
Install
pip install trawl
Quick Start
from trawl import TrawlClient
client = TrawlClient(api_key="trawl_your_key")
# Search YouTube
results = client.search.youtube("machine learning tutorial", max_results=5)
for video in results.results:
print(f"{video.title} — {video.channel}")
# Extract a transcript
transcript = client.transcripts.extract("https://youtube.com/watch?v=dQw4w9WgXcQ")
print(f"{len(transcript.segments)} segments extracted")
# Preview without auth (free)
preview = client.transcripts.preview("https://youtube.com/watch?v=dQw4w9WgXcQ")
# Bulk download as ZIP
zip_bytes = client.bulk.download(["dQw4w9WgXcQ", "9bZkp7q19f0"], format="jsonl")
All Resources
client = TrawlClient(api_key="trawl_your_key")
# YouTube
client.search.youtube(query, max_results=10)
client.transcripts.extract(url, language=None)
client.transcripts.preview(url) # No auth needed
client.transcripts.download(id, format="txt")
client.bulk.download(video_ids, format="txt") # No auth needed
# Podcasts
client.search.podcasts(query, max_results=20)
client.podcasts.episodes(podcast_id)
client.podcasts.transcribe(audio_url)
# Earnings Calls
client.earnings.search("AAPL")
client.earnings.get_transcript("AAPL", 2026, 1)
client.earnings.get_chunks("AAPL", 2026, 1)
# SEC Filings
client.filings.search("AAPL", form_type="10-K")
# News (GDELT)
client.news.search("Federal Reserve", language="en")
client.news.get_article_text("https://example.com/article")
# Academic Papers
client.papers.search("transformer architecture")
client.papers.extract(arxiv_id="2301.08745")
# AI Analysis
client.ai.summarize(transcript_id)
client.ai.topics(transcript_id)
client.ai.entities(transcript_id)
client.ai.preview_summarize("Raw text to summarize") # No auth
# Jobs
client.jobs.get(job_id)
client.jobs.list()
Error Handling
from trawl.exceptions import (
TrawlError,
AuthenticationError, # 401
NotFoundError, # 404
RateLimitError, # 429
ValidationError, # 422
)
try:
transcript = client.transcripts.extract("invalid-url")
except ValidationError as e:
print(f"Bad request: {e}")
except RateLimitError as e:
print(f"Rate limited. Retry after {e.retry_after}s")
except AuthenticationError:
print("Invalid API key")
Context Manager
with TrawlClient(api_key="trawl_your_key") as client:
results = client.search.youtube("python")
# client.close() called automatically
Requirements
- Python 3.10+
- httpx
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trawl_sdk-0.1.4.tar.gz.
File metadata
- Download URL: trawl_sdk-0.1.4.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf983bdc9a389282f03d441fe2be29dd8dcf7c9d4d9c4a95a76d7c6540eb9ba2
|
|
| MD5 |
de5f63a04542d9ed4fc3187644b49b88
|
|
| BLAKE2b-256 |
b53e4ed4ecbaeda873347279c2c88d06aa1300d6b27c0dca35706efccbff5be0
|
Provenance
The following attestation bundles were made for trawl_sdk-0.1.4.tar.gz:
Publisher:
release.yml on d3vind/youtube-transcript
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trawl_sdk-0.1.4.tar.gz -
Subject digest:
bf983bdc9a389282f03d441fe2be29dd8dcf7c9d4d9c4a95a76d7c6540eb9ba2 - Sigstore transparency entry: 1247541852
- Sigstore integration time:
-
Permalink:
d3vind/youtube-transcript@8b887b03958d96f237f118d52e16fa913f005aa1 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/d3vind
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8b887b03958d96f237f118d52e16fa913f005aa1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file trawl_sdk-0.1.4-py3-none-any.whl.
File metadata
- Download URL: trawl_sdk-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9151ed7da98e7a9289e3fd0bb746100bb3b6d40a4c611c6f4e6e5cf16770e057
|
|
| MD5 |
a6e5c3a11f4f0169de669cc9ff110ce1
|
|
| BLAKE2b-256 |
d9c4c8425843fb487cec2728fa543191fcfa63cfeb4fb343a9764fef6163ffb6
|
Provenance
The following attestation bundles were made for trawl_sdk-0.1.4-py3-none-any.whl:
Publisher:
release.yml on d3vind/youtube-transcript
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trawl_sdk-0.1.4-py3-none-any.whl -
Subject digest:
9151ed7da98e7a9289e3fd0bb746100bb3b6d40a4c611c6f4e6e5cf16770e057 - Sigstore transparency entry: 1247541916
- Sigstore integration time:
-
Permalink:
d3vind/youtube-transcript@8b887b03958d96f237f118d52e16fa913f005aa1 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/d3vind
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8b887b03958d96f237f118d52e16fa913f005aa1 -
Trigger Event:
push
-
Statement type: