# Whole Foods Search API Documentation

<p><strong>Whole Foods Search API</strong> searches the products of one Whole Foods Market store. Each item has the ASIN, name, brand, image, product url, the current price, the regular price and the sale price with its dates when the item is on sale.</p><p>A <code>store_id</code> is required because prices and stock depend on the store. Find the id of a store with the store endpoint. The answer lists facets (categories, featured groups, diets). Use their slugs in <code>category</code> and <code>diet</code>.</p><p>Results are sorted by relevance. The search is loose: <code>oat milk</code> also returns oat milk soap. A page past the end is an empty list with the total. At most 10000 results can be paged. Search items carry no unit price, no ingredients and no nutrition: use the product endpoint. Costs 1 credit per successful request. Empty results and failed requests are free.</p>

- **Documentation:** [https://scrappa.co/docs/wholefoods-api/wholefoods_search](https://scrappa.co/docs/wholefoods-api/wholefoods_search)
- **API group:** Whole Foods API
- **Endpoint:** `GET https://scrappa.co/api/wholefoods/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. |
| `store_id` | string | Yes | Whole Foods store id, 5 digits, for example 10245 (Tribeca). Prices and stock are for this store. |
| `page` | integer | No | One-based page number, 1 to 400 (default 1). |
| `per_page` | integer | No | Results per page, 1 to 24 (default 24). |
| `category` | string | No | Category slug from the facets, for example dairy-eggs. |
| `diet` | string | No | Diet slug from the facets, for example vegan, gluten-free, organic or dairy-free. |

## Example response

```json
{
    "data": {
        "page": 1,
        "items": [
            {
                "id": "B078WVT2BC",
                "url": "https://www.wholefoodsmarket.com/product/elmhurst-unsweetened-hazelnut-milked-32-fz-b078wvt2bc",
                "name": "Unsweetened Hazelnut Milked, 32 FZ",
                "brand": "Elmhurst",
                "image": "https://m.media-amazon.com/images/S/assets.wholefoodsmarket.com/PIE/product/41Z7pgsEWEL.jpg",
                "price": 5.99,
                "on_sale": true,
                "currency": "USD",
                "is_local": true,
                "position": 1,
                "sale_end": "2026-11-08",
                "sale_price": 5.99,
                "sale_start": "2026-11-02",
                "regular_price": 7.29,
                "prime_sale_price": 5.49
            },
            {
                "id": "B082VVZW62",
                "url": "https://www.wholefoodsmarket.com/product/elmhurst-unsweetened-walnut-milked-32-fz-b082vvzw62",
                "name": "Unsweetened Walnut Milked, 32 FZ",
                "brand": "Elmhurst",
                "image": "https://m.media-amazon.com/images/S/assets.wholefoodsmarket.com/PIE/product/41UQEQvdCRL.jpg",
                "price": 7.29,
                "on_sale": false,
                "currency": "USD",
                "is_local": false,
                "position": 2,
                "regular_price": 7.29,
                "unit_of_measure": "lb"
            }
        ],
        "query": "milk",
        "facets": [
            {
                "key": "category",
                "label": "Category",
                "options": [
                    {
                        "slug": "all-products",
                        "count": 497,
                        "label": "All Search Results"
                    },
                    {
                        "slug": "dairy-eggs",
                        "count": 344,
                        "label": "Dairy & Eggs",
                        "options": [
                            {
                                "slug": "butter-margarine",
                                "count": 1,
                                "label": "Butter & Margarine"
                            },
                            {
                                "slug": "cheese",
                                "count": 12,
                                "label": "Cheese"
                            }
                        ]
                    },
                    {
                        "slug": "prepared-foods",
                        "count": 1,
                        "label": "Prepared Foods",
                        "options": [
                            {
                                "slug": "prepared-meals",
                                "count": 1,
                                "label": "Prepared Meals"
                            }
                        ]
                    },
                    {
                        "slug": "pantry-essentials",
                        "count": 17,
                        "label": "Pantry Essentials",
                        "options": [
                            {
                                "slug": "baking",
                                "count": 13,
                                "label": "Baking"
                            }
                        ]
                    },
                    {
                        "slug": "desserts",
                        "count": 4,
                        "label": "Desserts",
                        "options": [
                            {
                                "slug": "cookies",
                                "count": 3,
                                "label": "Cookies"
                            }
                        ]
                    }
                ]
            }
        ],
        "per_page": 2,
        "store_id": "10245",
        "has_next_page": true,
        "total_results": 497
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter or a value is invalid. This response is not billable. |
| 503 | Upstream Unavailable | Whole Foods 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)
