APIs / Marketplaces / Whole Foods Market

1 credit per call3 endpoints11 datapoints

Whole Foods Market API

Whole Foods Market API for store-level grocery search, product details, sale prices, facets and store data as JSON. 1 credit per successful call.

Whole Foods Market
GET/v1/whole-foods/search?query=milk&store_id=10245
{
  "success": true,
  "data": {
    "query": "milk",
    "store_id": "10245",
    "page": 1,
    "per_page": 24,
    "total_results": 514,
    "has_next_page": true,
    "items": [
      {
        "position": 1,
        "id": "B082VVT75S",
        "name": "Unsweetened Oat Milk, 32 FZ",
        "brand": "Elmhurst",
        "url": "https://www.wholefoodsmarket.com/product/elmhurst-unsweetened-oat-milk-32-fz-b082vvt75s",
        "image": "https://m.media-amazon.com/images/S/assets.wholefoodsmarket.com/PIE/product/41W8VdoCfGL.jpg",
        "is_local": true,
        "currency": "USD",
        "price": 7.29,
        "regular_price": 7.29,
        "on_sale": false
      },
      {
        "position": 2,
        "id": "B07HFJJ49P",
        "name": "Unsweetened Almond Milk, 32 FZ",
        "brand": "Elmhurst",
        "url": "https://www.wholefoodsmarket.com/product/elmhurst-unsweetened-almond-milk-32-fz-b07hfjj49p",
        "image": "https://m.media-amazon.com/images/S/assets.wholefoodsmarket.com/PIE/product/41wCG4yX-9L.jpg",
        "is_local": true,
        "currency": "USD",
        "price": 7.29,
        "regular_price": 7.29,
        "on_sale": false
      },
      {
        "position": 3,
        "id": "B078WVT2BC",
        "name": "Unsweetened Hazelnut Milked, 32 FZ",
        "brand": "Elmhurst",
        "url": "https://www.wholefoodsmarket.com/product/elmhurst-unsweetened-hazelnut-milked-32-fz-b078wvt2bc",
        "image": "https://m.media-amazon.com/images/S/assets.wholefoodsmarket.com/PIE/product/41Z7pgsEWEL.jpg",
        "is_local": true,
        "currency": "USD",
        "price": 7.29,
        "regular_price": 7.29,
        "on_sale": false
      }
    ],
    "facets": [
      {
        "key": "category",
        "label": "Category",
        "options": [
          {
            "slug": "all-products",
            "label": "All Search Results",
            "count": 514
          },
          {
            "slug": "dairy-eggs",
            "label": "Dairy & Eggs",
            "count": 348,
            "options": [
              "…",
              "…",
              "…"
            ]
          },
          {
            "slug": "prepared-foods",
            "label": "Prepared Foods",
            "count": 2,
            "options": [
              "…"
            ]
          }
        ]
      },
      {
        "key": "featured",
        "label": "Featured",
        "options": [
          {
            "slug": "on-sale",
            "label": "Sales & Deals",
            "count": 248
          },
          {
            "slug": "365-by-whole-foods-market",
            "label": "365 by Whole Foods Market",
            "count": 73
          },
          {
            "slug": "local",
            "label": "Local",
            "count": 37
          }
        ]
      },
      {
        "key": "diets",
        "label": "Dietary Preference",
        "options": [
          {
            "slug": "vegan",
            "label": "Vegan",
            "count": 52
          },
          {
            "slug": "gluten-free",
            "label": "Gluten-Free",
            "count": 111
          },
          {
            "slug": "organic",
            "label": "Organic",
            "count": 223
          }
        ]
      }
    ]
  },
  "meta": {
    "endpoint_family": "search",
    "request_id": "req_879324b5d62f4830a8a5d093a16a2e43",
    "credits_charged": 1,
    "credits_remaining": 1908
  }
}
200 OKJSONX-Credits-Used: 1
Recorded from our API and shortened.

Sample data

What one call returns

A recorded run of search: the fields and shapes you will get, shortened to 3 items.

