Skip to main content

Reserp Google Search API

Reserp Python SDK

PyPI version Python versions CI License: MIT

The official Python SDK for Reserp, a Google Search API for developers and AI agents.

Retrieve structured Google Search results through one stable JSON schema. Start for free with no credit card required.

Website · API documentation · OpenAPI 3.1 · Pricing

Features

  • Synchronous and asynchronous clients built on HTTPX.
  • Typed responses that preserve the complete API response dictionary.
  • One-based pagination plus support for authoritative pagination URLs.
  • Configurable retries and timeouts.
  • Automatic retries only when the API says the request is retryable and was not billed.

Installation

pip install reserp

Python 3.10 or later is required.

Quick start

import os

from reserp import Reserp

client = Reserp(api_key=os.environ["RESERP_API_KEY"])

response = client.search(
    query="best pizza in dubai",
    gl="ae",
    hl="en",
)

for result in response["results"]:
    print(result.get("text"), result.get("url"))

Create an API key in the Reserp dashboard. Keep API keys on your server; never embed one in browser or mobile code.

The SDK returns the API response as a normal Python dictionary. Result order, nested children, pagination, and billing fields remain intact.

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 client:
        response = await client.search(
            query="semiconductor manufacturing",
            gl="us",
            hl="en",
        )
        print(response["results"])


asyncio.run(main())

The synchronous client is also a context manager:

with Reserp(api_key=os.environ["RESERP_API_KEY"]) as client:
    response = client.search(query="photonic computing")

Pagination

page is one-based, so you do not need to calculate Google's start offsets:

second_page = client.search(
    query="photonic computing",
    page=2,
)

You can also follow the authoritative pagination URL returned by the API:

first = client.search(query="photonic computing")
second = client.next_page(first)

Do not derive pagination from len(response["results"]). A response can contain organic listings, news, carousels, sitelinks, and nested result blocks.

Google parameters

Use params for additional Google parameters such as tbs and tbm:

news = client.search(
    query="semiconductor manufacturing",
    params={"tbm": "nws", "tbs": "qdr:w"},
)

For complete control, submit a full Google Search URL:

response = client.search_url(
    "https://www.google.com/search?q=semiconductor+manufacturing&gl=us&hl=en&tbs=qdr:w"
)

All Google URL parameters pass through unchanged except parameters documented as unsupported by Reserp. The num parameter is currently unsupported.

Errors and retries

API failures raise ReserpAPIError with the stable public error code and billing state:

from reserp import ReserpAPIError

try:
    response = client.search(query="photonic computing")
except ReserpAPIError as error:
    print(error.status, error.code, error.retryable, error.billed)

The SDK retries retryable API responses up to two times by default, respecting Retry-After for rate limits. It never automatically retries a response whose billed field is true. Network failures are not automatically retried because the client cannot know whether the original request reached the API.

Configure retries and per-attempt timeouts globally or per request:

client = Reserp(
    api_key=os.environ["RESERP_API_KEY"],
    max_retries=1,
    timeout=20.0,
)

response = client.search(
    query="photonic computing",
    max_retries=0,
    timeout=10.0,
)

Set timeout=0 to disable the SDK timeout.

API reference

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reserp-0.1.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

reserp-0.1.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file reserp-0.1.0.tar.gz.

File metadata

  • Download URL: reserp-0.1.0.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for reserp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f06e9ab4741f846ecdb475172c7acb7e3838a065a57b0c1cd3afa68fad7270f
MD5 b9b5d7c49dbac7be346c8b7189f6b772
BLAKE2b-256 e2b801d33956537e02c2db47cb828a450f1c77b501a918b60f6846c7894b576f

See more details on using hashes here.

File details

Details for the file reserp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: reserp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for reserp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32a70b8cc23f4e113359ce373996cebf03316043e596faa20c3e98137470e767
MD5 cac45553f72c4308c8d73fa826a384ca
BLAKE2b-256 f4242390ccc8d6056a77088ad4aee349a2e838cbfedde6422c5848875f99b158

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page