Skip to main content

A Python SDK for TalorData SERP API.

Project description

TalorData Python SDK

A lightweight Python SDK for the TalorData SERP API, inspired by the developer experience of serpapi-python.

Repository: Talordata/talordata-serp-python

Install

pip install talordata-serp

Quick Start

import os

from talordata_serp import Client

client = Client(api_token=os.getenv("TALORDATA_API_TOKEN"))

results = client.search(
    engine="google",
    q="pizza",
)

print(results["search_metadata"]["status"])
print(results["search_information"]["query_displayed"])

You can also set the token once in your shell:

export TALORDATA_API_TOKEN=your_token

Then use the top-level helper:

import talordata_serp

results = talordata_serp.search(q="pizza", engine="google")
print(results)

Examples

Runnable examples are included in the examples/ directory:

  • examples/basic_search.py
  • examples/search_with_url.py
  • examples/html_output.py

Run one with:

python examples/basic_search.py

API Design

  • Client(api_token=...): create a reusable client.
  • client.search(...): send a form-encoded POST request to /serp/v1/request and parse JSON automatically.
  • client.search_json(...): same as search(), but always returns a plain dict.
  • client.search_html(...): return raw HTML/text output.
  • talordata_serp.search(...): convenience helper for one-off requests.

Example With URL

The official docs also show url-based requests. The SDK supports that directly:

from talordata_serp import Client

client = Client(api_token="your_token")

results = client.search(
    url="https://www.google.com/search",
    q="pizza",
    json=1,
)

print(results.as_dict())

Notes

  • Auth uses the Authorization: Bearer <token> header.
  • Requests are sent as application/x-www-form-urlencoded.
  • The SDK targets the serp/v1/request endpoint, where json=1 returns parsed JSON data, json=2 returns both html and json, and json=3 returns HTML.
  • json=1 is the default mode used by client.search(...).
  • Boolean params are normalized to "1" and "0" to match common form API expectations.

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

talordata_serp-0.1.2.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

talordata_serp-0.1.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file talordata_serp-0.1.2.tar.gz.

File metadata

  • Download URL: talordata_serp-0.1.2.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for talordata_serp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a0300fc5efbf29b3554b1e46713b475c7b976a7f8c2e2c485765b8205543f18f
MD5 cd78ce4f3577a0f25e5406cf2ccf7c17
BLAKE2b-256 a741b62ffa80caebe437470c5e517868b6278000b9d90fad73b1c56893a5920f

See more details on using hashes here.

Provenance

The following attestation bundles were made for talordata_serp-0.1.2.tar.gz:

Publisher: workflow.yml on Talordata/talordata-serp-python

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

File details

Details for the file talordata_serp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: talordata_serp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for talordata_serp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 090690dcc8bbe5a2ef0cbd9fbadb74121d706db7e871bc5052c7fcc6bf588082
MD5 30042df7453651c9d869a50f14bdc2cd
BLAKE2b-256 d1dac3a978d544155727ed1ba136df8f743afc181d95c80cd3cd86a6d813178c

See more details on using hashes here.

Provenance

The following attestation bundles were made for talordata_serp-0.1.2-py3-none-any.whl:

Publisher: workflow.yml on Talordata/talordata-serp-python

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