> Documentation index: https://docs.scrapier.io/llms.txt
> Auth: header `X-API-Key: <key>` · Base: https://api.scrapier.io/api/v2 · Synchronous; paginate with `cursor` ← `data.next_cursor`.

# Target Category

Structured Target data: send `urls`. Cursor-paginated, 1 credit per successful call.

`GET|POST https://api.scrapier.io/api/v2/target-category/` · 1 credit per successful call · Cursor-paginated

## Overview

Call `GET /api/v2/target-category/` with `urls`. The results are in `data.products`; send `data.next_cursor` back as `cursor` to get the next page. 6 optional parameters refine the call (see Parameters).

## Request

```bash
curl -G "https://api.scrapier.io/api/v2/target-category/" \
  -H "X-API-Key: YOUR_API_KEY" \
  --data-urlencode "urls=https://www.target.com/c/kitchen-dining/-/N-hz89j" \
  --max-time 210
```

```python
import requests

resp = requests.get(
    "https://api.scrapier.io/api/v2/target-category/",
    headers={"X-API-Key": "YOUR_API_KEY"},
    params={"urls": "https://www.target.com/c/kitchen-dining/-/N-hz89j"},
    timeout=210,
)
body = resp.json()
if not resp.ok:
    raise RuntimeError(body.get("error") or body.get("detail"))

print(body["data"]["products"])
```

POST with a JSON body works too (same parameters; the body is merged over the query string).

## Parameters

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `X-API-Key` (header) | string | yes | — | Your API key. |
| `urls` | string | yes | e.g. `https://www.target.com/c/kitchen-dining/-/N-hz89j` | Target category URL or bare category id. Required first call. |
| `cursor` | string | no | — | Pagination cursor returned in the previous response's `next_cursor`. Pass it back unchanged to fetch the next page. When `next_cursor` is null, you have reached the last page. |
| `sort_by` | string | no | `featured` | One of: `featured`, `price_low`, `price_high`, `rating`, `bestselling`, `newest`. Locked in cursor. |
| `store_id` | string | no | `3991` | Locked in cursor. |
| `zip` | string | no | `55403` | Availability store ZIP. Locked in cursor. |
| `enrich_details` | boolean | no | `true` | Locked in cursor. |
| `include_sponsored` | boolean | no | `false` | Locked in cursor. |
| `use_proxy` | boolean | no | `true` | Route the request through Scrapier's residential proxy pool. Default: `true`. Leave as is unless support tells you otherwise. |
| `raw_data` | boolean | no | `false` | When true, the response carries the full raw upstream payload(s) the scraper received (GraphQL / JSON API bodies, HTML, embedded JSON-LD -- exactly as the platform returned them) under `raw_responses`, in place of the formatted items. When false (default) you get the formatted output. Pagination (`cursor` / `next_cursor`) works the same in both modes. |

## Response

HTTP 200. Results are in `data.products`. Sample from the live catalog, arrays trimmed to 3 items.

```json
{
  "success": true,
  "data": {
    "urls": "https://www.target.com/c/kitchen-dining/contigo/-/N-hz89jZ5v3gb",
    "category_id": "hz89j",
    "page": 1,
    "page_size": 24,
    "total_results": 66,
    "products": [
      {
        "input_url": "https://www.target.com/c/kitchen-dining/contigo/-/N-hz89jZ5v3gb",
        "category_id": "hz89j",
        "facets": "5v3gb",
        "position": 2,
        "page": 1,
        "id": "1004801191",
        "url": "https://www.target.com/p/contigo-cortland-chill-2-0-24oz-stainless-steel-water-bottle-with-autoseal-lid/-/A-1004801191",
        "title": "Contigo Cortland Chill 2.0, 24 oz, Stainless Steel Water Bottle with AUTOSEAL Lid",
        "description": "Press, sip, and seal your way to better hydration. The AUTOSEAL Stainless Steel Water Bottle lets you sip easily with just the push of a button...",
        "seller": "CPGIO",
        "brand": "Contigo",
        "price": {
          "current": 28.49,
          "original": 35,
          "currency": "USD"
        },
        "rating": {
          "average": 4.86,
          "count": 34
        },
        "image_urls": [
          "https://target.scene7.com/is/image/Target/GUEST_779483a4-5e59-473e-93cc-3445e4d35511"
        ],
        "availability": "IN_STOCK",
        "reviews_count": 32,
        "features": [
          "Push AUTOSEAL button for 100% spill-proof one-handed drinking; spout automatically seals when button is released",
          "Double-wall vacuum-insulated stainless steel keeps drinks cold for 24 hours and hot for 6 hours"
        ],
        "scraped_at": "2026-09-23T11:29:59.623Z"
      }
    ],
    "next_cursor": "eyJjIjoiaHo4OWoiLCJmIjoiNXYzZ2IiLCJuIjoyNCwibnAiOjIsInAiOjJ9"
  }
}
```

