> ## Documentation Index
> Fetch the complete documentation index at: https://docs.querying.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Target API

> Search Target and read its product pages as JSON: ranked products with prices, ratings, review counts and brands, and each product's price, images and specs.

Search Target (target.com) and read its product pages through the async task API. Send `COMMERCE_SERP` with `site` `target` to get the products a search shows, in the store's order, or `COMMERCE_PRODUCT` with a product's `url` to read that product. A completed search or product page costs **0.5 credits**.

## Search

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "COMMERCE_SERP", "payload": { "site": "target", "query": "wireless earbuds", "limit": 3 } }'
```

Submit the task, then poll `GET /v1/async/task/{id}` or receive its webhook. See [Async tasks](https://docs.querying.ai/concepts/async-tasks.md).

### Parameters

* `site`: Required. `target`.
* `query`: Required. The search query, 1-500 characters.
* `limit`: Optional integer from 1 to 40, default 20.
* `country`: Optional. Defaults to `US`, the store's country. Any other country is rejected with `422 REGION_UNSUPPORTED`.

Only the payload fields listed above are accepted. Omit `include`: even `include: {}` returns `422 VALIDATION_ERROR` on `payload.include` before credits are held.

### Response example

```json theme={"theme":"css-variables"}
{
  "site": "target",
  "query": "wireless earbuds",
  "country": "US",
  "returnedCount": 3,
  "products": [
    {
      "rank": 1,
      "productId": "92146817",
      "title": "Beats Solo Buds True Wireless Bluetooth Earbuds - Matte Black",
      "url": "https://www.target.com/p/beats-solo-buds-true-wireless-bluetooth-earbuds-matte-black/-/A-92146817",
      "price": 69.99,
      "currency": "USD",
      "rating": 3.38,
      "reviewCount": 2063,
      "brand": "Beats",
      "imageUrl": "https://target.scene7.com/is/image/Target/GUEST_4c9ad2a5-f3cb-46c1-97f4-cb5af248b57a"
    },
    {
      "rank": 2,
      "productId": "94779264",
      "title": "JLab Go Pods ANC True Wireless Earbuds - Lilac",
      "url": "https://www.target.com/p/jlab-go-pods-anc-true-wireless-earbuds-lilac/-/A-94779264",
      "price": 24.99,
      "currency": "USD",
      "rating": 4.54,
      "reviewCount": 7036,
      "brand": "JLab",
      "imageUrl": "https://target.scene7.com/is/image/Target/GUEST_f0740fb3-606a-4249-a680-5e08bb3af7db"
    },
    {
      "rank": 3,
      "productId": "94602814",
      "title": "JBL Vibe Beam 2 True Wireless Noise Cancelling Earbuds - Black",
      "url": "https://www.target.com/p/jbl-vibe-beam-2-black/-/A-94602814",
      "price": 39.99,
      "currency": "USD",
      "rating": 3.66,
      "reviewCount": 321,
      "brand": "JBL",
      "imageUrl": "https://target.scene7.com/is/image/Target/GUEST_3597759f-b3f0-4408-ab7e-54ce245ca68c"
    }
  ]
}
```

### Result fields

* `site`, `query` and `country` echo the request. `returnedCount` is the number of entries in `products`.
* Each product includes `rank`, `productId`, `title` and `url`. `productId` is the store's own product ID. `rank` follows the store's default order, and listings the store marks as sponsored are left out.
* `price`, `rating`, `reviewCount`, `imageUrl` and `brand` appear when the results page shows them. `price` is a number in the product's `currency` (ISO 4217); when sizes are priced apart, it is the lowest one. Target prices are those of its default online store.
* `rating` uses a five-point scale. Abbreviated review counts such as 999+ are left out.
* Each search returns products from the store's first results page. Target sends some searches to a related search, and the products come from that search.

## Product page

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "COMMERCE_PRODUCT", "payload": { "url": "https://www.target.com/p/beats-solo-buds-true-wireless-bluetooth-earbuds-matte-black/-/A-92146817" } }'
```

### Parameters

* `url`: Required. A product page on Target, up to 2,048 characters: `target.com/p/{name}/-/A-{TCIN}`. Product `url` values from a search work as they are. Parameters the result does not depend on, such as tracking codes, are dropped before the page is read.
* `country`: Optional. Defaults to `US`, the page's country. Any other country is rejected with `422 REGION_UNSUPPORTED`.

Only the payload fields listed above are accepted. Omit `include`: even `include: {}` returns `422 VALIDATION_ERROR` on `payload.include` before credits are held.

### Response example

```json theme={"theme":"css-variables"}
{
  "site": "target",
  "country": "US",
  "url": "https://www.target.com/p/beats-solo-buds-true-wireless-bluetooth-earbuds-matte-black/-/A-92146817",
  "productId": "92146817",
  "title": "Beats Solo Buds True Wireless Bluetooth Earbuds",
  "brand": "Beats",
  "price": 69.99,
  "currency": "USD",
  "rating": 3.38,
  "reviewCount": 2063,
  "images": [
    "https://target.scene7.com/is/image/Target/GUEST_81453bad-a6fd-4637-a103-5e10ec03312c",
    "https://target.scene7.com/is/image/Target/GUEST_890621b7-d286-4b0e-9d4a-a6379f311e5d"
  ],
  "description": "New",
  "specs": [
    { "name": "Weight", "value": ".01 Pounds" },
    { "name": "Water Resistance", "value": "No Water Resistance Rating" },
    { "name": "Ear Cushion Material", "value": "Silicone" }
  ],
  "categories": ["Electronics & Tech", "Headphones", "Earbuds", "Wireless Earbuds"]
}
```

### Result fields

* `site`, `country`, `url` and `productId` identify the page. `url` is the page that was read, and `productId` matches the one a search returns.
* `title` is always present. `brand`, `price`, `listPrice`, `currency`, `rating`, `reviewCount`, `images`, `description`, `specs`, `categories` and `gtin` appear when the page shows them.
* `price` is what a shopper pays as the page first shows it, before coupons and delivery, in `currency` (ISO 4217). `listPrice` is the regular price the page strikes through, present when it is above `price`.
* `rating` uses a five-point scale with two decimals. `reviewCount` is the number of reviews.
* `images` lists up to 30 photos from the product's gallery, in page order.
* `description` is plain text with one line per paragraph, up to 10,000 characters; text that appears only inside images is not included.
* `specs` lists up to 100 `{ name, value }` pairs from the product details. `categories` runs from the broadest category to the narrowest, up to 10 levels. `gtin` is the UPC, EAN or JAN the page lists.

## Errors and billing

* A search that returns no products ends as a failed task.
* A product page the store answers with 404 or 410, such as a removed product, ends the task with `PAGE_UNAVAILABLE`, and the message carries the store's answer. When the store refuses the read with 403, 412, 429 or 435, the task waits and asks again for up to 6 minutes. Other failed reads, and a refusal that lasts longer, end with `ENGINE_NO_RESULT`.
* Only completed tasks are charged: 0.5 credits for a search or a product page.

## Related

* [Amazon](https://docs.querying.ai/engines/amazon.md)
* [Walmart](https://docs.querying.ai/engines/walmart.md)
* [eBay](https://docs.querying.ai/engines/ebay.md)
* [All Commerce stores](https://docs.querying.ai/engines/overview.md#commerce)
* [Credits and limits](https://docs.querying.ai/concepts/credits-and-limits.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.