Omniscrape Python SDK
The official Python SDK for the Omniscrape social media data API.
Supports Threads, Facebook, X (Twitter), Instagram, Reddit, LinkedIn, TikTok, YouTube, Dcard, Google Maps, and 104.
Installation
pip install omniscrape
Quick Start
from omniscrape import Omniscrape
client = Omniscrape(api_key="sk_oms_...")
# 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 omniscrape import AsyncOmniscrape
async def main():
async with AsyncOmniscrape(api_key="sk_oms_...") 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 omniscrape import Omniscrape, 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 OMNISCRAPE_API_KEY="sk_oms_..."
client = Omniscrape() # picks up from env
Links
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
omniscrape-0.4.0.tar.gz
(63.3 kB
view details)
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 omniscrape-0.4.0.tar.gz.
File metadata
- Download URL: omniscrape-0.4.0.tar.gz
- Upload date:
- Size: 63.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18865ed6018d6832dd53a49d64014f0dafaa2ad534abeeb94d6eda0bae6dff1b
|
|
| MD5 |
7bcb1265a2e9c67c4dbde6fb18cbf3c7
|
|
| BLAKE2b-256 |
5477f2a74c2dff8a91c8e15925a0c2a684ed4b3119dc46f16805b8d1a1ad7881
|
File details
Details for the file omniscrape-0.4.0-py3-none-any.whl.
File metadata
- Download URL: omniscrape-0.4.0-py3-none-any.whl
- Upload date:
- Size: 29.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfb3a43bce0b139dccbab803294f3028409371fe006f6af040b4f52990251f11
|
|
| MD5 |
b656e5bdcf5137fde160fa60d443d39f
|
|
| BLAKE2b-256 |
836bd208b572b79fefa0f3b0212cc96387ca32ff196ee9d33943a1b93894e20e
|