## Response fields

| Field | Type | Example | Description |
|---|---|---|---|
| `urls` | string | `https://www.target.com/c/kitchen-dining/conti…` |  |
| `category_id` | string | `hz89j` |  |
| `page` | integer | `1` |  |
| `page_size` | integer | `24` |  |
| `total_results` | integer | `66` |  |
| `products` | array | `[1 item]` | The results. |
| `next_cursor` | string | `eyJjIjoiaHo4OWoiLCJmIjoiNXYzZ2IiLCJuIjoyNCwib…` | Pass back as `cursor` for the next page. `null` on the last page. |
| `products[].input_url` | string | `https://www.target.com/c/kitchen-dining/conti…` |  |
| `products[].category_id` | string | `hz89j` |  |
| `products[].facets` | string | `5v3gb` |  |
| `products[].position` | integer | `2` |  |
| `products[].page` | integer | `1` |  |
| `products[].id` | string | `1004801191` |  |
| `products[].url` | string | `https://www.target.com/p/contigo-cortland-chi…` |  |
| `products[].title` | string | `Contigo Cortland Chill 2.0, 24 oz, Stainless …` |  |
| `products[].description` | string | `Press, sip, and seal your way to better hydra…` |  |
| `products[].seller` | string | `CPGIO` |  |
| `products[].brand` | string | `Contigo` |  |
| `products[].price` | object | `{…}` |  |
| `products[].rating` | object | `{…}` |  |
| `products[].image_urls` | array | `[1 item]` |  |
| `products[].availability` | string | `IN_STOCK` |  |
| `products[].reviews_count` | integer | `32` |  |
| `products[].features` | array | `[2 items]` |  |
| `products[].scraped_at` | string | `2026-09-23T11:29:59.623Z` |  |

## Pagination

Pass `data.next_cursor` back as `cursor` until it is `null`. Required inputs are ignored once a cursor is sent. Each page is one billed call.

```python
import requests

URL = "https://api.scrapier.io/api/v2/target-category/"
HEADERS = {"X-API-Key": "YOUR_API_KEY"}
params = {"urls": "https://www.target.com/c/kitchen-dining/-/N-hz89j"}
items = []

for _ in range(10):  # each page is one billed call
    resp = requests.get(URL, headers=HEADERS, params=params, timeout=210)
    resp.raise_for_status()
    data = resp.json()["data"]
    items.extend(data.get("products") or [])
    if not data.get("next_cursor"):  # None = last page
        break
    params = {"cursor": data["next_cursor"]}
```

## Errors

Failed calls are free. Branch on HTTP status; the message is in `error` (or `detail`). See https://docs.scrapier.io/errors.md

- **400** Bad input. The exact message varies by endpoint. `{"success":false,"error":"…"}`
- **402** Balance below the endpoint's price. `{"error":"Insufficient credits. Buy more to scrape more.","balance":1,"required":2}`
- **403** Invalid or unknown API key. `{"detail":"Authentication service unavailable or invalid API key."}`
- **429** Throttled — wait for Retry-After. `{"detail":"Request was throttled. Expected available in N seconds."}`
- **404** unknown slug · **503** busy (retry after `Retry-After`) · **5xx** upstream failure or timeout (retry with backoff).

## Notes

- Locked into the cursor: `sort_by`, `store_id`, `zip`, `enrich_details`, `include_sponsored`. Set them on the first call; later pages reuse them.

## Related

- [Target Reviews](https://docs.scrapier.io/api-reference/target/target-reviews.md): Structured Target data: send `urls`. Cursor-paginated, 1 credit per successful call.
- [Target Search Products](https://docs.scrapier.io/api-reference/target/target-search-products.md): Structured Target data: send `queries`. Cursor-paginated, 1 credit per successful call.
- [Target Single Product Info](https://docs.scrapier.io/api-reference/target/target-single-product-info.md): Structured Target data: send `urls`. Single lookup, 1 credit per successful call.
- [Target Stores](https://docs.scrapier.io/api-reference/target/target-stores.md): Structured Target data: send `queries`. Cursor-paginated, 1 credit per successful call.
