# Target Product Search API Documentation

<p><strong>Target Product Search API Documentation</strong> Search Target products. Each row has the tcin, title, brand, url, DPCI, item type, images, videos, price, regular price, save percent, rating, review count, promotions, spec lines and badges. Filter by price range, store and ZIP, sort by relevance, price, rating, best sellers or newest, and search inside a category. A page has 24 products and the page number in the answer always matches the page you asked for. A price range is checked on every row: no product outside the range is returned. A search text with no match returns an empty list and costs nothing. Target changes its ranking between calls, so a product can appear on two neighbouring pages. Add include_fulfillment=true with a zip to get shipping, pickup and store stock for every row. Cost: 3 credits per page, 4 with include_fulfillment. An empty result and every error cost nothing. A call takes 3 to 10 seconds.</p>

- **Documentation:** [https://scrappa.co/docs/target-api/target_search](https://scrappa.co/docs/target-api/target_search)
- **API group:** Target API
- **Endpoint:** `GET https://scrappa.co/api/target/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | Search text, 1 to 200 characters. Example: coffee maker. |
| `page` | integer | No | Page number, 1 to 50. Each page has 24 products. Default: 1. |
| `sort` | string | No | relevance, featured, price_low, price_high, rating_high, bestselling or newest. Default: relevance. |
| `min_price` | number | No | Lowest price in USD. Send it together with max_price. Rows outside the range are never returned. |
| `max_price` | number | No | Highest price in USD. Send it together with min_price. |
| `store_id` | string | No | Store number from the stores endpoint, e.g. 1375. Sets the store for price and stock. Store 3991 is not accepted. |
| `zip` | string | No | 5-digit US ZIP code. Without store_id, the nearest store of the ZIP is used. Required with include_fulfillment. |
| `category` | string | No | Target category id, e.g. 5xtb0, to search inside one category. An unknown id answers 422. |
| `include_fulfillment` | boolean | No | true to add shipping, pickup and store stock to every row. Needs a zip. Costs 4 credits. Default: false. |

## Example response

```json
{
    "data": {
        "query": "coffee maker",
        "facets": [
            {
                "id": "d_deals",
                "name": "Deals",
                "type": "checkbox",
                "options": [
                    {
                        "name": "Sale",
                        "value": "sale"
                    }
                ]
            }
        ],
        "results": [
            {
                "url": "https://www.target.com/p/example-coffee-maker/-/A-92538311",
                "dpci": "204-00-3429",
                "tcin": "92538311",
                "brand": "Example",
                "price": {
                    "current": 24.99,
                    "regular": 29.99,
                    "is_on_sale": true,
                    "price_note": null,
                    "current_max": null,
                    "current_min": null,
                    "save_amount": 5,
                    "save_percent": 17,
                    "comparison_type": "reg",
                    "formatted_current": "$24.99",
                    "formatted_regular": "$29.99"
                },
                "title": "Example Coffee Maker",
                "badges": [
                    "Highly rated"
                ],
                "images": {
                    "primary": "https://target.scene7.com/is/image/Target/GUEST_example-primary",
                    "alternates": [
                        "https://target.scene7.com/is/image/Target/GUEST_example-alt"
                    ]
                },
                "rating": {
                    "count": 1280,
                    "average": 4.6,
                    "review_count": 412
                },
                "videos": [],
                "bullets": [
                    {
                        "label": "Capacity",
                        "value": "12 Cups"
                    }
                ],
                "class_id": 0,
                "item_type": "Coffee Makers",
                "promotions": [],
                "fulfillment": null,
                "parent_tcin": null,
                "department_id": 204
            }
        ],
        "sort_by": "relevance",
        "store_id": "1375",
        "pagination": {
            "per_page": 24,
            "total_pages": 27,
            "current_page": 1,
            "has_next_page": true,
            "total_results": 641
        },
        "sort_options": [
            "relevance",
            "featured",
            "price_low",
            "price_high",
            "rating_high",
            "bestselling",
            "newest"
        ],
        "auto_corrected_query": null
    },
    "meta": {
        "credits": 3,
        "billable": true,
        "duration_ms": 4210,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required query parameter is missing or invalid. This response is not billable. |
| 503 | Service Unavailable | Target could not be reached or refused the request. This response is not billable. Retry later. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
