Python SDK for the Thordata SERP API and Web Scraper
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.
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.
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 errors retain their stage and task ID when safe, while API keys and signed URLs are redacted from exception text and returned diagnostic data.
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 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
Both files in this release have provenance metadata.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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 verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.
Both files in this release have been uploaded with provenance metadata.
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.




