Skip to content
Scrappa Get API key
Whole Foods API 1 credit/request

Whole Foods Search API Documentation

GET https://scrappa.co/api/wholefoods/search

Whole Foods Search API 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.

A store_id 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 category and diet.

Results are sorted by relevance. The search is loose: oat milk 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.

Whole Foods Search API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/wholefoods/search
Auth header
x-api-key
Cost
1 credit/request
query = coffee shops store_id = 1234567890
Response preview
200 OK
{
    "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,
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

2 required parameters needed before sending a request.

4 optional filters available.

query string Required

Search text, 1 to 120 characters, for example milk.

Example value coffee shops
store_id string Required

Whole Foods store id, 5 digits, for example 10245 (Tribeca). Prices and stock are for this store.

Example value 1234567890
page integer Optional

One-based page number, 1 to 400 (default 1).

Example value 1
per_page integer Optional

Results per page, 1 to 24 (default 24).

Example value 10
category string Optional

Category slug from the facets, for example dairy-eggs.

Example value example
diet string Optional

Diet slug from the facets, for example vegan, gluten-free, organic or dairy-free.

Example value example

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "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

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

A required parameter or a value is invalid. This response is not billable.

{
    "errors": {
        "store_id": [
            "A store id is required, e.g. 10245. Find ids with the store endpoint."
        ]
    },
    "message": "The request validation failed"
}
503

Upstream Unavailable

Whole Foods could not be reached. This response is not billable. Retry shortly.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "search"
    },
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "Whole Foods could not be reached. Please retry shortly."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.