快速開始
5 分鐘內開始使用 Omniscrape API。
1. 取得 API 金鑰
在 Omniscrape Dashboard 註冊帳號,並於 API Keys 頁面建立 API 金鑰。
您的金鑰格式如下:sk_oms_xxxxxxxxxxxx
2. 發送第一個請求
Python (SDK)
安裝官方 Python SDK:
pip install omniscrapefrom omniscrape import Omniscrape
client = Omniscrape(api_key="YOUR_API_KEY")
user = client.threads.get_user("zuck")
print(user.data.username, user.data.follower_count)回應:
{
"id": "314216",
"username": "zuck",
"fullName": "Mark Zuckerberg",
"profilePic": "https://...",
"bio": "Building the future...",
"isVerified": true,
"followerCount": 3200000,
"followingCount": 450
}3. 探索 API
每個平台遵循相同的 URL 格式:
GET /{platform}/users/{username} # 使用者資料
GET /{platform}/users/{id}/posts # 使用者的貼文
GET /{platform}/posts/{id} # 單一貼文
GET /{platform}/posts/search?q=keyword # 搜尋貼文支援的平台:threads、facebook、instagram、x、reddit、tiktok、linkedin、youtube、google、gmaps、hackernews、producthunt、trustpilot、luma、dcard、ptt、job104、rent591、web
提示:如何找到正確的 username?
username參數必須是該帳號在平台上的英文帳號名稱,而非品牌的中文名稱或顯示名稱。找到方式:前往該品牌的社群平台頁面,網址最後一段就是 username:
facebook.com/CTfans→ username 是CTfansinstagram.com/kanpo_yamamoto.tw→ username 是kanpo_yamamoto.twthreads.net/@zuck→ username 是zuck常見錯誤:使用中文品牌名稱查詢、猜測 username、或混淆
.和_。
回應格式
所有回應直接以 JSON 格式回傳資料,不包含額外的包裝物件。
成功
{
"id": "314216",
"username": "zuck",
...
}錯誤
{
"detail": "Error message"
}速率限制
API 使用量依 API 金鑰追蹤。您可在帳單頁面 查看目前的使用狀況。
下一步
- 安裝 Python SDK,享受型別完整的 Pythonic 開發體驗
- 瀏覽 API 參考 查看詳細的端點文件
- 了解各平台特定功能
- 查看錯誤代碼以排除問題
Last updated on