Skip to main content

The Official Python SDK for Thordata - AI Data Infrastructure & Proxy Network.

Project description

Thordata Python SDK

Thordata Logo

The Official Python Client for Thordata APIs

Proxy Network • SERP API • Web Unlocker • Web Scraper API

PyPI version Python Versions License CI Status


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.md
  • docs/serp_reference.md
  • docs/universal_reference.md
  • docs/browser_reference.md
  • docs/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.py
  • scripts/acceptance/ (targeted read-only acceptance scripts)

License

MIT License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thordata_sdk-1.8.5.tar.gz (109.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thordata_sdk-1.8.5-py3-none-any.whl (95.1 kB view details)

Uploaded Python 3

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

Hashes for thordata_sdk-1.8.5.tar.gz
Algorithm Hash digest
SHA256 fe0df882e3ac270452694c6c47f2267229d93d6d619ea35095164c2ce77283ad
MD5 a7a53ee2d221afd7195364843dc9386d
BLAKE2b-256 46b5d13d437be4148dd307f9d4334e67720016fc302ae5dab3ef4082fceee347

See more details on using hashes here.

Provenance

The following attestation bundles were made for thordata_sdk-1.8.5.tar.gz:

Publisher: pypi-publish.yml on Thordata/thordata-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for thordata_sdk-1.8.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a6891165c5db43bfb2f9ff3a922961efc0c326f2d5687fe6623601271dad2af3
MD5 4f5841eb1a543370c48615f2bf038f82
BLAKE2b-256 bb23df541898972e5b94a24f0901a90b23108bdc8d9e026c0ce564205254c0b6

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page