pricebell

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2026 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

PriceBell Go SDK

The official Go 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, plus ClearTargetPrice() and a generic Request(). It has no dependencies outside the standard library.

Requirements

  • Go 1.22 or newer

Installation

go get github.com/pricebelldev/pricebell-go

Get your API key

Sign up for PriceBell or sign in, then copy your API key from the dashboard. NewClient("", nil) reads the PRICEBELL_API_KEY environment variable.

Quick start

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/pricebelldev/pricebell-go"
)

func main() {
	client, err := pricebell.NewClient("", nil) // reads PRICEBELL_API_KEY
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	response, err := client.SearchGoogleShopping(ctx, &pricebell.SearchGoogleShoppingParams{Query: "airpods pro 2"})
	if err != nil {
		log.Fatal(err)
	}
	data, err := response.Map()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(data)
}

Parameter structs mirror the API reference. Required fields are plain values; optional fields are pointers — use pricebell.String, pricebell.Float, pricebell.Int and pricebell.Bool.

Decode into your own types with response.Decode(&value).

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. Null values are never sent; to remove a product's target price, call client.ClearTargetPrice(ctx, id), which sends PATCH /products/{id} with {"target_price": null}.

Any endpoint

response, err := client.Request(ctx, "GET", "/account", nil)

Errors

response, err := client.SearchGoogleShopping(ctx, &pricebell.SearchGoogleShoppingParams{Query: "airpods pro 2"})
if apiError, ok := pricebell.IsAPIError(err); ok {
	log.Printf("HTTP %d %s: %s", apiError.StatusCode, apiError.Code, apiError.Message) // e.g. 402 rate_limited
}
Error When
*ConfigurationError Missing API key, invalid options or unsupported method.
*SerializationError A required parameter is missing or a value can't be sent.
*TransportError Network failure, timeout or cancelled context (errors.Is(err, context.DeadlineExceeded)).
*APIError Non-2xx status (StatusCode, Message, Code, Response). Code is the API's error.code, such as rate_limited, product_limit or not_found (empty when absent).
*ResponseDecodingError A success response could not be decoded.

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, err := pricebell.NewClient("", &pricebell.ClientOptions{
	MaxRetries: 5,                      // negative disables retries
	RetryDelay: 500 * time.Millisecond,
})

// or for one request
response, err := client.SearchGoogleShopping(ctx, &pricebell.SearchGoogleShoppingParams{Query: "airpods pro 2"}, pricebell.WithMaxRetries(0))

Batch requests

pricebell.Batch runs a function per item with at most 10 calls in flight and returns one BatchResult per item, in input order. A failing item never stops the others.

inputs := []string{"airpods pro 2", "nintendo switch 2", "dyson v15"}
results := pricebell.Batch(ctx, inputs, 5, func(ctx context.Context, value string) (*pricebell.Response, error) {
	return client.SearchGoogleShopping(ctx, &pricebell.SearchGoogleShoppingParams{Query: value})
})
for _, result := range results {
	if result.Err != nil {
		log.Printf("%s: %v", inputs[result.Index], result.Err)
		continue
	}
	fmt.Println(string(result.Value.Body))
}
Constant Default Description
DefaultConcurrency 10 Tasks run at the same time by batch
DefaultTimeout 120 * time.Second Request timeout
MaxRetries 3 Retry attempts after a network error, a 408/5xx
RetryBackoffFactor 1.5 Exponential backoff multiplier
DefaultRetryDelay time.Second Delay before the first retry

Timeouts and custom HTTP clients

client, err := pricebell.NewClient("", &pricebell.ClientOptions{
	Timeout:    60 * time.Second, // default 120 s; negative disables
	HTTPClient: &http.Client{Transport: myTransport},
})

Every method also honours the deadline and cancellation of the context.Context you pass.

Endpoints

14 methods, generated from the OpenAPI document, and ClearTargetPrice.

