Python SDK for the ByCrawl social media data API
Project description
ByCrawl Python SDK
The official Python SDK for the ByCrawl social media data API.
Supports Threads, Facebook, X (Twitter), Instagram, Reddit, LinkedIn, TikTok, YouTube, Dcard, Google Maps, and 104.
Installation
pip install bycrawl
Quick Start
from bycrawl import ByCrawl
client = ByCrawl(api_key="sk_byc_...")
# Get a Threads post
post = client.threads.get_post("DQt-ox3kdE4")
print(post.data.text)
print(post.data.stats.likes)
Platform Examples
Threads
# User profile
user = client.threads.get_user("zuck")
print(f"{user.data.username} — {user.data.follower_count} followers")
# Search posts
results = client.threads.search_posts("AI")
X (Twitter)
user = client.x.get_user("elonmusk")
tweet = client.x.get_post("1234567890")
# Auto-paginate all posts
for post in client.x.iter_user_posts("elonmusk"):
print(post.text)
user = client.instagram.get_user("instagram")
print(user.data.follower_count)
TikTok
video = client.tiktok.get_video("7123456789")
user = client.tiktok.get_user("khaby.lame")
# Browse trending
trending = client.tiktok.get_categories()
sub = client.reddit.get_subreddit("python")
posts = client.reddit.get_subreddit_posts("python", sort="hot")
company = client.linkedin.get_company("google")
jobs = client.linkedin.search_jobs(query="software engineer", location="Taiwan")
# Auto-paginate jobs
for job in client.linkedin.iter_search_jobs(query="data scientist"):
print(job.title, job.location)
YouTube
video = client.youtube.get_video("dQw4w9WgXcQ")
channel = client.youtube.get_channel("@mkbhd")
results = client.youtube.search("machine learning", count=5)
transcript = client.youtube.get_video_transcription("dQw4w9WgXcQ", language="en")
Dcard
forum = client.dcard.get_forum("trending")
posts = client.dcard.get_forum_posts("trending", limit=10, popular=True)
results = client.dcard.search_posts("台大", limit=10)
Google Maps
results = client.gmaps.search("coffee shops in Tokyo", language="en")
place = client.gmaps.get_place("Blue Bottle Coffee Tokyo")
page = client.facebook.get_user("NASA")
posts = client.facebook.get_user_posts("NASA")
104 Jobs
jobs = client.job104.search_jobs(q="Python工程師")
company = client.job104.get_company("company_id")
Async Support
import asyncio
from bycrawl import AsyncByCrawl
async def main():
async with AsyncByCrawl(api_key="sk_byc_...") as client:
post = await client.threads.get_post("DQt-ox3kdE4")
print(post.data.text)
asyncio.run(main())
Rate Limit & Credit Info
Every response includes rate limit and credit usage:
resp = client.threads.get_post("DQt-ox3kdE4")
print(resp.rate_limit.remaining) # requests left
print(resp.credit.remaining) # credits left
Error Handling
from bycrawl import ByCrawl, NotFoundError, RateLimitError
try:
client.threads.get_post("invalid")
except NotFoundError:
print("Post not found")
except RateLimitError as e:
print(f"Rate limited, retry after {e.retry_after}s")
Environment Variable
You can set your API key as an environment variable instead of passing it directly:
export BYCRAWL_API_KEY="sk_byc_..."
client = ByCrawl() # picks up from env
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 bycrawl-0.3.0.tar.gz.
File metadata
- Download URL: bycrawl-0.3.0.tar.gz
- Upload date:
- Size: 63.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
067d19bfeebfbecc1bfd428cd44dcabd43abbd068d0f6bc2bdf32dbe528306e8
|
|
| MD5 |
15f3ac34ee2c23086fcfdaabec20ee9c
|
|
| BLAKE2b-256 |
4fec2009147269467c059b1ad9803eda196d67eca7d37d0b6373b8a11c5bfc12
|
Provenance
The following attestation bundles were made for bycrawl-0.3.0.tar.gz:
Publisher:
python-publish.yml on Signalsurf-ai/bycrawl-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bycrawl-0.3.0.tar.gz -
Subject digest:
067d19bfeebfbecc1bfd428cd44dcabd43abbd068d0f6bc2bdf32dbe528306e8 - Sigstore transparency entry: 1271664798
- Sigstore integration time:
-
Permalink:
Signalsurf-ai/bycrawl-python@9fec26322756f76e3afb7b1070dc2246ae9fb9a4 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/Signalsurf-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9fec26322756f76e3afb7b1070dc2246ae9fb9a4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bycrawl-0.3.0-py3-none-any.whl.
File metadata
- Download URL: bycrawl-0.3.0-py3-none-any.whl
- Upload date:
- Size: 29.0 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 |
fb68750fada5b90b986f9c67ca967c4f897c597c850d00e7150dc0f85f434132
|
|
| MD5 |
f77f77673d1d139b142dade2f30adbe1
|
|
| BLAKE2b-256 |
7ebf458ae41aa61268e35d9ed6848d8b918949492392a8a383ab99b09513753c
|
Provenance
The following attestation bundles were made for bycrawl-0.3.0-py3-none-any.whl:
Publisher:
python-publish.yml on Signalsurf-ai/bycrawl-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bycrawl-0.3.0-py3-none-any.whl -
Subject digest:
fb68750fada5b90b986f9c67ca967c4f897c597c850d00e7150dc0f85f434132 - Sigstore transparency entry: 1271664837
- Sigstore integration time:
-
Permalink:
Signalsurf-ai/bycrawl-python@9fec26322756f76e3afb7b1070dc2246ae9fb9a4 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/Signalsurf-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9fec26322756f76e3afb7b1070dc2246ae9fb9a4 -
Trigger Event:
release
-
Statement type: