Skip to main content

Thordata Python SDK

Python client for the Thordata SERP API and seven verified Web Scraper products. The package is independent of LangChain and uses the real Thordata form endpoints.

Next-generation Thordata Python SDK for new projects. This repository is the future primary Python SDK and is being prepared for public PyPI release.

Turn live web data into working applications faster. Thordata Python SDK gives Python teams one interface for SERP search and structured web scraping, so you can power research, monitoring, enrichment, RAG, and AI agent workflows without maintaining a separate scraper for every target.

Use it to track search visibility, enrich business data, monitor products and markets, or bring fresh web data into your own applications and pipelines.

Why Thordata Python SDK

  • Search and scrape through one client: Query live search engines and collect structured records through ready-to-use Web Scraper actions.
  • Built for real workflows: Move from a proof of concept to research, monitoring, enrichment, and AI data pipelines with the same Python interface.
  • Flexible execution: Use synchronous or asynchronous calls while keeping the request model consistent.
  • Ready for downstream systems: Send structured results into analytics, RAG, agents, and internal applications.
  • Designed for dependable use: Benefit from connection reuse, bounded task polling, redacted diagnostics, and predictable response handling.

Create a Thordata account to get started:

Install

pip install thordata

Set THORDATA_API_KEY, THORDATA_API_TOKEN, or the compatible TALORDATA_API_TOKEN environment variable. An explicit api_key argument takes precedence.

SERP

from thordata import Client

with Client() as client:
    result = client.search(
        {"q": "latest AI agent research", "gl": "us", "hl": "en"},
        engine="google_search",
    )
    print(result)

The client submits form data to https://scraperapi.thordata.com/request with Bearer authentication. SERP source headers are Origin: Python, platform: python, and api-source: sdk. It supports the verified engines and API-native parameters from the Thordata service. google_search maps to google, google_places maps to google_local, and query, country, and language map to q, gl, and hl. Yandex sends q as text. Boolean values become 1 or 0, and unknown fields are ignored.

Use search_response() when task metadata and the raw response envelope are needed, and raw_search() when the unparsed response body is needed. task_id is taken from the upstream envelope when present and falls back to search_metadata.id for bare SERP results. The raw response keeps the engine-specific shape; Google commonly returns organic/images/places, while other engines may return organic_results or similar fields. raw_search() returns text without interpreting business error codes. Use asearch() and asearch_response() for asynchronous calls; one client reuses its async connection pool within the event loop and aclose() releases it. The SDK does not expose search_html() because the current /request endpoint does not guarantee an HTML response.

Web Scraper

The initial SDK supports these spider IDs:

  • linkedin_company_information_by-url: url
  • linkedin_job_listings_information_by-job-url: job_url
  • youtube_video-post_by-keyword: keyword, optional num_of_posts
  • facebook_profile_by-profiles-url: url
  • youtube_video-post_by-explore: url, optional all_tabs
  • twitter_profile_by-profileurl: url
  • amazon_product_by-category-url: url, page_turning, optional sort_by
from thordata import Client

with Client() as client:
    records = client.scrape(
        "linkedin_company_information_by-url",
        {"url": "https://www.linkedin.com/company/microsoft"},
    )
    print(records)

scrape() submits one task, polls every five seconds, and downloads the final JSON records. Web Scraper source fields are form parameters api_source=sdk and source_platform=python; they are not request headers. Amazon uses Best Sellers when sort_by is omitted. A client permits one active synchronous scrape at a time; asynchronous scrapes do not use that synchronous lock. If a synchronous scrape times out, its worker may still be finishing briefly; retry after the reported active-operation message. The total wait is capped at 300 seconds by default. Use scrape_response() to receive task_id, spider_id, status, record_count, and error_record_count. Status is completed, partial, or empty. ascrape() and ascrape_response() provide asynchronous equivalents.

Web Scraper errors retain their stage and task ID when safe, while API keys and signed URLs are redacted from exception text and returned diagnostic data.

Local checks

python -m pytest -q tests
ruff check .
python -m build .

The tests use an in-memory HTTP transport and do not consume Thordata credits. See examples/ for runnable SERP and Web Scraper examples.

Start Building

Start with one SERP query, add a Web Scraper action when you need structured records, and connect the results to the systems your team already uses. The same workflow can support a quick experiment today and a repeatable data pipeline tomorrow.

Explore Thordata Web Scraper | Explore Thordata SERP API

Metadata

Release files for thordata 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thordata 0.1.0
File Size Uploaded Provenance Actions
thordata-0.1.0.tar.gz 23.6 kB With provenance Details for thordata-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for thordata 0.1.0
File Interpreter ABI Platform Actions
thordata-0.1.0-py3-none-any.whl Python 3 none any Details for thordata-0.1.0-py3-none-any.whl

Total release size: 44.8 kB

Release files / thordata-0.1.0.tar.gz

Download URL thordata-0.1.0.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9523d7d5f69267fc2f5c024ed18bad2236da38f61135dc8b57fef5568d38313a
BLAKE2b-256 checksum
How to use checksums
b60ea7846a9f816e1a9138964409649a63c078e24da512a2a377adcf8b7437f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / thordata-0.1.0-py3-none-any.whl

Download URL thordata-0.1.0-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e6cf174c07ccda57f41e0ea24445920b110e1ca6133636f9e1b2672b5d73ae9
BLAKE2b-256 checksum
How to use checksums
54b142f6df923ec7a756a704e09f68179f3318ce2593b204bdf150e8c50c27ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for thordata 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for thordata-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page