Skip to main content

Reserp Google Search API

Reserp Python SDK

PyPI version Python versions CI License: MIT

The official minimal Python client for Reserp v2, a Google Search API with two stable response shapes:

Website · API documentation · OpenAPI 3.1 · Postman · Pricing

Design

Each SDK call makes exactly one API request and returns the native httpx.Response unchanged. The package adds no retry, timeout, URL-building, validation, pagination, transformation, cache, batch, queue, or concurrency policy. Typed dictionaries generated from the canonical schema describe both v2 contracts without changing them at runtime.

Installation

pip install reserp

Python 3.10 or later is required.

Search results

import os

from reserp import Reserp

with Reserp(api_key=os.environ["RESERP_API_KEY"]) as reserp:
    response = reserp.search(
        {"url": "https://www.google.com/search?q=best+pizza+in+dubai&gl=ae&hl=en"}
    )
    data = response.json()

    if data["ok"]:
        for item in data["results"]:
            print(item.get("text"), item["url"])
    else:
        print(response.status_code, data["error"], data["retryable"], data["billed"])

The deprecated urls() method is a compatibility alias for search() and uses the stable Search endpoint.

Structured results

with Reserp(api_key=os.environ["RESERP_API_KEY"]) as reserp:
    response = reserp.structured(
        {"url": "https://www.google.com/search?q=wireless+earbuds&gl=us&hl=en&tbm=shop"}
    )
    data = response.json()

    if data["ok"]:
        for block in data["blocks"]:
            print(block["position"], block["type"], block["title"])
            if block["type"] == "organic":
                for item in block["items"]:
                    print(item["position"], item["title"], item["url"])

Detailed block and item types are available from reserp.types.

Async client

import asyncio
import os

from reserp import AsyncReserp


async def main() -> None:
    async with AsyncReserp(api_key=os.environ["RESERP_API_KEY"]) as reserp:
        response = await reserp.search(
            {"url": "https://www.google.com/search?q=photonic+computing&gl=us&hl=en"}
        )
        print(response.status_code, response.json())


asyncio.run(main())

Native transport control

Inject an HTTPX client for transport policy and pass request options directly to the matching client method:

import httpx

limits = httpx.Limits(max_connections=50, max_keepalive_connections=20)
timeout = httpx.Timeout(20.0)

with httpx.Client(limits=limits, timeout=timeout) as transport:
    reserp = Reserp(api_key=os.environ["RESERP_API_KEY"], client=transport)
    response = reserp.search(
        {"url": "https://www.google.com/search?q=semiconductors&gl=us&hl=en&tbs=qdr:w"},
        headers={"x-request-id": "your-job-id"},
        follow_redirects=False,
    )

Transport failures remain native HTTPX exceptions. HTTP error responses remain native responses; inspect their status, headers, and JSON body.

Direct HTTP equivalents

curl https://api.reserp.ai/v2/serp/search \
  --request POST \
  --header "Authorization: Bearer $RESERP_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"url":"https://www.google.com/search?q=photonic+computing&gl=us&hl=en"}'

curl https://api.reserp.ai/v2/serp/structured \
  --request POST \
  --header "Authorization: Bearer $RESERP_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"url":"https://www.google.com/search?q=photonic+computing&gl=us&hl=en"}'

Pagination and errors

Every successful response contains pagination.next_url. Send that URL back as the next request body's url; its presence does not guarantee that another page contains results. Do not calculate pagination from len(data["results"]), len(data["blocks"]), or any block's item count.

Error bodies expose error, retryable, billed, and billing_source. If your application retries, use retryable as the authority and honor Retry-After on HTTP 429. The SDK never retries automatically.

Migrating

From SDK 0.3, replace urls() with search(), /v2/serp/urls with /v2/serp/search, and data["urls"] with data["results"]. urls() remains as a deprecated method alias, but its response now follows the stable Search contract.

If you used the structured beta, replace schema_version, grouped results, features, page_position, and metadata with the stable, page-ordered blocks[] model. Each block has type and position; block-specific entries live in items[].

When migrating directly from v1, other notable renames are url → request.url, finalUrl → page.url, pagination.nextUrl → pagination.next_url, and billingSource → billing_source.

License

MIT

Metadata

Release files for reserp 0.4.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 reserp 0.4.0
File Size Uploaded
reserp-0.4.0.tar.gz 71.6 kB Details

Built distribution (wheel)

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

Total release size: 80.4 kB

Release files / reserp-0.4.0.tar.gz

Download URL reserp-0.4.0.tar.gz
Size 71.6 kB
Tags Source
SHA-256 checksum
How to use checksums
68c4628af1d476bc6bed09f28df89a15a269a7cc0d876ecb7f8d0c2b9dc04711
BLAKE2b-256 checksum
How to use checksums
e9e2018368ebcb679c35800ac6d64b82fef1f6df1b73d9a69815b518b47b33e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / reserp-0.4.0-py3-none-any.whl

Download URL reserp-0.4.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59b70fbcf3237bd6daae4b5a334361b97a2083ef63178a76f2e751166ee01bd2
BLAKE2b-256 checksum
How to use checksums
4bedca03a0bc8ddf54ecefe4608a14afb930b0bfd419062d5c8273611db5a79c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.4.1

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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