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.
POST
https://api.sandbase.ai/v1/api/target/searchModel ID
target/search01
Input Schema
12 parameters · 1 required · 11 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
q | stringnumberboolean | Required | The 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`). |
page | stringnumberboolean | Optional | Value 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. |
sort | union | Optional | The 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`. |
facet | stringnumberboolean | Optional | The 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. |
spelling | union | Optional | Whether 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_id | stringnumberboolean | Optional | The 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_price | stringnumberboolean | Optional | The maximum price of the products, in US dollars (e.g., `50`). |
min_price | stringnumberboolean | Optional | The minimum price of the products, in US dollars (e.g., `10`). |
category_id | stringnumberboolean | Optional | The 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_zip | stringnumberboolean | Optional | The 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_filters | union | Optional | Whether 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_restrictor | stringnumberboolean | Optional | The 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
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom 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());