Blog / API guides

Kroger API: Grocery Products and Prices as JSON

To get Kroger product and price data as JSON, call GET /v1/kroger/search with a query: the recorded search for "milk" returned 24 items, each with upc, name, brand, size, price, regular_price, sale_price, sale_ends, unit_price and stock_level, for 1 credit. A second endpoint, GET /v1/kroger/product, takes a upc or a url for one product at 1 credit. This guide shows the requests, the parameters, a real response, a price tracker in Python and the cost per product tracked.

What does the Kroger API on Perceptlayer cover?

The Kroger API on Perceptlayer has two endpoints: a product search by keyword and a product lookup by UPC or URL. Both are GET requests that return JSON, and both cost 1 credit per successful call. Search is where most jobs start, because one call returns a list of products with prices, sizes, categories, ratings, stock level and aisle, all as named fields.

Method Path Returns Credits Required Optional
GET /v1/kroger/search Products for a keyword 1 query page
GET /v1/kroger/product One product 1 none upc, url

These endpoints return public product data, collected from publicly available sources and returned as found at the time of the call. They aren't Kroger's own developer API, and they don't place orders, build carts or connect to a shopper's account. The Kroger API page has both endpoints and a playground to run them.

How do you search Kroger products?

Send a GET request to https://api.perceptlayer.com/v1/kroger/search with your keyword in query and your key in the X-API-Key header. This is the request behind the recorded response in this guide:

curl "https://api.perceptlayer.com/v1/kroger/search?query=milk" \
  -H "X-API-Key: $API_KEY"

Keys start with sk_live_. Where you can't set a header, the key can go in the api_key query parameter; the authentication docs cover both. Every successful response carries X-Credits-Used and X-Credits-Remaining, and the recorded body also reports credits_charged: 1 in meta.

Which parameters do the endpoints take?

The two endpoints take three parameters between them. The table lists each with the constraints the API documents; nothing else about them is documented, so check behaviour in the playground before you depend on it.

Endpoint Parameter Type Required Documented constraint
search query string yes Up to 120 characters
search page integer no One of 1
product upc string no None documented
product url string no Up to 300 characters

page accepts only 1, so one search call is the whole result for that query. The recorded call confirms it from the other side: has_next_page is false. If you need more products, make your queries narrower and more numerous, such as "whole milk", "oat milk" and "lactose free milk", rather than looking for a second page.

What does a Kroger search response contain?

The response is a data object with the query, the page, a count, a has_next_page flag and an items array, plus a meta block with the credits charged. Each item carries identity, pricing, unit pricing, stock and aisle fields. This is the recorded "milk" response, trimmed to the first item and parts of the second:

{
  "success": true,
  "data": {
    "query": "milk",
    "page": 1,
    "count": 24,
    "has_next_page": false,
    "items": [
      {
        "position": 1,
        "id": "0001111050434",
        "upc": "0001111050434",
        "name": "Simple Truth Organic® Lactose Free Vitamin D Whole Milk Half Gallon",
        "brand": "Simple Truth",
        "url": "https://www.kroger.com/p/simple-truth-organic-lactose-free-vitamin-d-whole-milk-half-gallon/0001111050434",
        …
        "size": "1/2 gal",
        "currency": "USD",
        "categories": [
          "Dairy & Eggs > Milk & Dairy Free Milk > Whole Milk",
          …
        ],
        "diets": [
          "Kosher",
          "Lactose Free"
        ],
        "organic": false,
        "non_gmo": true,
        "snap_eligible": true,
        …
        "rating": {
          "average": 4,
          "count": 14
        },
        "stock_level": "high",
        "fulfillment": [
          "pickup"
        ],
        "aisle": {
          "number": "100",
          "description": "DAIRY",
          "side": "R"
        },
        "price": 3.99,
        "regular_price": 4.99,
        "sale_price": 3.99,
        "sale_ends": "2026-12-02T04:59:59.999Z",
        "unit_price": 0.0623,
        "unit": "fl oz",
        "unit_price_text": "$0.06/fl oz"
      },
      {
        "position": 2,
        "upc": "0001111042861",
        "name": "Simple Truth Organic® 2% Reduced Fat Milk with DHA Omega-3 Half Gallon",
        …
        "stock_level": "temporarily_out_of_stock",
        …
        "price": 3.99,
        "regular_price": 4.99,
        …
      }
    ]
  },
  "meta": {
    "endpoint_family": "search",
    …
    "credits_charged": 1,
    "credits_remaining": 1910
  }
}
Field What a price tracker does with it
upc The product key you store and pass to the product endpoint
name, brand, size Labels, and size to compare pack sizes
price, regular_price, sale_price The price shown, the regular price and the sale price
sale_ends When the sale price ends, as an ISO timestamp
unit_price, unit Price per unit as a number, for comparing sizes
stock_level Values in the recording: high, temporarily_out_of_stock
categories, diets, rating Grouping and filtering

Three things to notice. price and sale_price are both 3.99 while regular_price is 4.99, so regular_price - price gives the discount at the time of the call. fulfillment appears on the first item but not the second, so treat any field as optional. And the first item's name contains "Organic" while its organic flag is false; store the flags as returned and don't infer them from the name.

Where do store and location fit?

They don't, in the catalogue as it stands. Neither endpoint lists a store, ZIP code or location parameter, and the recorded response doesn't say which store its prices and aisle refer to. A tracker therefore can't pick a store, and you shouldn't label prices with one. Keep each query fixed, store the call time with every row and compare like with like.

How do you look up one product by UPC?

GET /v1/kroger/product takes a upc or a url, and both parameters are optional, so pass the one you have. Search items carry upc and url fields, so the names match the product endpoint's parameters. In the recording, id and upc hold the same value, 0001111050434.

curl "https://api.perceptlayer.com/v1/kroger/product?upc=0001111050434" \
  -H "X-API-Key: $API_KEY"

We don't have a recorded product response, so we can't show its fields here. Run that call in the playground on the product endpoint page and compare its fields with the search item before you build a tracker on it.

How do you build a grocery price tracker?

A price tracker runs a fixed set of searches on a schedule and appends one row per item: the time, the query, the upc, the prices, the unit price and the stock level. Running the same queries every day gives you a price history per UPC that you can chart or alert on. The script below does that with Python, requests and csv, reading only fields in the recorded response.

import csv
import datetime
import os
import time

import requests

API_KEY = os.environ["API_KEY"]
URL = "https://api.perceptlayer.com/v1/kroger/search"
QUERIES = ["milk", "eggs", "bread"]


def search(query, attempts=3):
    for _ in range(attempts):
        r = requests.get(URL, params={"query": query}, headers={"X-API-Key": API_KEY}, timeout=60)
        if r.status_code in (429, 503):
            time.sleep(int(r.headers.get("Retry-After", "5")))
            continue
        r.raise_for_status()
        return r.json()["data"]
    raise RuntimeError(f"gave up on {query}")


now = datetime.datetime.now(datetime.timezone.utc).isoformat()
with open("kroger-prices.csv", "a", newline="") as f:
    out = csv.writer(f)
    for query in QUERIES:
        data = search(query)
        for item in data.get("items", []):
            out.writerow([
                now, query, item.get("upc"), item.get("name"), item.get("size"),
                item.get("price"), item.get("regular_price"), item.get("sale_price"),
                item.get("sale_ends"), item.get("unit_price"), item.get("unit"),
                item.get("stock_level"),
            ])
        time.sleep(1)

The one-second pause keeps a free account within its 1 request a second. To flag sales, compare price with regular_price per row; to compare sizes, use unit_price with unit rather than price.

What should the job do with errors?

Every error returns an HTTP status and a JSON body with code, message and request_id, and costs nothing. Retry rate_limited (429) and temporarily_unavailable (503) after the Retry-After seconds. Treat invalid_parameters (422) as a bug in your query list. Requests have no idempotency key, so a client timeout may hide a call that succeeded and was billed; keep the timeout generous. The errors docs list every code.

What does tracking Kroger prices cost?

Every successful call to either endpoint costs 1 credit, so the cost of a tracker depends on how you collect. Search spreads one credit across every item it returns: the recorded "milk" call returned 24 items for 1 credit. A UPC list costs 1 credit per product per check, which suits a fixed basket of items you know.

Plan Arithmetic Credits a month
20 queries daily 20 × 30 days × 1 credit 600
100 queries daily 100 × 30 days × 1 credit 3,000
300 UPCs daily 300 × 30 days × 1 credit 9,000
1,000 UPCs daily 1,000 × 30 days × 1 credit 30,000

The first three fit the Starter pack's 10,000 credits, and the last fits the Build pack's 50,000. The 100 free credits on signup cover 100 searches or 100 UPC checks, enough to run the 20-query plan for five days. Failed calls cost nothing and return X-Credits-Used: 0. Purchased credits last 12 months. See pricing for what credits cost and the credits docs for how calls are debited.

To try it, run query=milk in the playground on the search endpoint page, then get a free API key and set your own queries. Other retail sources are on the marketplaces APIs page, and more guides like this one are in API guides.

APIs in this post

Frequently asked questions

Is this Kroger's official API?

No. These are Perceptlayer endpoints that return public Kroger product data, collected from publicly available sources and returned as found at the time of the call. They search products and look up one product by UPC or URL. They don't place orders, build carts or connect to a shopper's account. Read Kroger's terms before you use the data commercially.

Can I get prices for a specific Kroger store?

Not with these endpoints. Neither search nor product documents a store, ZIP code or location parameter, and the recorded response doesn't name a store. Keep your queries fixed and record the call time with each price, so your history compares like with like. Check the Kroger API page for any parameters added later.

How many products does one Kroger search return?

The recorded "milk" search returned count: 24 with has_next_page: false. The page parameter's only documented value is 1, so one call is the whole result for a query. To cover more products, run more specific queries. Each successful search costs 1 credit, whatever the count.

How do I tell if a Kroger product is on sale?

Compare price with regular_price. In the recorded response, the first item has price 3.99, regular_price 4.99, sale_price 3.99 and sale_ends set to an ISO timestamp, so the sale and its end date are fields you read. Both recorded items had a sale, so read sale_price and sale_ends as optional fields.

How fast can I run a Kroger price check?

Limits are per account, shared by all its keys, and counted per minute. A free account gets 1 request a second, 60 a minute, so a 20-query daily check finishes in under a minute. Paying accounts run at least 5 requests a second, 300 a minute, depending on the pack. The rate limits docs list the rate each pack includes.

  1. Costco API: Product Data and Prices as JSON

    A recorded Costco search returned 24 products with price, original price, stock and rating as JSON for 1 credit. Endpoints, parameters, tracking costs.

  2. Etsy API: Product Data as JSON

    One GET to /v1/etsy/product returns an Etsy listing's price, discount, stock, variations and images as JSON, at 10 credits per successful call.

  3. Depop API: Resale Listings as JSON

    Search Depop listings as JSON with brand, condition, sizes and price.amount per item; the recorded jacket search had a total_count of 6,815,522. 1 credit.

Start with 100 free credits

No password to set. We email you a sign-in link, and your key works on every API.

No credit card. 100 free credits on signup.