Skip to main content

Professional Python SDK for JustSerpAPI

Project description

JustSerpAPI Logo

JustSerpAPI Python SDK

PyPI version Python Versions Documentation License

OpenAPI-driven Python SDK for JustSerpAPI with a stable high-level Client as the public entrypoint.

Installation

pip install justserpapi

Quick Start

from justserpapi import Client

with Client(api_key="YOUR_API_KEY") as client:
    response = client.google.search(
        query="coffee shops in New York",
        location="New York, NY",
        language="en",
    )
    print(response.organic_results)

Promoted High-Level API

The high-level surface is designed to be the default entrypoint:

from justserpapi import Client

client = Client(api_key="YOUR_API_KEY", timeout=20.0)

search = client.google.search(query="best espresso beans", language="en")
maps = client.google.maps.search(query="espresso bars", location="Shanghai")
news = client.google.news.search(query="OpenAI", language="en")
images = client.google.images.search(query="espresso machine")
shopping = client.google.shopping.search(query="espresso tamper")
overview = client.google.ai.overview(url="https://example.com/ai-overview")

client.close()

Promoted high-level responses are parsed into Pydantic models:

  • GoogleSearchResponse
  • GoogleMapsSearchResponse
  • GoogleNewsSearchResponse
  • GoogleImagesSearchResponse
  • GoogleShoppingSearchResponse
  • GoogleAIOverviewResponse

Configuration

The public client exposes the common knobs directly:

from justserpapi import Client
from urllib3.util.retry import Retry

client = Client(
    api_key="YOUR_API_KEY",
    base_url="https://api.justserpapi.com",
    timeout=(5.0, 30.0),
    retries=Retry(total=5, backoff_factor=0.5),
)
client.close()
  • api_key: value sent in the X-API-Key header
  • base_url: API host, defaults to https://api.justserpapi.com
  • timeout: default request timeout injected into promoted high-level methods
  • retries: urllib3 retry configuration; defaults to a conservative retry strategy for the high-level client

OpenAPI Control Plane

This repository is driven by the canonical OpenAPI document plus the SDK control-plane files in config/, scripts/, and overlays/.

  • If openapi/justserpapi.openapi.json is committed, local generation is fully reproducible.
  • If it is not committed, CI can fetch and cache it by running python scripts/sdkctl.py fetch-spec with JUSTSERPAPI_API_KEY configured.

Typical maintenance flow:

python scripts/sdkctl.py validate-examples
python scripts/sdkctl.py validate-spec --skip-generator-validate
python scripts/sdkctl.py generate --clean

License

Distributed under the MIT License. See LICENSE for more information.

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

justserpapi-2.0.0.tar.gz (54.7 kB view details)

Uploaded Source

Built Distribution

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

justserpapi-2.0.0-py3-none-any.whl (54.1 kB view details)

Uploaded Python 3

File details

Details for the file justserpapi-2.0.0.tar.gz.

File metadata

  • Download URL: justserpapi-2.0.0.tar.gz
  • Upload date:
  • Size: 54.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.5

File hashes

Hashes for justserpapi-2.0.0.tar.gz
Algorithm Hash digest
SHA256 013b8b3390f03a57686f094e544daf9e99ff0fe16dd60af60855120a41e16bd1
MD5 2a275ce3b6db836bc2f51f34c962f013
BLAKE2b-256 b2ec035e46b2ec6262afaea782bfa6f4537d86074306741268be08cba208c393

See more details on using hashes here.

File details

Details for the file justserpapi-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: justserpapi-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 54.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.5

File hashes

Hashes for justserpapi-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa2cf7468ab33a59d60436148efd32662334b9d23ef4c60fe15bdc3b781b235d
MD5 c58c12374d1a068e73972837148861b1
BLAKE2b-256 98a81ec28b0d64992ea2441d153735345fbf80765855525ee9f444540748aa55

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 Pingdom Monitoring Sentry Error logging StatusPage Status page