# Instacart Search API Documentation

<p><strong>Instacart Search API</strong> searches grocery products. An optional zip must be a supported ZIP (currently 10016) or the request answers 422. The zip is a validity gate, not a price filter, and is not echoed back. With retailer, a free empty result reports retailer_status of no_priced_rows or unknown_retailer. Each item has the name, brand, size, current price, regular and sale price when on sale, unit price, availability, a full-size image URL and the retailer and shop ids.</p><p>Search returns the first page only. Instacart has no page cursor, so <code>page</code> accepts only 1; a higher page answers 422. Send <code>retailer</code> to scope results to that retailer; rows are kept by retailer and shop id, not by slug text. Prices are numbers in US dollars. Use the item id with the product route for full detail. Costs 1 credit per successful request with results. A search without hits and failed requests are free and report 0 credits.</p>

- **Documentation:** [https://scrappa.co/docs/instacart-api/instacart_search](https://scrappa.co/docs/instacart-api/instacart_search)
- **API group:** Instacart API
- **Endpoint:** `GET https://scrappa.co/api/instacart/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 120 characters, for example milk. |
| `zip` | string | No | Optional supported US ZIP (currently 10016); validity gate only, not echoed back |
| `retailer` | string | No | Retailer slug to scope results, for example safeway. |
| `page` | integer | No | Only 1 is available (default 1). Any other value answers 422. |

## Example response

```json
{
    "data": {
        "page": 1,
        "count": 1,
        "items": [
            {
                "id": "items_88059-20630136",
                "url": "https://www.instacart.com/products/20630136-organic-whole-milk?retailerSlug=safeway",
                "name": "Organic Whole Milk",
                "size": "1 gal",
                "unit": "fl oz",
                "brand": "Safeway",
                "image": "https://d2lnr5mha7bycj.cloudfront.net/product-image/file/large_example.jpeg",
                "price": 3.44,
                "shop_id": "37447",
                "currency": "USD",
                "discount": 0.55,
                "position": 1,
                "product_id": "20630136",
                "sale_price": 3.44,
                "unit_price": 0.03,
                "retailer_id": 118,
                "availability": "in_stock",
                "regular_price": 3.99,
                "unit_price_text": "$0.03/fl oz"
            }
        ],
        "query": "milk",
        "retailer": "safeway",
        "has_next_page": false
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter is missing or invalid, for example page above 1. This response is not billable. |
| 503 | Upstream Unavailable | Instacart could not be reached. This response is not billable. Retry shortly. |

## 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)
