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

target/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/target/search
Model IDtarget/search
01

Input Schema

12 parameters · 1 required · 11 optional

ParameterTypeRequiredDescription
qstringnumberbooleanRequiredThe query you want to search. You can use anything that you would use in a regular Target search (e.g., `coffee`, `65 inch tv`, or `lego star wars`).
pagestringnumberbooleanOptionalValue is used to get results on a specific page. (e.g., `1` (default) is the first page of results, `2` is the 2nd page of results, `3` is the 3rd page of results, etc.). Target returns up to 24 results per page, plus sponsored products, and up to 50 pages.
sortunionOptionalThe sorting of the results. It defaults to `relevance`. Available options: `relevance` - Relevance `featured` - Featured `price_low` - Price: low to high `price_high` - Price: high to low `rating_high` - Guest rating `best_seller` - Bestselling `newest` - Newest Target only shows sponsored products when results are sorted by `relevance`.
facetstringnumberbooleanOptionalThe filters to apply, like Target's filters (e.g., deals, brands, sizes, colors, or guest ratings). It's a comma-separated list of filter IDs (e.g., `5tdv0,4yagy` for Sale and Dark Roast). Filter IDs are available in `filters[].options[].id` of the results when `include_filters` is set to `true`. Like on Target, a search without filters can be filtered automatically by Target (e.g., Brand: LEGO for `lego`), as shown in `applied_filters`. Setting `facet` replaces these filters with yours.
spellingunionOptionalWhether to fix the spelling of misspelled queries, like Target. It can be set to `true` (default) to search for the spelling fix (e.g., `coffee` for `cofee`), as shown in `search_information.spelling_fix`, or `false` to search for the query as typed, like Target's Search instead for link.
store_idstringnumberbooleanOptionalThe Target store to get prices and availability for, like the store selected on Target (e.g., `1375` for Mpls Nicollet Mall, MN). The store ID is the number at the end of the store's page URL on Target (e.g., `https://www.target.com/sl/mpls-nicollet-mall/1375`). It defaults to `1771` (Cedar Rapids South, IA), the store Target uses when it can't locate the visitor.
max_pricestringnumberbooleanOptionalThe maximum price of the products, in US dollars (e.g., `50`).
min_pricestringnumberbooleanOptionalThe minimum price of the products, in US dollars (e.g., `10`).
category_idstringnumberbooleanOptionalThe category to search in (e.g., `hz89j` for Kitchen & Dining). Category IDs are available in the `Category` filter of the results when `include_filters` is set to `true`.
delivery_zipstringnumberbooleanOptionalThe US ZIP code to deliver to (e.g., `10001`). It's used for the shipping dates and the same day delivery availability. It defaults to the location of the store.
include_filtersunionOptionalWhether to include the `filters` of the search in the JSON response, with the IDs to use in `facet` and `category_id`. It can be set to `true` or `false` (default).
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/target/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());