The official Python SDK for Thordata's proxy and web data services
Proxy Network • SERP API • Web Unlocker • Web Scraper API • Web Scraper Tools
Deprecated: This repository is no longer the primary Thordata Python SDK and will not receive new feature development. For all new and future Python projects, use the next-generation Thordata Python SDK. This repository is retained for historical reference only. Do not start new integrations with this SDK.
The Thordata Python SDK is an officially supported client library for Thordata's proxy and web data services.
It provides a unified Python interface for:
- SERP API
- Universal Scrape and Web Unlocker
- Web Scraper Tasks
- Proxy Network access
Use the SDK to build proxy-enabled web data collection, web intelligence, automation, and AI data workflows.
Create a Thordata account and get the credentials required by the SDK:
The SDK supports SERP API, proxy, Web Unlocker, and Web Scraper services.
Python 3.9 or later is required.
pip install thordata-sdkUse environment variables (recommended). For local development, copy
.env.example to .env and fill in values (never commit .env).
# [Scraping APIs]
export THORDATA_SCRAPER_TOKEN="your_scraper_token"
# [Management APIs]
export THORDATA_PUBLIC_TOKEN="your_public_token"
export THORDATA_PUBLIC_KEY="your_public_key"
# [Proxy: Residential / Unlimited / Datacenter / Mobile / ISP]
export THORDATA_RESIDENTIAL_USERNAME="your_username"
export THORDATA_RESIDENTIAL_PASSWORD="your_password"The SDK does not automatically load a .env file. If you want .env support:
from thordata import load_env_file
load_env_file() # loads ./.env if present, without overriding existing env varsfrom thordata import Engine, ThordataClient
client = ThordataClient()
results = client.serp_search(query="latest AI trends", engine=Engine.GOOGLE, num=10)
for item in results.get("organic", []):
print(item.get("title"), item.get("link"))from thordata import ThordataClient
client = ThordataClient()
html = client.universal_scrape(url="https://example.com", js_render=True, country="us")
print(type(html), len(str(html)))from thordata import ThordataClient
from thordata.tools import Amazon
client = ThordataClient()
task_id = client.run_tool(Amazon.ProductByAsin(asin="B0BZYCJK89"))
status = client.wait_for_task(task_id, max_wait=300)
if status == "ready":
print(client.get_task_result(task_id))See examples/ for more runnable scripts.
- Documentation index
- SDK features and usage
- SERP API reference
- Universal Scrape reference
- Browser reference
- Web Scraper Tasks reference
pip install -e ".[dev]"
ruff check src tests examples
black --check src tests examples
mypy src --ignore-missing-imports
pytestIntegration tests are skipped by default. Enable them explicitly:
THORDATA_INTEGRATION=true pytest -m integration -vFor live end-to-end checks (requires real credentials in .env), see:
scripts/run_comprehensive_acceptance.pyscripts/acceptance/(targeted read-only acceptance scripts)
MIT License. See LICENSE for details.
- Thordata homepage
- Thordata documentation
- Residential Proxies
- Web Scraper API
- Contact the Thordata team
For data marketplace products, visit Thordata DataMall.