#positionintegeridstringnamestringbrandstringurlurlimageurlis_localbooleancurrencystringpricenumberregular_pricenumberon_saleboolean
11B082VVT75SUnsweetened Oat Milk, 32 FZElmhursthttps://www.wholefoodsmarket.com/product/elmhurst-unsweetened-oat-milk-32-fz-b082vvt75shttps://m.media-amazon.com/images/S/assets.wholefoodsmarket.com/PIE/product/41W8VdoCfGL.jpgtrueUSD7.297.29false
22B07HFJJ49PUnsweetened Almond Milk, 32 FZElmhursthttps://www.wholefoodsmarket.com/product/elmhurst-unsweetened-almond-milk-32-fz-b07hfjj49phttps://m.media-amazon.com/images/S/assets.wholefoodsmarket.com/PIE/product/41wCG4yX-9L.jpgtrueUSD7.297.29false
33B078WVT2BCUnsweetened Hazelnut Milked, 32 FZElmhursthttps://www.wholefoodsmarket.com/product/elmhurst-unsweetened-hazelnut-milked-32-fz-b078wvt2bchttps://m.media-amazon.com/images/S/assets.wholefoodsmarket.com/PIE/product/41Z7pgsEWEL.jpgtrueUSD7.297.29false

Recorded from our API · 3 items shown · 11 datapoints per itemGET /v1/whole-foods/search?query=milk&store_id=10245

11 datapoints

Identity

  • idstring
  • namestring
  • brandstring

Contact

  • urlurl

Reputation

  • imageurl

Price

  • currencystring
  • pricenumber
  • regular_pricenumber

Other

  • positioninteger
  • is_localboolean
  • on_saleboolean

Playground

Run this API

cURLshell
curl "https://api.perceptlayer.com/v1/whole-foods/search?query=milk&store_id=10245" \
  -H "X-API-Key: $API_KEY"

Whole Foods Market · 3 endpoints

Endpoints

Every endpoint takes the same key. Open one for its parameters and an example request.

EndpointRequired parametersCost
GET/v1/whole-foods/product
none+3 optional
1 credit
GET/v1/whole-foods/search
querystore_id+4 optional
1 credit
GET/v1/whole-foods/store
store_id
1 credit

Overview

About the Whole Foods Market API

What you can get

The Whole Foods Market API returns Whole Foods Market grocery and store data as JSON through 3 endpoints.

  • Search: search takes a query and a store_id, with page, per_page, category and diet.
  • Products: product takes an id or a product url, with store_id.
  • Stores: store takes a store_id.

The recorded search for "milk" at store 10245 returns query, store_id, page, per_page, total_results (514 in that recording), has_next_page, items and facets. Each item has position, id, name, brand, url, image, is_local, currency, price, regular_price and on_sale. The facets group category, featured and dietary options, each with a slug, label and count.

How a call works

Search a store: GET /v1/whole-foods/search?query=milk&store_id=10245 with your key in the X-API-Key header. Each item carries an id, such as B0005XMS0C; product takes that id with the same store_id. Check has_next_page before asking for the next page. Every successful call costs 1 credit; failed calls cost nothing.

MarketplacesJSONRESTMCP

More marketplaces APIs

Use cases

Track grocery prices and sales at a given store

Use the Whole Foods Market API to track grocery prices and sales at a given store

Compare prices for the same product across stores

Use the Whole Foods Market API to compare prices for the same product across stores

Count a store's vegan, gluten-free or organic products from the facets

Use the Whole Foods Market API to count a store's vegan, gluten-free or organic products from the facets

Find local products with `is_local`

Use the Whole Foods Market API to find local products with `is_local`

FAQ

Questions

How much does the Whole Foods Market API cost?

Each successful call costs one credit, and each search page is one call. New accounts get free credits to start, and credit packs bring the price down as you scale.

Why does search need a store_id?

Prices and assortment are per store, so `search` takes a `store_id`. `product` takes one too, and `store` returns that store's details.

What format are responses in?

Every endpoint returns JSON, with no HTML parsing on your side.

Should I build a Whole Foods Market scraper instead?

You can, but a Whole Foods Market scraper is code you maintain: page changes break it, requests get blocked, and Whole Foods Market's terms govern how you collect data. The Whole Foods Market API gives you 3 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.

Try the Whole Foods Market API with 100 free credits

No credit card. Failed calls are never billed.