Skip to main content

Serqo Python SDK

Official Python client for the Serqo Search API. Requires Python 3.10 or later and uses only the standard library.

Install

pip install serqo

Quick start

import os
from serqo import Serqo

client = Serqo(api_key=os.environ["SERQO_API_KEY"])
response = client.search({
    "q": "espresso machines",
    "engine": "google",
    "type": "web",
    "gl": "us",
    "hl": "en",
})

print(response["data"]["results"])
print("Request ID:", response["requestId"])

Keep the API key in a server-side environment variable. The client returns the full response envelope as dictionaries and uses only Python's standard library.

Configure the client

from serqo import Serqo

client = Serqo(
    api_key="your-api-key",
    base_url="https://api.serqo.io",
    timeout=30,
)

base_url and timeout are optional. The default timeout is 60 seconds. Do not expose the API key in browser code or commit it to source control.

Methods

  • search(query, idempotency_key=None) sends POST /v1/search.
  • engines() returns the supported engines and search types.
  • me() returns account and API key identifiers.
  • health() checks the product API without sending an API key.

Read results from response["data"]["results"]. For pagination, use response["data"]["pagination"]["nextStart"]. See the API reference for search parameters, response fields, and pagination behavior.

Errors and retries

API errors raise SerqoError. It exposes status, code, request_id, retryable, retry_after_ms, and details:

from serqo import SerqoError

try:
    response = client.search({"q": "coffee shops", "engine": "google", "type": "maps"})
except SerqoError as error:
    print(error.status, error.code, error.request_id)

Connection failures raise ConnectionError; request timeouts raise TimeoutError. The SDK does not retry searches automatically. When retrying an uncertain request, reuse the same idempotency_key with the same query within 24 hours.

Publish a release

Releases are published from GitHub Actions using PyPI Trusted Publishing. Configure a pending publisher on PyPI for owner serqo-io, repository serqo-python, workflow release.yml, and environment pypi. Then push a tag matching the version in pyproject.toml, such as v0.1.0. The workflow builds and checks both distributions before publishing them. See the PyPI publishing guide.

Metadata

Release files for serqo 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 serqo 0.1.0
File Size Uploaded Provenance
serqo-0.1.0.tar.gz 4.8 kB With provenance Details

Built distribution (wheel)

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

Total release size: 10.0 kB

Release files / serqo-0.1.0.tar.gz

Download URL serqo-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5a7325b1df0ab6a3a292291cf4f74122b7fc80acddba0ba360e0f1e3de8f6578
BLAKE2b-256 checksum
How to use checksums
1831410e67e8675f7f794689f19250b2e060ba57b22f25547685d0c9fa26c04d
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 Oct 23, 2026.

Transparency log

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

Download URL serqo-0.1.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63dd05a26d3fad71e2a40fc9a899ee1e1609680f9c5b0213f358450e810bb36e
BLAKE2b-256 checksum
How to use checksums
36a218a4a55720f8fa38c6033f453850257e2fd345ebe778198039b67fb1e49d
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 Oct 23, 2026.

Transparency log

Security for serqo 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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for serqo-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 Oct 23, 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.

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