Skip to main content

PriceBell Python SDK

The official Python SDK for the PriceBell Google Shopping price tracking API.

Track Google Shopping prices in 33 countries with a scheduled watchlist, price history, sellers, cross-country comparison and alerts.

The SDK exposes 14 typed methods, one per documented endpoint, with blocking and asyncio clients built on HTTPX, plus a generic request().

Requirements

  • Python 3.11 or newer

Installation

pip install pricebell

Get your API key

Sign up for PriceBell or sign in, then copy your API key from the dashboard. The client reads the PRICEBELL_API_KEY environment variable when no key is passed.

Quick start

import os

from pricebell import PriceBellClient

with PriceBellClient(os.environ["PRICEBELL_API_KEY"]) as client:
    response = client.search_google_shopping(query="airpods pro 2")
    print(response.data)

Keyword arguments mirror the API reference. Python keywords get a trailing underscore (from_=), and the wire name is used on the request.

Async I/O

import asyncio

from pricebell import AsyncPriceBellClient


async def main() -> None:
    async with AsyncPriceBellClient() as client:
        response = await client.search_google_shopping(query="airpods pro 2")
        print(response.data)


asyncio.run(main())

HTTP methods

Each method uses the HTTP verb of its endpoint. GET and DELETE send parameters in the query string; POST and PATCH send them as a JSON body, except wait on /products/{id}/check, which stays in the query string. None values are never sent, so update_product(target_price=None) leaves the target price as it is: clear_target_price(id=...) removes it (it sends {"target_price": null}).

client.clear_target_price(id="p1")

None values are omitted, False and 0 are sent, and sequences repeat the parameter name.

Any endpoint

response = client.request("GET", "/account")

Errors

from pricebell import PriceBellAPIError

try:
    client.search_google_shopping(query="airpods pro 2")
except PriceBellAPIError as error:
    print(error.status, error.error_code, error, error.response_body)
Error When
PriceBellConfigurationError Missing API key, invalid options, unsupported method, closed client.
PriceBellSerializationError A required parameter is missing or a value can't be sent.
PriceBellTransportError Network failure or timeout.
PriceBellAPIError Non-2xx status (status, error_message, error_code, response_body, raw_response). error_code is the API's error.code, such as rate_limited or product_limit (None when the body has none).
PriceBellResponseDecodingError A success response could not be decoded.

All of them extend PriceBellError.

Retries

Requests are retried up to 3 times after a network error, a 408, 500, 502, 503 or 504. Other statuses, such as 400, 401, 402, 404 or 429, and client-side timeouts are not retried: the API's rate limits last until the hour (or the day) is over, and on the free plan every retry would count as a request. The delay starts at 1 second and grows 1.5× per retry (capped at 30 seconds); a Retry-After header wins.

client = PriceBellClient(max_retries=5, retry_delay=0.5)

# or for one request
client.search_google_shopping(query="airpods pro 2", request_options=RequestOptions(max_retries=0))

Batch requests

batch() runs a function per item on 10 threads (concurrency) and returns one BatchResult per item, in input order. A failing item never stops the others. AsyncPriceBellClient.batch() does the same with asyncio.

inputs = ["airpods pro 2", "nintendo switch 2", "dyson v15"]
results = client.batch(inputs, lambda query: client.search_google_shopping(query=query), concurrency=5)

for result in results:
    if result.ok:
        print(result.value.data)
    else:
        print(inputs[result.index], result.error)
Constant Default Description
DEFAULT_CONCURRENCY 10 Tasks run at the same time by batch
DEFAULT_TIMEOUT 120.0 Request timeout (seconds)
MAX_RETRIES 3 Retry attempts after a network error, a 408/5xx
RETRY_BACKOFF_FACTOR 1.5 Exponential backoff multiplier
DEFAULT_RETRY_DELAY 1.0 Delay before the first retry (seconds)

Timeouts and custom HTTPX clients

import httpx

from pricebell import PriceBellClient, RequestOptions

client = PriceBellClient(timeout=60)  # seconds, default 120, None disables
client.search_google_shopping(query="airpods pro 2", request_options=RequestOptions(timeout=30))

# Bring your own HTTPX client (proxies, limits, event hooks…). You keep ownership of it.
http_client = httpx.Client(proxy="http://localhost:8080")
client = PriceBellClient(http_client=http_client)

Endpoints

14 methods, generated from the OpenAPI document, plus clear_target_price().

Method HTTP Description
check_product() POST /products/{id}/check Asks for a check right away (1 credit), at most once per 5 minutes; earlier calls return the product unchanged. A paused product has to be…
compare_regions() GET /products/{id}/compare The same product tracked in several countries, cheapest first: each country's local price, the price converted into the comparison's curren…
clear_target_price() PATCH /products/{id} Removes the target price: sends {"target_price": null}.
delete_product() DELETE /products/{id} Removes the product and its price history.
get_account() GET /account Your plan, the credits left (monthly allowance and packs), how many products you track and the credits they use per month, the credits each…
get_google_product_history() GET /history Every price PriceBell read for a product ID on a marketplace over the period, whoever tracks it, oldest first, with the lowest, highest and…
get_product() GET /products/{id} The product's latest state and every price read of the period, oldest first. The history covers every read of this product ID on this marke…
get_sellers() GET /products/{id}/sellers The sellers of a tracked product at its latest check, cheapest first: each offer that is the product as sold new (accessories, used, refurb…
leave_comparison() DELETE /products/{id}/compare The product leaves its comparison and stays tracked on its own.
list_products() GET /products Your watchlist, newest first, with each product's latest state and its recent prices (trend). Filter with google_product_id (and marketplac…
search_google_shopping() GET /search Google Shopping search results (sponsored included), to find the product ID of a product. Free, limited to 30 searches per hour.
track_in_regions() POST /products/{id}/compare Tracks the same product in other countries, each one a product of your watchlist (its own checks and credits, within your plan's product li…
track_product() POST /products Adds a product ID or a Google Shopping link to your watchlist. A product ID alone works only for a product PriceBell already knows in that…
update_comparison() PATCH /products/{id}/compare The currency prices are converted into, and the "cheaper in another country" alert: an email (and chat channels) when another country's con…
update_product() PATCH /products/{id} Target price, drop alerts, check interval, or pause. Send only what changes. On the free plan, alerts (price drop, offered again, target pr…

All PriceBell SDKs

SDK Package Install
Node.js @pricebell/sdk npm install @pricebell/sdk
Python pricebell pip install pricebell
Go pricebell-go go get github.com/pricebelldev/pricebell-go
.NET PriceBell dotnet add package PriceBell
Ruby pricebell gem install pricebell
PHP pricebell/sdk composer require pricebell/sdk
Java pricebell-java build from source, see its README
CLI @pricebell/cli npm install -g @pricebell/cli
MCP server @pricebell/mcp npx -y @pricebell/mcp

Trademarks

Google and Google Shopping are trademarks of Google LLC. PriceBell is not affiliated with, endorsed or sponsored by Google.

License

MIT — see LICENSE.

Metadata

Release files for pricebell 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 pricebell 0.1.0
File Size Uploaded Provenance Actions
pricebell-0.1.0.tar.gz 20.6 kB Without provenance Details for pricebell-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 41.0 kB

Release files / pricebell-0.1.0.tar.gz

Download URL pricebell-0.1.0.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
eba603d8e1b9cb1422c7e38a4d0f30dffc7073823c30da0f985200381f62b80b
BLAKE2b-256 checksum
How to use checksums
49315dda1e3a3f770f25635ea18d0677f4a4445f2f13b488ceaad61020800aa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

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

Download URL pricebell-0.1.0-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96c5ed91cef704a37e724099ce92261f80d490ded30a62f409afefb241a4ab48
BLAKE2b-256 checksum
How to use checksums
416319f670c28a46b661fabc419b497ae04ce64b6a1931fe93f3a8da47934527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for pricebell 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No 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