Skip to main content

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)

Instagram

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()

Reddit

sub = client.reddit.get_subreddit("python")
posts = client.reddit.get_subreddit_posts("python", sort="hot")

LinkedIn

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")

Facebook

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


Download files

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

Source Distribution

bycrawl-0.3.0.tar.gz (63.9 kB view details)

Uploaded Source

Built Distribution

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

bycrawl-0.3.0-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

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

Hashes for bycrawl-0.3.0.tar.gz
Algorithm Hash digest
SHA256 067d19bfeebfbecc1bfd428cd44dcabd43abbd068d0f6bc2bdf32dbe528306e8
MD5 15f3ac34ee2c23086fcfdaabec20ee9c
BLAKE2b-256 4fec2009147269467c059b1ad9803eda196d67eca7d37d0b6373b8a11c5bfc12

See more details on using hashes here.

Provenance

The following attestation bundles were made for bycrawl-0.3.0.tar.gz:

Publisher: python-publish.yml on Signalsurf-ai/bycrawl-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for bycrawl-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb68750fada5b90b986f9c67ca967c4f897c597c850d00e7150dc0f85f434132
MD5 f77f77673d1d139b142dade2f30adbe1
BLAKE2b-256 7ebf458ae41aa61268e35d9ed6848d8b918949492392a8a383ab99b09513753c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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