Method HTTP Description
CheckProduct 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…
CompareRegions 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…
ClearTargetPrice PATCH /products/{id} Removes the product's target price: sends {"target_price": null}, which UpdateProduct cannot.
DeleteProduct DELETE /products/{id} Removes the product and its price history.
GetAccount 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…
GetGoogleProductHistory 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…
GetProduct 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…
GetSellers 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…
LeaveComparison DELETE /products/{id}/compare The product leaves its comparison and stays tracked on its own.
ListProducts GET /products Your watchlist, newest first, with each product's latest state and its recent prices (trend). Filter with google_product_id (and marketplac…
SearchGoogleShopping GET /search Google Shopping search results (sponsored included), to find the product ID of a product. Free, limited to 30 searches per hour.
TrackInRegions 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…
TrackProduct 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…
UpdateComparison 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…
UpdateProduct 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.

Documentation

Overview

Package pricebell is the official Go SDK for the PriceBell API (https://www.pricebell.dev).

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

Create one client and reuse it:

client, err := pricebell.NewClient("", nil) // reads PRICEBELL_API_KEY
response, err := client.SearchGoogleShopping(ctx, ...)

Every documented endpoint has a typed method; Client.Request reaches any other path.

Index

Constants

View Source
const (
	// DefaultBaseURL is the production API origin.
	DefaultBaseURL = "https://www.pricebell.dev/api/v1"
	// DefaultTimeout bounds every request unless ClientOptions.Timeout says otherwise.
	DefaultTimeout = 120 * time.Second
	// APIKeyEnvironmentVariable is read when NewClient receives an empty API key.
	APIKeyEnvironmentVariable = "PRICEBELL_API_KEY"
	// DefaultConcurrency is the number of tasks Batch runs at the same time.
	DefaultConcurrency = 10
	// MaxRetries is the default number of retries after a network error or a 408, 500, 502, 503 or 504.
	MaxRetries = 3
	// RetryBackoffFactor multiplies the delay before each new retry (a Retry-After header wins).
	RetryBackoffFactor = 1.5
	// DefaultRetryDelay is the delay before the first retry.
	DefaultRetryDelay = time.Second
	// MaxRetryDelay caps the delay between two attempts.
	MaxRetryDelay = 30 * time.Second
)
View Source
const Version = "0.1.0"

Version is the SDK version sent in the User-Agent header.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool returns a pointer to v, for optional boolean parameters.

func Float

func Float(v float64) *float64

Float returns a pointer to v, for optional number parameters.

func Int

func Int(v int64) *int64

Int returns a pointer to v, for optional integer parameters.

func String

func String(v string) *string

String returns a pointer to v, for optional parameters.

Types

type APIError

type APIError struct {
	StatusCode int
	// Message is the "error" (or "message") field of the JSON body, when present.
	Message string
	// Code is the API's error code (the "code" of {"error": {"code", "message"}}), such as
	// "rate_limited" or "product_limit"; empty when the body has none.
	Code     string
	Response *Response
}

APIError is returned for non-2xx responses.

func IsAPIError

func IsAPIError(err error) (*APIError, bool)

IsAPIError reports whether err is an *APIError and returns it.

func (*APIError) Error

func (e *APIError) Error() string

type BatchResult

type BatchResult[T any] struct {
	Index int
	Value T
	Err   error
}

BatchResult is the outcome of one Batch item.

func Batch

func Batch[I, T any](ctx context.Context, items []I, concurrency int, task func(ctx context.Context, item I) (T, error)) []BatchResult[T]

Batch runs task for every item with at most concurrency calls in flight (DefaultConcurrency when concurrency <= 0) and returns one result per item, in input order. A failing item never stops the others; items not started when ctx is done get ctx.Err().

type CheckProductParams

type CheckProductParams struct {
	// product_id returned when the product was added
	ID string `json:"id" api:"id,required"`
	// Answer once the check is done (up to 45 seconds) Default: false.
	Wait *bool `json:"wait" api:"wait"`
}

CheckProductParams holds the parameters of CheckProduct (POST /products/{id}/check). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a reusable, concurrency-safe PriceBell API client.

func NewClient

func NewClient(apiKey string, options *ClientOptions) (*Client, error)

NewClient creates a client. An empty apiKey falls back to the PRICEBELL_API_KEY environment variable.

func (*Client) CheckProduct

func (c *Client) CheckProduct(ctx context.Context, params *CheckProductParams, options ...RequestOption) (*Response, error)

CheckProduct — Check the price now. 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 resumed first. The check runs in the background; with wait=true the answer waits for it. Read last_e…

POST /products/{id}/check

func (*Client) ClearTargetPrice

func (c *Client) ClearTargetPrice(ctx context.Context, id string, options ...RequestOption) (*Response, error)

ClearTargetPrice — Remove the target price of a product. UpdateProduct never sends null, so it cannot do this.

PATCH /products/{id} with the body {"target_price": null}

func (*Client) CompareRegions

func (c *Client) CompareRegions(ctx context.Context, params *CompareRegionsParams, options ...RequestOption) (*Response, error)

CompareRegions — Compare a product across countries. The same product tracked in several countries, cheapest first: each country's local price, the price converted into the comparison's currency, and how much dearer it is than the cheapest (gap_percent). home is the country the comparison st…

GET /products/{id}/compare

func (*Client) DeleteProduct

func (c *Client) DeleteProduct(ctx context.Context, params *DeleteProductParams, options ...RequestOption) (*Response, error)

DeleteProduct — Stop tracking a product. Removes the product and its price history.

DELETE /products/{id}

func (*Client) GetAccount

func (c *Client) GetAccount(ctx context.Context, options ...RequestOption) (*Response, error)

GetAccount — Plan and remaining credits. Your plan, the credits left (monthly allowance and packs), how many products you track and the credits they use per month, the credits each alert email costs, the days of history you can read and, on the free plan, the API and MCP requests…

GET /account

func (*Client) GetGoogleProductHistory

func (c *Client) GetGoogleProductHistory(ctx context.Context, params *GetGoogleProductHistoryParams, options ...RequestOption) (*Response, error)

GetGoogleProductHistory — Price history of any product ID. Every price PriceBell read for a product ID on a marketplace over the period, whoever tracks it, oldest first, with the lowest, highest and average of those prices. A price the store gave in another currency than the marketplace's isn't pa…

GET /history

func (*Client) GetProduct

func (c *Client) GetProduct(ctx context.Context, params *GetProductParams, options ...RequestOption) (*Response, error)

GetProduct — Get a product and its price history. 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 marketplace, including those made before you added it, so a product added today can come with months of p…

GET /products/{id}

func (*Client) GetSellers

func (c *Client) GetSellers(ctx context.Context, params *GetSellersParams, options ...RequestOption) (*Response, error)

GetSellers — Get a product's sellers. The sellers of a tracked product at its latest check, cheapest first: each offer that is the product as sold new (accessories, used, refurbished and rental offers, copies and multipacks are left out by the check), who sells it, its price a…

GET /products/{id}/sellers

func (*Client) LeaveComparison

func (c *Client) LeaveComparison(ctx context.Context, params *LeaveComparisonParams, options ...RequestOption) (*Response, error)

LeaveComparison — Take a product out of its comparison. The product leaves its comparison and stays tracked on its own.

DELETE /products/{id}/compare

func (*Client) ListProducts

func (c *Client) ListProducts(ctx context.Context, params *ListProductsParams, options ...RequestOption) (*Response, error)

ListProducts — List tracked products. Your watchlist, newest first, with each product's latest state and its recent prices (trend). Filter with google_product_id (and marketplace) to know if a product is tracked, or with filter to get the same lists as the app's tabs.

GET /products

func (*Client) Request

func (c *Client) Request(ctx context.Context, method, path string, params map[string]any, options ...RequestOption) (*Response, error)

Request sends any request, including endpoints released after this SDK version. GET parameters travel in the query string; POST parameters travel in a JSON body.

func (*Client) SearchGoogleShopping

func (c *Client) SearchGoogleShopping(ctx context.Context, params *SearchGoogleShoppingParams, options ...RequestOption) (*Response, error)

SearchGoogleShopping — Search Google Shopping. Google Shopping search results (sponsored included), to find the product ID of a product. Free, limited to 30 searches per hour.

GET /search

func (*Client) TrackInRegions

func (c *Client) TrackInRegions(ctx context.Context, params *TrackInRegionsParams, options ...RequestOption) (*Response, error)

TrackInRegions — Also track a product in other countries. Tracks the same product in other countries, each one a product of your watchlist (its own checks and credits, within your plan's product limit: all of them fit, or none is added), searched there with the product's title, with its drop aler…

POST /products/{id}/compare

func (*Client) TrackProduct

func (c *Client) TrackProduct(ctx context.Context, params *TrackProductParams, options ...RequestOption) (*Response, error)

TrackProduct — Track a product. 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 country (a search result, or one added by its link before): otherwise send its Google Shopping link.…

POST /products

func (*Client) UpdateComparison

func (c *Client) UpdateComparison(ctx context.Context, params *UpdateComparisonParams, options ...RequestOption) (*Response, error)

UpdateComparison — Set the comparison's currency and alert. The currency prices are converted into, and the "cheaper in another country" alert: an email (and chat channels) when another country's converted price is at least alert_percent below home's, once when it gets there, then again only after…

PATCH /products/{id}/compare

func (*Client) UpdateProduct

func (c *Client) UpdateProduct(ctx context.Context, params *UpdateProductParams, options ...RequestOption) (*Response, error)

UpdateProduct — Change alerts and checks. Target price, drop alerts, check interval, or pause. Send only what changes. On the free plan, alerts (price drop, offered again, target price) email for the first 5 products added among the active ones with an alert set; the others stay t…

PATCH /products/{id}

type ClientOptions

type ClientOptions struct {
	// BaseURL overrides DefaultBaseURL.
	BaseURL string
	// Timeout bounds each request. Zero uses DefaultTimeout; a negative value disables it.
	Timeout time.Duration
	// HTTPClient is copied and used for requests. Redirects are never followed.
	HTTPClient *http.Client
	// Headers are sent with every request.
	Headers map[string]string
	// MaxRetries overrides the number of retries. Zero uses MaxRetries; a negative value disables retries.
	MaxRetries int
	// RetryDelay is the delay before the first retry. Zero uses DefaultRetryDelay.
	RetryDelay time.Duration
}

ClientOptions configures a Client. The zero value is valid.

type CompareRegionsParams

type CompareRegionsParams struct {
	// product_id of any of the compared products
	ID string `json:"id" api:"id,required"`
	// Currency the prices are converted into; the comparison keeps the last one chosen (EUR or USD at first, after the account's language) Allowed values: EUR, USD, GBP.
	Currency *string `json:"currency" api:"currency"`
}

CompareRegionsParams holds the parameters of CompareRegions (GET /products/{id}/compare). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type ConfigurationError

type ConfigurationError struct {
	Message string
	Err     error
}

ConfigurationError reports a missing or unusable client configuration.

func (*ConfigurationError) Error

func (e *ConfigurationError) Error() string

func (*ConfigurationError) Unwrap

func (e *ConfigurationError) Unwrap() error

type DeleteProductParams

type DeleteProductParams struct {
	// product_id returned when the product was added
	ID string `json:"id" api:"id,required"`
}

DeleteProductParams holds the parameters of DeleteProduct (DELETE /products/{id}). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type GetGoogleProductHistoryParams

type GetGoogleProductHistoryParams struct {
	// Google Shopping product ID (the catalogid in a Google Shopping link)
	GoogleProductID string `json:"google_product_id" api:"google_product_id,required"`
	// Country whose Google Shopping results are read, in its currency, e.g. us (US): us (USD), gb (GBP), fr (EUR), de (EUR), es (EUR), it (EUR), nl (EUR), be (EUR), at (EUR), ch (CHF), ie (EUR), pt (EUR), pl (PLN), se (SEK), dk (DKK), no (NOK), fi (EUR), cz (CZK), hu (HUF), ro (RON), gr (EUR), ca (CAD),……
	Marketplace *string `json:"marketplace" api:"marketplace"`
	// History period in days. The free plan reads the last 30: history_days says which period was returned. Default: 90.
	Days *int64 `json:"days" api:"days"`
}

GetGoogleProductHistoryParams holds the parameters of GetGoogleProductHistory (GET /history). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type GetProductParams

type GetProductParams struct {
	// product_id returned when the product was added
	ID string `json:"id" api:"id,required"`
	// History period in days. The free plan reads the last 30: history_days says which period was returned. Default: 90.
	Days *int64 `json:"days" api:"days"`
}

GetProductParams holds the parameters of GetProduct (GET /products/{id}). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type GetSellersParams

type GetSellersParams struct {
	// product_id
	ID string `json:"id" api:"id,required"`
}

GetSellersParams holds the parameters of GetSellers (GET /products/{id}/sellers). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type LeaveComparisonParams

type LeaveComparisonParams struct {
	// product_id of any of the compared products
	ID string `json:"id" api:"id,required"`
}

LeaveComparisonParams holds the parameters of LeaveComparison (DELETE /products/{id}/compare). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type ListProductsParams

type ListProductsParams struct {
	// Only this product ID
	GoogleProductID *string `json:"google_product_id" api:"google_product_id"`
	// Only this Google Shopping store Allowed values: us, gb, fr, de, es, it, nl, be, at, ch, ie, pt, pl, se, dk, no, fi, cz, hu, ro….
	Marketplace *string `json:"marketplace" api:"marketplace"`
	// Only the products of one of the app's watchlist filters. all: Every tracked product (default). drops: Cheaper now than when the product was added. target: At or below its target price. out_of_stock: No offer at the last check. attention: The last check didn't go through (last_error is set): no cred…
	Filter *string `json:"filter" api:"filter"`
	// Page number Default: 1.
	Page *int64 `json:"page" api:"page"`
	// Products per page Default: 20.
	Limit *int64 `json:"limit" api:"limit"`
}

ListProductsParams holds the parameters of ListProducts (GET /products). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type RequestOption

type RequestOption func(*requestOptions)

RequestOption customizes one request.

func WithHeader

func WithHeader(name, value string) RequestOption

WithHeader adds a header to one request.

func WithMaxRetries

func WithMaxRetries(n int) RequestOption

WithMaxRetries overrides the number of retries for one request (0 disables them).

func WithMethod

func WithMethod(method string) RequestOption

WithMethod selects the HTTP method. Operations default to their own method.

type Response

type Response struct {
	StatusCode  int
	Header      http.Header
	ContentType string
	// Body holds the raw bytes: JSON text, or a file such as an image or PDF.
	Body []byte
	// IsJSON reports whether the body is JSON (Content-Type application/json or +json).
	IsJSON bool
}

Response is a buffered, successful API response.

func (*Response) Decode

func (r *Response) Decode(v any) error

Decode unmarshals a JSON body into v.

func (*Response) Map

func (r *Response) Map() (map[string]any, error)

Map decodes a JSON object body.

type ResponseDecodingError

type ResponseDecodingError struct {
	Message  string
	Response *Response
	Err      error
}

ResponseDecodingError reports a success response that could not be decoded.

func (*ResponseDecodingError) Error

func (e *ResponseDecodingError) Error() string

func (*ResponseDecodingError) Unwrap

func (e *ResponseDecodingError) Unwrap() error

type SearchGoogleShoppingParams

type SearchGoogleShoppingParams struct {
	// Keywords
	Query string `json:"query" api:"query,required"`
	// Country whose Google Shopping results are read, in its currency, e.g. us (US): us (USD), gb (GBP), fr (EUR), de (EUR), es (EUR), it (EUR), nl (EUR), be (EUR), at (EUR), ch (CHF), ie (EUR), pt (EUR), pl (PLN), se (SEK), dk (DKK), no (NOK), fi (EUR), cz (CZK), hu (HUF), ro (RON), gr (EUR), ca (CAD),……
	Marketplace *string `json:"marketplace" api:"marketplace"`
}

SearchGoogleShoppingParams holds the parameters of SearchGoogleShopping (GET /search). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type SerializationError

type SerializationError struct {
	Param   string
	Message string
	Err     error
}

SerializationError reports a parameter that is missing or cannot be sent.

func (*SerializationError) Error

func (e *SerializationError) Error() string

func (*SerializationError) Unwrap

func (e *SerializationError) Unwrap() error

type TrackInRegionsParams

type TrackInRegionsParams struct {
	// product_id of any of the compared products
	ID string `json:"id" api:"id,required"`
	// Countries (marketplace ids) to also track the product in Allowed values: us, gb, fr, de, es, it, nl, be, at, ch, ie, pt, pl, se, dk, no, fi, cz, hu, ro….
	Regions []string `json:"regions" api:"regions,required"`
	// Currency the prices are converted into; the comparison keeps the last one chosen (EUR or USD at first, after the account's language) Allowed values: EUR, USD, GBP.
	Currency *string `json:"currency" api:"currency"`
}

TrackInRegionsParams holds the parameters of TrackInRegions (POST /products/{id}/compare). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type TrackProductParams

type TrackProductParams struct {
	// product ID (6883422599141817139) or Google Shopping product link. A product ID alone works only for a product PriceBell already knows in that country (a search result, or one added by its link before): otherwise send its Google Shopping link.
	Product string `json:"product" api:"product,required"`
	// Country whose Google Shopping results are read, in its currency, e.g. us (US): us (USD), gb (GBP), fr (EUR), de (EUR), es (EUR), it (EUR), nl (EUR), be (EUR), at (EUR), ch (CHF), ie (EUR), pt (EUR), pl (PLN), se (SEK), dk (DKK), no (NOK), fi (EUR), cz (CZK), hu (HUF), ro (RON), gr (EUR), ca (CAD),……
	Marketplace *string `json:"marketplace" api:"marketplace"`
	// Email the owner when the price goes at or below this amount (on the free plan, for the first 5 products with an alert). null removes it.
	TargetPrice *float64 `json:"target_price" api:"target_price"`
	// Minutes between two checks (1440 = daily). Checks faster than daily need a plan or a credit pack: every 60 minutes with a pack or Starter, 30 with Pro, 30 with Business, 5 with Scale, 5 with Volume, 5 with Enterprise. Default: 1440.
	IntervalMinutes *int64 `json:"interval_minutes" api:"interval_minutes"`
	// Answer once the first check is done (up to 45 seconds) Default: false.
	Wait *bool `json:"wait" api:"wait"`
}

TrackProductParams holds the parameters of TrackProduct (POST /products). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type TransportError

type TransportError struct {
	Message string
	Err     error
}

TransportError reports a failure before a complete HTTP response was received, including client-side timeouts and context cancellation (see Unwrap).

func (*TransportError) Error

func (e *TransportError) Error() string

func (*TransportError) Unwrap

func (e *TransportError) Unwrap() error

type UpdateComparisonParams

type UpdateComparisonParams struct {
	// product_id of any of the compared products
	ID string `json:"id" api:"id,required"`
	// Currency the prices are converted into; the comparison keeps the last one chosen (EUR or USD at first, after the account's language) Allowed values: EUR, USD, GBP.
	Currency *string `json:"currency" api:"currency"`
	// Turn the alert on or off
	Alert *bool `json:"alert" api:"alert"`
	// How much cheaper, in %, another country has to be Default: 10.
	AlertPercent *int64 `json:"alert_percent" api:"alert_percent"`
}

UpdateComparisonParams holds the parameters of UpdateComparison (PATCH /products/{id}/compare). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

type UpdateProductParams

type UpdateProductParams struct {
	// product_id returned when the product was added
	ID string `json:"id" api:"id,required"`
	// Email the owner when the price goes at or below this amount (on the free plan, for the first 5 products with an alert). null removes it.
	TargetPrice *float64 `json:"target_price" api:"target_price"`
	// Minutes between two checks (1440 = daily). Checks faster than daily need a plan or a credit pack: every 60 minutes with a pack or Starter, 30 with Pro, 30 with Business, 5 with Scale, 5 with Volume, 5 with Enterprise.
	IntervalMinutes *int64 `json:"interval_minutes" api:"interval_minutes"`
	// Email when the price drops or the product is offered again (on the free plan, for the first 5 products with an alert)
	AlertOnDrop *bool `json:"alert_on_drop" api:"alert_on_drop"`
	// Stop checking (and charging) for now; false resumes, unless our team paused it (paused_by_team)
	Paused *bool `json:"paused" api:"paused"`
}

UpdateProductParams holds the parameters of UpdateProduct (PATCH /products/{id}). Required fields are plain values; optional fields are pointers (use pricebell.String, pricebell.Float, pricebell.Bool) or nil slices and maps.

Directories

Path Synopsis
examples
json command
request command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL