AI City Remix$11,500 prize pool. Pick a city, let AI tell its story, Oct 22 – 28.Join now
API reference · Google Shopping

google-shopping/search

Integrate this model through SandBase's unified API, with production-ready schemas and examples.

Production endpoint

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

POSThttps://api.sandbase.ai/v1/api/google-shopping/search
Model IDgoogle-shopping/search
01

Input Schema

16 parameters · 1 required · 15 optional

ParameterTypeRequiredDescription
qstringnumberbooleanRequiredThe query you want to search. You can use anything that you would use in a regular Google Shopping search. This parameter is optional if using `shoprs` parameter.
glstringnumberbooleanOptionalThe country to use for the Google search. It's a two-letter country code. (e.g., `us` for the United States, `uk` for United Kingdom, or `fr` for France) Head to the Google Shopping countries for a full list of supported Google Shopping countries.
hlstringnumberbooleanOptionalThe language to use for the Google Shopping search. It's a two or three-letter language code. (e.g., `en` for English, `es` for Spanish, or `fr` for French), optionally followed by a two-letter or three-digit region code (e.g., `en-gb` for British English, or `es-419` for Latin American Spanish).
safestringnumberbooleanOptionalThe level of filtering for adult content. It can be set to `active` or `off`, by default Google will omit explicit content.
uulestringnumberbooleanOptionalThe Google encoded location you want to use for the search. `uule` and `location` parameters can't be used together. For consistent results with coordinates-based `uule` parameter, a matching `gl` parameter is required. Head to UULE Generator if you need to convert a location or GPS coordinates to `uule` parameter, and vice versa.
startstringnumberbooleanOptionalIntended to define the result offset for pagination. Google Shopping's current layout does not support offset pagination: the `start` parameter is ignored and every request returns the first page of results (around 40 items). The `num` parameter is still accepted and forwarded to Google, but the current layout returns a fixed page size, so it does not change the number of results returned.
devicestringnumberbooleanOptionalThe device to use to get the results. It can be set to `desktop` (default) to use a regular browser, `tablet` to use a tablet browser (currently using iPads), or `mobile` to use a mobile browser.
shoprsstringnumberbooleanOptionalThe parameter defines the token that includes metadata about query and search filter(s). Providing `q` parameter alongside the `shoprs` is **not** required. To apply multiple filters join them with `||` separator, e.g. `shoprs_1||shoprs_2||shoprs_3`.
on_salestringnumberbooleanOptionalShow only products that are on sale. This parameter overrides corresponding filter embedded into `shoprs` parameter.
sort_byunionOptionalThe sorting order of the results. Available options: `1` - Price: low to high `2` - Price: high to low This parameter overrides corresponding filter embedded into `shoprs` parameter.
max_pricestringnumberbooleanOptionalUpper bound of price range query. This parameter overrides corresponding filter embedded into `shoprs` parameter.
min_pricestringnumberbooleanOptionalLower bound of price range query. This parameter overrides corresponding filter embedded into `shoprs` parameter.
free_shippingstringnumberbooleanOptionalShow only products with free shipping. This parameter overrides corresponding filter embedded into `shoprs` parameter.
google_domainstringnumberbooleanOptionalThe Google domain to use. It defaults to `google.com`. Head to the Google domains for a full list of supported Google domains.
small_businessstringnumberbooleanOptionalShow only products from small business. This parameter overrides corresponding filter embedded into `shoprs` parameter.
json_restrictorstringnumberbooleanOptionalThe fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.
02

Output Schema

FieldTypeDescription
idstringUnique identifier for the generation task
statusstringTask status: pending, running, completed, failed, timeout
modelstringModel used for the generation
outputsarrayArray of output items
outputs[].urlstringURL of the generated artifact
outputs[].content_typestringMIME type (e.g. image/png, video/mp4)
errorobject | nullError details if failed, null on success
error.typestringMachine-readable error type code
error.messagestringHuman-readable error description

Async Workflow

This model uses asynchronous execution. Submit a request and poll for the result.

  1. Submit — POST to /v1/run, receive an id
  2. Poll — GET /v1/run/{id} until status is completed, failed, or timeout
  3. Retrieve — Read outputs from the completed response
03

Code Examples

Ready-to-run snippets

const apiKey = process.env.SANDBASE_API_KEY;
const response = await fetch("https://api.sandbase.ai/v1/api/google-shopping/search", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});

if (!response.ok) throw new Error(await response.text());
console.log(await response.json());