The Official Python SDK for Thordata - AI Data Infrastructure & Proxy Network.
Project description
Thordata Python SDK
The Official Python Client for Thordata APIs
Proxy Network • SERP API • Web Unlocker • Web Scraper API
Overview
The Thordata Python SDK is an officially supported client library for Thordata APIs: SERP, Universal Scrape (Web Unlocker), Web Scraper Tasks, and Proxy Network.
Installation
pip install thordata-sdk
Configuration
Use 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"
Loading .env (optional)
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 vars
Quick Start
SERP Search
from 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"))
Universal Scrape
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)))
Web Scraper Tools
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
docs/README.md(index)docs/SDK_FEATURES_AND_USAGE.mddocs/serp_reference.mddocs/universal_reference.mddocs/browser_reference.mddocs/web_scraper_tasks_reference.md
Development & Testing
pip install -e ".[dev]"
ruff check src tests examples
black --check src tests examples
mypy src --ignore-missing-imports
pytest
Live / Integration tests
Integration tests are skipped by default. Enable them explicitly:
THORDATA_INTEGRATION=true pytest -m integration -v
For live end-to-end checks (requires real credentials in .env), see:
scripts/run_comprehensive_acceptance.pyscripts/acceptance/(targeted read-only acceptance scripts)
License
MIT License. See LICENSE for details.
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.8.5.tar.gz.
File metadata
- Download URL: thordata_sdk-1.8.5.tar.gz
- Upload date:
- Size: 109.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe0df882e3ac270452694c6c47f2267229d93d6d619ea35095164c2ce77283ad
|
|
| MD5 |
a7a53ee2d221afd7195364843dc9386d
|
|
| BLAKE2b-256 |
46b5d13d437be4148dd307f9d4334e67720016fc302ae5dab3ef4082fceee347
|
Provenance
The following attestation bundles were made for thordata_sdk-1.8.5.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.8.5.tar.gz -
Subject digest:
fe0df882e3ac270452694c6c47f2267229d93d6d619ea35095164c2ce77283ad - Sigstore transparency entry: 1002212995
- Sigstore integration time:
-
Permalink:
Thordata/thordata-python-sdk@12df09b346e66d5757cdef1bdbe27e6e9afca82f -
Branch / Tag:
refs/tags/v1.8.5 - Owner: https://github.com/Thordata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@12df09b346e66d5757cdef1bdbe27e6e9afca82f -
Trigger Event:
push
-
Statement type:
File details
Details for the file thordata_sdk-1.8.5-py3-none-any.whl.
File metadata
- Download URL: thordata_sdk-1.8.5-py3-none-any.whl
- Upload date:
- Size: 95.1 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 |
a6891165c5db43bfb2f9ff3a922961efc0c326f2d5687fe6623601271dad2af3
|
|
| MD5 |
4f5841eb1a543370c48615f2bf038f82
|
|
| BLAKE2b-256 |
bb23df541898972e5b94a24f0901a90b23108bdc8d9e026c0ce564205254c0b6
|
Provenance
The following attestation bundles were made for thordata_sdk-1.8.5-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.8.5-py3-none-any.whl -
Subject digest:
a6891165c5db43bfb2f9ff3a922961efc0c326f2d5687fe6623601271dad2af3 - Sigstore transparency entry: 1002213122
- Sigstore integration time:
-
Permalink:
Thordata/thordata-python-sdk@12df09b346e66d5757cdef1bdbe27e6e9afca82f -
Branch / Tag:
refs/tags/v1.8.5 - Owner: https://github.com/Thordata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@12df09b346e66d5757cdef1bdbe27e6e9afca82f -
Trigger Event:
push
-
Statement type: