The Official Python SDK for Thordata - AI Data Infrastructure & Proxy Network.
Project description
Thordata Python SDK
Official Python client for Thordata's Proxy Network, SERP API, Web Unlocker, and Web Scraper API.
Async-ready, type-safe, built for AI agents and large-scale data collection.
✨ Features
- 🌐 Proxy Network: Residential, Mobile, Datacenter, ISP proxies with geo-targeting
- 🔍 SERP API: Google, Bing, Yandex, DuckDuckGo search results
- 🔓 Web Unlocker: Bypass Cloudflare, CAPTCHAs, anti-bot systems
- 🕷️ Web Scraper API: Async task-based scraping (Text & Video/Audio)
- 📊 Account Management: Usage stats, sub-users, IP whitelist
- ⚡ Async Support: Full async/await support with aiohttp
- 🔄 Auto Retry: Configurable retry with exponential backoff
📦 Installation
pip install thordata-sdk
🔐 Configuration
Set environment variables:
# Required for Scraper APIs (SERP, Universal, Tasks)
export THORDATA_SCRAPER_TOKEN=your_token
# Public/Location APIs (Dashboard -> My account -> API)
export THORDATA_PUBLIC_TOKEN=your_public_token
export THORDATA_PUBLIC_KEY=your_public_key
🚀 Quick Start
from thordata import ThordataClient, Engine
# Initialize (reads from env vars)
client = ThordataClient(
scraper_token="your_token",
public_token="pub_token",
public_key="pub_key"
)
# SERP Search
results = client.serp_search("python tutorial", engine=Engine.GOOGLE)
print(f"Found {len(results.get('organic', []))} results")
# Universal Scrape
html = client.universal_scrape("https://httpbin.org/html")
print(html[:100])
📖 Feature Guide
SERP API
from thordata import SerpRequest
# Advanced search
results = client.serp_search_advanced(SerpRequest(
query="pizza",
engine="google_local",
country="us",
location="New York",
num=10
))
Web Scraper API (Async Tasks)
Create Task:
task_id = client.create_scraper_task(
file_name="my_task",
spider_id="universal",
spider_name="universal",
parameters={"url": "https://example.com"}
)
Video Download (New):
from thordata import CommonSettings
task_id = client.create_video_task(
file_name="{{VideoID}}",
spider_id="youtube_video_by-url",
spider_name="youtube.com",
parameters={"url": "https://youtube.com/watch?v=..."},
common_settings=CommonSettings(resolution="1080p")
)
Wait & Download:
status = client.wait_for_task(task_id)
if status == "ready":
url = client.get_task_result(task_id)
print(url)
Account Management
# Usage Statistics
stats = client.get_usage_statistics("2024-01-01", "2024-01-31")
print(f"Balance: {stats.balance_gb():.2f} GB")
# Proxy Users
users = client.list_proxy_users()
print(f"Sub-users: {users.user_count}")
# Whitelist IP
client.add_whitelist_ip("1.2.3.4")
Proxy Network
from thordata import ProxyConfig
# Generate Proxy URL
proxy_url = client.build_proxy_url(
username="proxy_user",
password="proxy_pass",
country="us",
city="ny"
)
# Use with requests
import requests
requests.get("https://httpbin.org/ip", proxies={"http": proxy_url, "https": proxy_url})
📄 License
MIT License
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 thordata_sdk-1.0.0.tar.gz.
File metadata
- Download URL: thordata_sdk-1.0.0.tar.gz
- Upload date:
- Size: 56.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e86cb377c2710c569e760921756d4a6c8ccab2c1dfd250e1fee5ebf8cdf5acfb
|
|
| MD5 |
f8b3fb26c4932239de252925d153ff26
|
|
| BLAKE2b-256 |
3ea031dfa22a7738dd295c139c530f271e1c99249c4a7a669f7510fa63e39029
|
Provenance
The following attestation bundles were made for thordata_sdk-1.0.0.tar.gz:
Publisher:
pypi-publish.yml on Thordata/thordata-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thordata_sdk-1.0.0.tar.gz -
Subject digest:
e86cb377c2710c569e760921756d4a6c8ccab2c1dfd250e1fee5ebf8cdf5acfb - Sigstore transparency entry: 790024105
- Sigstore integration time:
-
Permalink:
Thordata/thordata-python-sdk@da0b5c75a8237e99691386348bf4304fb08ecd83 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Thordata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@da0b5c75a8237e99691386348bf4304fb08ecd83 -
Trigger Event:
push
-
Statement type:
File details
Details for the file thordata_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: thordata_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 48.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e1715c42bf46dbae09a817571e6734da709571c2856442ad9beb62eb78bbe75
|
|
| MD5 |
1df3c7aac6ff89371e0fae468896c34a
|
|
| BLAKE2b-256 |
99d72cbf3c8cf00d339b1aed08a6508fd6fb85f12d793237d38b358b9f203604
|
Provenance
The following attestation bundles were made for thordata_sdk-1.0.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on Thordata/thordata-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
thordata_sdk-1.0.0-py3-none-any.whl -
Subject digest:
6e1715c42bf46dbae09a817571e6734da709571c2856442ad9beb62eb78bbe75 - Sigstore transparency entry: 790024106
- Sigstore integration time:
-
Permalink:
Thordata/thordata-python-sdk@da0b5c75a8237e99691386348bf4304fb08ecd83 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/Thordata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@da0b5c75a8237e99691386348bf4304fb08ecd83 -
Trigger Event:
push
-
Statement type: