Starforest API

The Starforest API lets an AI agent compare the same product across top US retailers, with each retailer's own price, stock and ratings, and the time we checked.

The API is opening soon. Request access, and we’ll be in touch.

You use it in four steps: search, compare, check and buy. Each step is also a tool in our MCP server.

Searching is free. Searches, lookups, product reads, similar products, price history and suggestions count toward a fair-use allowance of 20,000 calls a month, plus 1,500 for every purchase through your buy links. Fresh checks are free when the shopper opens your buy link within 30 minutes, and other checks are $0.01 an offer after 1,000 free each month.

Quick start

This quick start follows one product, a 24-pack of Voltmark AA batteries, through the four steps. Voltmark is a made-up brand, and its prices are examples.

Before you start

Request access to get two API tokens: a test token, which starts with sf_test_, and a live token, which starts with sf_live_. The examples read your token from an environment variable called STARFOREST_TOKEN, and the responses show what a live token returns.

The TypeScript examples use fetch and the Python examples use requests. Each defines a small starforest() helper in step 1 and reuses it in the later steps.

Create a search with the shopper's words. Setting max_products to 1 returns only the best match.

curl https://api.thestarforest.com/searches \
  -H "Authorization: Bearer $STARFOREST_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "voltmark aa batteries 24 count",
    "max_products": 1
  }'

The response holds one product with an offer from each retailer. An offer has its own ID, the retailer's price and stock, its rating and checked_at, the time we checked the price. Kroger's offer comes last because Kroger is out of stock.

Response (200 OK), shortened
{
  "data": {
    "id": "srh_0000AqN3jZ8xYb2Kd7",
    "query": "voltmark aa batteries 24 count",
    "retailer_statuses": [
      { "retailer": "amazon", "status": "complete" },
      { "retailer": "walmart", "status": "complete" },
      { "retailer": "target", "status": "complete" },
      { "retailer": "kroger", "status": "complete" }
    ],
    "products": [
      {
        "id": "prd_0000AqN3kT4bWc9Rf1",
        "title": "Voltmark AA alkaline batteries, 24 ct",
        "brand": "Voltmark",
        "gtin": "00412345670136",
        "offers": [
          {
            "id": "off_0000AqN3mP7cVd2Tg5",
            "retailer": "walmart",
            "price": "16.97",
            "unit_price": "0.71",
            "availability": "in_stock",
            "rating": 4.6,
            "badge": "Best seller",
            "checked_at": "2026-11-19T14:05:00Z"
          },
          {
            "id": "off_0000AqN3tV9bZe4Xd8",
            "retailer": "amazon",
            "price": "17.49",
            "unit_price": "0.73",
            "availability": "in_stock",
            "rating": 4.7,
            "badge": null,
            "checked_at": "2026-11-19T14:02:00Z"
          },
          {
            "id": "off_0000AqN3xZ6dBg7Zf1",
            "retailer": "target",
            "price": "18.99",
            "unit_price": "0.79",
            "availability": "in_stock",
            "rating": 4.5,
            "badge": null,
            "checked_at": "2026-11-19T14:04:00Z"
          },
          {
            "id": "off_0000AqN41D0fDi1Bh5",
            "retailer": "kroger",
            "price": "19.99",
            "unit_price": "0.83",
            "availability": "out_of_stock",
            "rating": 4.4,
            "badge": null,
            "checked_at": "2026-11-19T14:01:00Z"
          }
        ]
      }
    ]
  }
}

2. Compare the offers

The search already returned every retailer's offer, so your agent can compare them right away. To show the same comparison later, for example when a shopper comes back to a product they saved, get the product by its ID. Its offers are ordered by price, lowest first, with out-of-stock offers last.

curl https://api.thestarforest.com/products/prd_0000AqN3kT4bWc9Rf1 \
  -H "Authorization: Bearer $STARFOREST_TOKEN"

The response is the same product object that the search returned.

3. Check your agent's final picks

Search results come from the catalog, which is refreshed daily, so run a fresh check on the offers your agent plans to recommend before it calls a price final. A fresh check re-confirms the price and stock of the offers you name and takes 5 to 10 seconds, so keep the list short. This example checks the three offers that were in stock.

curl https://api.thestarforest.com/checks \
  -H "Authorization: Bearer $STARFOREST_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "offer_ids": [
      "off_0000AqN3mP7cVd2Tg5",
      "off_0000AqN3tV9bZe4Xd8",
      "off_0000AqN3xZ6dBg7Zf1"
    ]
  }'
Response (200 OK)
{
  "data": {
    "id": "chk_0000AqN4bR2wHx5Lc8",
    "results": [
      {
        "offer_id": "off_0000AqN3mP7cVd2Tg5",
        "retailer": "walmart",
        "status": "unchanged",
        "price": "16.97",
        "previous_price": "16.97",
        "currency": "USD",
        "availability": "in_stock",
        "previous_availability": "in_stock",
        "checked_at": "2026-11-19T17:41:07Z"
      },
      {
        "offer_id": "off_0000AqN3tV9bZe4Xd8",
        "retailer": "amazon",
        "status": "changed",
        "price": "16.99",
        "previous_price": "17.49",
        "currency": "USD",
        "availability": "in_stock",
        "previous_availability": "in_stock",
        "checked_at": "2026-11-19T17:41:08Z"
      },
      {
        "offer_id": "off_0000AqN3xZ6dBg7Zf1",
        "retailer": "target",
        "status": "changed",
        "price": "18.99",
        "previous_price": "18.99",
        "currency": "USD",
        "availability": "out_of_stock",
        "previous_availability": "in_stock",
        "checked_at": "2026-11-19T17:41:09Z"
      }
    ],
    "live_mode": true
  }
}

Walmart's offer is unchanged. Amazon's price dropped 50¢ to $16.99 and Target is now out of stock, so both have the status changed. Each result holds the new values, with the old ones in previous_price and previous_availability. Walmart is still the cheapest offer in stock. If a retailer had stopped listing the product, its status would be no_longer_available. The test store has products that do each of these.

4. Send the shopper to the retailer

When the shopper chooses an offer, create a buy link for it. Here the shopper picks Walmart, which is still the cheapest. The link opens Walmart's own product page, and the shopper buys there. The order, the receipt and any return stay between the shopper and Walmart.

curl https://api.thestarforest.com/links \
  -H "Authorization: Bearer $STARFOREST_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "offer_id": "off_0000AqN3mP7cVd2Tg5" }'
Response (200 OK)
{
  "data": {
    "offer_id": "off_0000AqN3mP7cVd2Tg5",
    "retailer": "walmart",
    "url": "https://www.walmart.com/ip/…",
    "live_mode": true
  }
}

Key ideas

Products and offers

A product is one item, such as a 24-pack of Voltmark AA batteries. An offer is one retailer's listing of that product, with the retailer's own title, price, stock and ratings. A product listed at four retailers has four offers. You use an offer's ID to check it or to create a buy link.

We put listings in one product only when they're the same brand, variant, size and count. A 12-pack and a 24-pack are different products, and similar products links them. Each offer's match_confidence, from 0 to 1, says how sure we are that the listing belongs to the product.

When each value was checked

Every offer has a checked_at time for when we last checked its price, and a stock_checked_at time for its stock. The catalog is refreshed daily. When your agent quotes a price, have it name the retailer and say when we checked the price, for example "$16.97 at Walmart, checked at 6:05 am PT".

Fresh checks before you recommend

Search results come from the catalog, which is refreshed daily. A fresh check re-confirms the price and stock of the offers you name. A fresh check takes 5 to 10 seconds, against about a second for a search. Use search results to narrow the choice, then check only the offers your agent is about to recommend.

Retailers missing from a result

Every search reports a status for each retailer it covered, in retailer_statuses. complete means that retailer's results are in the response. not_found means we didn't find a match at that retailer in our catalog. When a retailer shows not_found, your agent should say it didn't find the product there. It shouldn't say the product is out of stock there.

Ratings, badges and sort order

An offer carries the retailer's own rating and review count, its badge when it shows one, such as Best seller, and at some retailers how many people bought it recently, such as "2K+ bought in past month". These come from each retailer, so compare them within a retailer rather than across retailers.

Products come back in the order you set with sort: by relevance, price, unit price or rating. Brands can't pay to rank higher, and there are no ads in answers.

Coming soon

These are on the way. Their fields are marked Coming soon in this reference.

  • Stock at a store near a ZIP code. Today, stock is one status per retailer, with shipping, pickup and same-day delivery where the retailer shows them.
  • Whole-list compare: the total for a shopping list at each retailer.
  • Price and stock alerts, sent to your webhook when an offer changes.

If you need one of these, tell us which one.

Test store

Starforest Mart is a test retailer with the ID sfmart. It appears only when you use a test token, and its products behave the same way every time. A real retailer's prices and stock can change between checks, and you can't make one drop a product when you need to test that case.

Each product is named after what it does. To find one, search for its name with retailers set to ["sfmart"]. Starforest Mart's prices aren't realistic.

ProductWhat happens
Always In StockIt's in stock at 10.00, and every fresh check returns unchanged. Use it for the path where nothing goes wrong.
Always Out Of StockIt's out of stock in every search and every check. Use it to test how your agent tells a shopper an item is unavailable.
Price Changes On CheckIt shows 12.99 in search. A fresh check returns 14.49, with previous_price 12.99 and the status changed.
No Longer AvailableIt shows in search. A fresh check returns the status no_longer_available, and creating a buy link returns the error offer_no_longer_available.
Check Times OutAny fresh check that includes it fails with a 504 error and the code check_timeout. Use it to test how your agent falls back on the values from our last check.
Not Found ElsewhereOnly Starforest Mart has it. The other retailers show not_found in retailer_statuses.

For example, a search for Price Changes On Check returns an offer at 12.99. A fresh check on that offer returns the new price, 14.49, with the old one in previous_price.

Response (200 OK) to a fresh check, test mode
{
  "data": {
    "id": "chk_0000AqT3vW8nRd2Kf5",
    "results": [
      {
        "offer_id": "off_0000AqT2pC4hNg8Qs1",
        "retailer": "sfmart",
        "status": "changed",
        "price": "14.49",
        "previous_price": "12.99",
        "currency": "USD",
        "availability": "in_stock",
        "previous_availability": "in_stock",
        "checked_at": "2026-11-19T17:45:12Z"
      }
    ],
    "live_mode": false
  }
}

Buy links for Starforest Mart products open a test page.

API reference

The API has nine endpoints under https://api.thestarforest.com. Every endpoint returns JSON, and the POST endpoints take a JSON body.

EndpointName
POST /searchesCreate a search
POST /lookupsLook up a product
GET /products/{id}Get a single product
GET /products/{id}/similarList similar products
GET /products/{id}/historyGet price history
GET /suggestionsList suggestions
POST /checksCreate a check
POST /linksCreate a buy link
GET /retailersList retailers

Conventions

Authentication and headers

Send your token as a bearer token in the Authorization header. POST requests also need Content-Type: application/json.

HeaderValue
AuthorizationBearer sf_test_… or Bearer sf_live_…. Required on every request.
Starforest-VersionOptional. A dated version, such as 2026-11-20. Without it, a request uses your account's default version.
Content-Typeapplication/json. Required on POST requests.
Idempotency-KeyA unique string you choose, such as a UUID. Optional on POST requests.

If you send a POST request again with the same Idempotency-Key, for example after a network timeout, you get the original response back, and we don't create a second search, check or link.

Test and live mode

Your token sets the mode. Test tokens work against the test store, and live tokens against the catalog. Every object has a live_mode field, which is false in test mode and true in live mode.

Response format

A successful response wraps its result in data. Request bodies are plain JSON objects and don't need the wrapper.

  • IDs start with a prefix that says what they are: srh_ for a search, prd_ for a product, off_ for an offer and chk_ for a check.
  • Money is a decimal string, such as "16.97", with the currency in a separate currency field. Strings keep amounts exact, which floating-point numbers can't always do. Every retailer we cover prices in US dollars.
  • Times are ISO 8601 strings in UTC, such as "2026-11-19T14:05:00Z".

Versioning

Each request uses your account's default version, which is the latest version on the day you sign up. To pin a version, send Starforest-Version with its date, such as 2026-11-20. Changes that could break your code only come in a new dated version, and every change is listed in the changelog.

Limits and fair use

Discovery calls are free. They're searches, lookups, product reads, similar products, price history, suggestions and the retailer list. Buy links don't count, and fresh checks are billed on their own.

LimitFree plan
Monthly allowance20,000 discovery calls, plus 1,500 for every purchase through your buy links. Over that, $0.005 a call. We email you first.
Discovery calls10 a second for each key.
Fresh checks2 a second for each key, with up to 10 offers in a check. A check is free when the shopper opens your buy link for one of its offers within 30 minutes. Other checks: the first 1,000 offers each month are free, then $0.01 an offer.
ResultsUp to 20 products a page and 100 for one query.

If you go over a rate limit, you get a 429 error with the code rate_limit_exceeded and a Retry-After header, so wait that long and retry. For higher limits, talk to sales.

Using the data

  • Show results to shoppers, or use them to act for one.
  • Keep prices for up to 24 hours. Refresh older ones, or run a fresh check, before you show them. Keep product IDs as long as you like.
  • Copying the catalog in bulk, reselling it or training models on it needs a data license. Ask us about one.
  • Keep buy links as they are. They carry your attribution, so a purchase counts for your commission share and your allowance.

Searches

A search finds products from a shopper's words and returns each product with an offer from every retailer where we found it. Searches read the catalog, which covers top US retailers and is refreshed daily. A search takes about a second. To start from a barcode or a link, look it up instead.

POST /searches

Send query, or a category in filters to browse that category. The other fields are optional.

Body parameters
FieldDescription
querystringWhat the shopper asked for, in their words, such as "aa batteries 24 pack".
retailersarray of stringsThe retailers to search, by ID from List retailers. Defaults to all of them. With a test token, you can add sfmart.
filtersobjectNarrows the results. Every filter you set must match. The fields are below.
sortstringrelevance, price, unit_price or rating. price and unit_price put the product with the cheapest in-stock offer first. Defaults to relevance. Offers inside a product are always ordered by price, with out-of-stock offers last.
max_productsintegerThe most products to return, from 1 to 20. Defaults to 3.
page_tokenstringThe next_page_token from the previous page. One query returns up to 100 products in all.
Fields of filters
FieldDescription
in_stockbooleanOnly products with at least one offer in stock.
price_min, price_maxstringThe lowest offer must be within this range, such as "20.00".
brandsarray of stringsBrand names, such as ["Voltmark"].
categorystringA category path from suggestions, such as "Household > Batteries".
dietary_claimsarray of stringsClaims on the product, such as vegan, organic, gluten-free, non-gmo or kosher.
audiencearray of stringsWho it's for: women, men, kids, baby or pets.
attributesobjectCategory attributes and the values to allow, such as { "flavor": ["cherry"] } for drinks.

The response is a search object.

The search object

FieldDescription
idstringStarts with srh_.
querystring or nullThe query you sent. null when you browsed a category.
retailer_statusesarrayOne entry for each retailer searched, with retailer and status. The status is complete or not_found, as described in Retailers missing from a result.
productsarrayThe matching products.
next_page_tokenstring or nullSend it as page_token to get the next page. null on the last page.
live_modebooleanfalse in test mode.
Response (200 OK) to the quick start search, two offers shown
{
  "data": {
    "id": "srh_0000AqN3jZ8xYb2Kd7",
    "query": "voltmark aa batteries 24 count",
    "retailer_statuses": [
      { "retailer": "amazon", "status": "complete" },
      { "retailer": "walmart", "status": "complete" },
      { "retailer": "target", "status": "complete" },
      { "retailer": "kroger", "status": "complete" }
    ],
    "products": [
      {
        "id": "prd_0000AqN3kT4bWc9Rf1",
        "title": "Voltmark AA alkaline batteries, 24 ct",
        "brand": "Voltmark",
        "manufacturer": "Voltmark Power Co.",
        "category": "Household > Batteries > AA",
        "size": { "quantity": 24, "unit": "count" },
        "gtin": "00412345670136",
        "dietary_claims": [],
        "audience": [],
        "attributes": { "battery_size": "AA", "chemistry": "alkaline" },
        "offers": [
          {
            "id": "off_0000AqN3mP7cVd2Tg5",
            "retailer": "walmart",
            "retailer_product_id": "5410983372",
            "title": "Voltmark AA Alkaline Batteries, 24 Count",
            "url": "https://www.walmart.com/ip/…",
            "match_confidence": 0.98,
            "price": "16.97",
            "list_price": null,
            "currency": "USD",
            "unit_price": "0.71",
            "unit": "count",
            "availability": "in_stock",
            "fulfillment": {
              "shipping": "in_stock",
              "pickup": "in_stock",
              "same_day_delivery": "out_of_stock"
            },
            "promotion": null,
            "badge": "Best seller",
            "popularity": "500+ bought since yesterday",
            "rating": 4.6,
            "review_count": 1204,
            "price_since": "2026-11-02T08:12:00Z",
            "checked_at": "2026-11-19T14:05:00Z",
            "stock_checked_at": "2026-11-19T14:05:00Z",
            "live_mode": true
          },
          {
            "id": "off_0000AqN3tV9bZe4Xd8",
            "retailer": "amazon",
            "retailer_product_id": "B0FV1TQ7ZK",
            "title": "Voltmark AA Batteries, Alkaline, 24-Pack",
            "url": "https://www.amazon.com/dp/…",
            "match_confidence": 0.97,
            "price": "17.49",
            "list_price": "19.99",
            "currency": "USD",
            "unit_price": "0.73",
            "unit": "count",
            "availability": "in_stock",
            "fulfillment": null,
            "promotion": { "text": "Save 5% on 2 select items", "type": "multi_buy" },
            "badge": null,
            "popularity": "2K+ bought in past month",
            "rating": 4.7,
            "review_count": 2318,
            "delivery_promise": "FREE delivery Fri, Nov 21",
            "prime_eligible": true,
            "price_since": "2026-11-14T06:40:00Z",
            "checked_at": "2026-11-19T14:02:00Z",
            "stock_checked_at": "2026-11-19T14:02:00Z",
            "live_mode": true
          }
        ],
        "live_mode": true
      }
    ],
    "next_page_token": null,
    "live_mode": true
  }
}

Lookups

A lookup finds one product from something exact: a UPC or EAN, a retailer's own product ID, or a link to a product page at a retailer we cover. It returns the product with every retailer's offer, the same way a search does. Use it when a shopper pastes a link, scans a barcode, or has an item in a cart somewhere else.

Look up a product

POST /lookups

Send exactly one of these fields.

Body parameters
FieldDescription
upcstringA 12-digit UPC or a 13-digit EAN.
urlstringA product page at a retailer we cover, such as a link a shopper pasted.
asinstringAn Amazon product ID.
walmart_item_idstringA Walmart item ID.
target_tcinstringA Target product ID (TCIN).
kroger_product_idstringA Kroger product ID.
Request
curl https://api.thestarforest.com/lookups \
  -H "Authorization: Bearer $STARFOREST_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://www.target.com/p/voltmark-aa-24ct/-/A-91822604" }'

The response is the matched product, with every retailer's offer. If nothing matches, you get a 404 error with the code product_not_found. A link to a page that isn't a product at a retailer we cover returns a 422 error with the code unsupported_url.

Products

A product is one item matched across retailers, and each retailer's listing of it is an offer. An offer carries the retailer's own price, stock, ratings and promotions, and the time we checked them.

The product object

FieldDescription
idstringStarts with prd_.
titlestringOur name for the product. Each retailer's own title is on its offer.
brandstringThe brand name.
manufacturerstring or nullThe company that owns the brand.
categorystringThe category path, such as "Household > Batteries > AA".
image_urlstringThe main product image.
descriptionstring or nullThe product description.
bullet_pointsarray of stringsThe feature list from the product page.
sizeobject or nullThe pack size, as quantity and unit, such as { "quantity": 24, "unit": "count" }. Units are count, oz or fl oz.
gtinstring or nullThe 14-digit GTIN, when the product has one. A 12-digit UPC gets two leading zeros, as in 00412345670136.
dietary_claimsarray of stringsClaims such as vegan, organic or gluten-free.
audiencearray of stringsWho it's for, such as kids or pets.
ingredientsstring or nullThe ingredient list, for food, drinks and personal care.
attributesobjectAttributes for the product's category, such as flavor, pack type and volume for drinks, or shade for beauty.
offersarrayOne offer for each retailer that lists the product.
live_modebooleanfalse in test mode.

The offer object

Fields a retailer doesn't show are null. For example, only Amazon shows a delivery promise, and only Walmart and Target show stock for shipping, pickup and same-day delivery.

FieldDescription
idstringStarts with off_. Use it to create a check or a buy link.
retailerstringThe retailer's ID, such as walmart.
retailer_product_idstringThe retailer's own ID for the listing, such as an ASIN or a TCIN.
titlestringThe retailer's own listing title.
urlstringThe retailer's product page, for showing where a value came from. To send a shopper to buy, create a buy link.
match_confidencenumberHow sure we are that this listing is the product, from 0 to 1.
pricestringThe retailer's price, as a decimal string.
list_pricestring or nullThe was-price, when the retailer shows one above the price.
currencystringISO 4217 currency code, such as USD.
unit_pricestring or nullThe price per unit of size, such as "0.71" per battery.
unitstring or nullWhat unit_price is per: count, oz or fl oz.
availabilitystringin_stock or out_of_stock. One status for the retailer, not for a particular store.
fulfillmentobject or nullStock for shipping, pickup and same_day_delivery, each in_stock or out_of_stock.
promotionobject or nullThe deal shown with the offer, as text and type, such as multi_buy or price_reduction.
couponstring or nullA coupon shown on the product page.
badgestring or nullThe retailer's own badge, such as "Best seller".
popularitystring or nullHow many people bought it recently, as the retailer says it, such as "2K+ bought in past month".
ratingnumber or nullThe retailer's average star rating, from 0 to 5.
review_countinteger or nullHow many ratings the retailer shows.
delivery_promisestring or nullThe delivery date the retailer shows, such as "FREE delivery Fri, Nov 21".
prime_eligibleboolean or nullWhether the offer ships with Prime.
price_sincestringWhen the price last changed, in UTC.
checked_atstringWhen we last checked the price, in UTC.
stock_checked_atstringWhen we last checked the stock, in UTC.
live_modebooleanfalse in test mode.
store Coming soonobjectStock at a store near a ZIP code you send.

Get a single product

GET /products/{id}

Returns the product with every retailer's offer, in the same shape as in a search. Offers are ordered by price, lowest first, with out-of-stock offers last. An unknown ID returns a 404 error with the code product_not_found.

Request
curl https://api.thestarforest.com/products/prd_0000AqN3kT4bWc9Rf1 \
  -H "Authorization: Bearer $STARFOREST_TOKEN"

Similar products

Similar products start from a product you already have. Other sizes are the same item in a different pack, so your agent can find a lower unit price. Alternatives are other brands' products in the same category with the same key attributes, for when the first choice is out of stock or costs more.

List similar products

GET /products/{id}/similar

Query parameters
FieldDescription
kindstringsizes, alternatives or all. Defaults to all, with sizes first.
max_productsintegerFrom 1 to 20. Defaults to 5.
Response (200 OK), shortened
{
  "data": {
    "product_id": "prd_0000AqN3kT4bWc9Rf1",
    "similar": [
      {
        "relation": "size",
        "product": {
          "id": "prd_0000AqN8cX2mLp4Ws7",
          "title": "Voltmark AA alkaline batteries, 48 ct",
          "lowest_offer": { "retailer": "walmart", "price": "29.76", "unit_price": "0.62" }
        }
      },
      {
        "relation": "alternative",
        "product": {
          "id": "prd_0000AqN9dY3nMq5Xt8",
          "title": "Brightcell AA batteries, 24 ct",
          "lowest_offer": { "retailer": "target", "price": "15.36", "unit_price": "0.64" }
        }
      }
    ],
    "live_mode": true
  }
}

Each product is a full product object, shortened here, plus lowest_offer, its cheapest offer in stock.

Price history

Price history shows how each offer's price, promotion and stock changed over the last 90 days, with a summary your agent can quote: the lowest, highest and typical price. Your agent can use it to tell a deal from a normal price, or to suggest waiting.

Get price history

GET /products/{id}/history

Query parameters
FieldDescription
retailersstringRetailer IDs, separated by commas. Defaults to all of them.
daysintegerFrom 1 to 90. Defaults to 90.
Response (200 OK), one retailer shown
{
  "data": {
    "product_id": "prd_0000AqN3kT4bWc9Rf1",
    "offers": [
      {
        "offer_id": "off_0000AqN3mP7cVd2Tg5",
        "retailer": "walmart",
        "summary": {
          "current": "16.97",
          "lowest": "16.97",
          "highest": "17.97",
          "typical": "17.97",
          "in_stock_days": 87
        },
        "periods": [
          { "from": "2026-08-22T07:30:00Z", "price": "17.97", "promotion": null, "availability": "in_stock" },
          { "from": "2026-10-09T06:55:00Z", "price": "17.97", "promotion": null, "availability": "out_of_stock" },
          { "from": "2026-10-12T07:10:00Z", "price": "17.97", "promotion": null, "availability": "in_stock" },
          { "from": "2026-11-02T08:12:00Z", "price": "16.97", "promotion": null, "availability": "in_stock" }
        ]
      }
    ],
    "live_mode": true
  }
}

typical is the price the offer had for the most days in the window, and in_stock_days counts the days it was in stock. Each period starts at from and runs until the next one starts. The last period is the current one.

Suggestions

Suggestions complete what a shopper has started typing, with brands, categories and full searches. Use a category path from here in a search's filters.

List suggestions

GET /suggestions?q=volt

Response (200 OK)
{
  "data": {
    "query": "volt",
    "brands": ["Voltmark"],
    "categories": ["Household > Batteries > AA", "Household > Batteries > AAA"],
    "searches": ["voltmark aa batteries", "voltmark aaa batteries 24 count"],
    "live_mode": true
  }
}

Checks

A fresh check re-confirms the price and stock of the offers you name. Use it on your agent's final picks, before it tells a shopper a price is final. A fresh check takes 5 to 10 seconds.

When a check is free

When a shopper opens your buy link for an offer within 30 minutes of a check that included it, that check is free. We match the open to your most recent check of the offer, so there's nothing extra to send. Only opens by real shoppers count. Other checks: the first 1,000 offers each month are free, then $0.01 an offer.

Create a check

POST /checks

Body parameters
FieldDescription
offer_idsarray of stringsRequired. The IDs of up to 10 offers to check. They can be from different retailers.

The response is a check object. Step 3 of the quick start shows an example.

The check object

FieldDescription
idstringStarts with chk_.
resultsarrayOne result for each offer, in the order you sent them.
live_modebooleanfalse in test mode.

Each result has these fields.

FieldDescription
offer_idstringThe offer you asked about.
retailerstringThe offer's retailer.
statusstringunchanged means the price and stock match the offer. changed means the price, the stock or both are different. The new values are in this result, and the old ones are in previous_price and previous_availability. no_longer_available means the retailer no longer lists the product.
pricestring or nullThe price when we checked. null if the status is no_longer_available.
previous_pricestringThe offer's price before this check.
currencystringUSD.
availabilitystring or nullin_stock or out_of_stock. null if the status is no_longer_available.
previous_availabilitystringThe offer's stock before this check.
checked_atstringWhen we checked, in UTC.

If we can't confirm every offer in time, the check fails with a 504 error and the code check_timeout. The offers keep the values from our last check, with their checked_at times. Try again, or check fewer offers at a time.

Retailers

The catalog covers top US retailers, each refreshed daily, and we add more all the time. A fresh check happens only when you create one.

List retailers

GET /retailers

Fields of each retailer
FieldDescription
idstringThe ID you use in retailers and see on offers, such as walmart.
namestringThe retailer's name.
refreshstringHow often the retailer's data in the catalog is refreshed. It's daily for every retailer.
live_modebooleanfalse in test mode.
Request
curl https://api.thestarforest.com/retailers \
  -H "Authorization: Bearer $STARFOREST_TOKEN"
Response (200 OK)
{
  "data": [
    { "id": "amazon", "name": "Amazon", "refresh": "daily", "live_mode": true },
    { "id": "walmart", "name": "Walmart", "refresh": "daily", "live_mode": true },
    { "id": "target", "name": "Target", "refresh": "daily", "live_mode": true },
    { "id": "kroger", "name": "Kroger", "refresh": "daily", "live_mode": true }
  ]
}

With a test token, the list also includes Starforest Mart, with the ID sfmart.

Errors

A failed request returns an HTTP error status and an errors array. Each error has a type for the kind of problem and a code for the exact problem, so your code can branch on either. When you contact us about an error, include meta.request_id.

Response (422 Unprocessable Content)
{
  "errors": [
    {
      "type": "invalid_request_error",
      "code": "offer_no_longer_available",
      "title": "Offer no longer available",
      "message": "Walmart no longer lists this product. Search again to find another offer.",
      "documentation_url": "https://thestarforest.com/docs#errors"
    }
  ],
  "meta": {
    "request_id": "req_0000AqN4fK7sJy3Pn6"
  }
}

The error object

FieldDescription
typestringOne of authentication_error, validation_error, invalid_request_error, check_error, rate_limit_error or api_error.
codestringThe exact problem, such as product_not_found. Codes are listed below.
titlestringA short summary that stays the same for each code.
messagestringA longer explanation of this error, written for a developer.
documentation_urlstringA link to this section of the docs.

Status codes and retries

No endpoint places an order, so a retry can't buy anything twice. At worst it creates a second search, lookup, check or link.

StatusWhat to do
400invalid_request_errorDon't retry. The body isn't valid JSON, or a required header is missing.
401authentication_errorDon't retry. The token is missing, malformed or revoked.
404invalid_request_errorDon't retry. No product or offer has that ID, a lookup found no match, or the path is wrong.
422validation_error or
invalid_request_error
Don't retry the same request. A field is missing or has the wrong value, or the request can't be done, such as a buy link for an offer the retailer no longer lists.
429rate_limit_errorRetry after the number of seconds in Retry-After. See Limits and fair use.
500api_errorRetry a few times with exponential backoff. If it keeps failing, send us the request_id.
503api_errorRetry later. The API is down for maintenance or overloaded.
504check_errorRetry after a few seconds, or check fewer offers at a time. We couldn't confirm every offer in time. The offers keep the values from our last check.

Error codes

These are the codes you'll see most often.

CodeMeaning
invalid_token401The token is missing, malformed or revoked.
query_or_category_required422A search needs query, or a category in filters.
one_lookup_field422A lookup needs exactly one of upc, url or a retailer's product ID.
unsupported_url422The link isn't a product page at a retailer we cover.
too_many_offers422A fresh check can hold up to 10 offers.
unknown_retailer422A value in retailers isn't one of the retailers we cover. sfmart works only with a test token.
product_not_found404No product has this ID.
offer_not_found404No offer has this ID.
offer_no_longer_available422The retailer no longer lists the product. Search again to find another offer.
check_timeout504We couldn't confirm every offer in a fresh check in time. The offers keep the values from our last check.
rate_limit_exceeded429You've sent too many requests. Wait, then retry.

MCP tools

Agents that use the Model Context Protocol (MCP) call Starforest through our MCP server at https://mcp.thestarforest.com. The server has seven tools, and each one returns the same JSON as the API call it mirrors.

Connect a client

Add the server to your MCP client's settings with your token. Your client may name these fields differently.

MCP client settings
{
  "mcpServers": {
    "starforest": {
      "url": "https://mcp.thestarforest.com",
      "headers": {
        "Authorization": "Bearer sf_live_..."
      }
    }
  }
}

The seven tools

ToolWhat it does
search_productsPOST /searchesFinds products from a shopper's words and filters, with each retailer's offer.
lookup_productPOST /lookupsFinds one product from a barcode, a retailer's product ID or a product link.
get_productGET /products/{id}Returns one product with every retailer's offer.
find_similarGET /products/{id}/similarReturns other sizes of the same item and alternatives from other brands.
get_price_historyGET /products/{id}/historyReturns up to 90 days of price, promotion and stock changes for each offer, with the lowest, highest and typical price.
check_offersPOST /checksRuns a fresh check, which re-confirms the price and stock of the offers your agent plans to recommend.
get_buy_linkPOST /linksReturns a link to the retailer's own product page, where the shopper buys.

None of the tools places an order or takes a payment. get_buy_link returns a URL, and the shopper opens it to buy at the retailer.

How search_products is defined

The description in a tool's definition tells the agent how to use the results. This one tells the agent to name the retailer and say when we checked the price whenever it quotes one, and to call check_offers before it calls a price final.

Tool definition
{
  "name": "search_products",
  "title": "Search products across top US retailers",
  "description": "Find products in the Starforest catalog and compare them across top US retailers. Returns matching products, each with one offer per retailer where we found it: the retailer's price, unit price, stock, rating and checked_at, the time Starforest checked the price. The catalog is refreshed daily. When you quote a price, name the retailer and say when it was checked. Before you tell the user a price is final, call check_offers with the IDs of the offers you plan to recommend. If retailer_statuses shows a retailer as not_found, say you didn't find the product there; do not say it is out of stock there. If the user gives a barcode or a product link, call lookup_product instead. To send the user to buy, call get_buy_link.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "query": {
        "type": "string",
        "description": "What the shopper wants, in their words, such as 'aa batteries 24 pack'."
      },
      "retailers": {
        "type": "array",
        "items": {
          "type": "string",
          "enum": ["amazon", "walmart", "target", "kroger"]
        },
        "description": "Retailers to search. Defaults to all of them."
      },
      "filters": {
        "type": "object",
        "properties": {
          "in_stock": { "type": "boolean" },
          "price_max": { "type": "string", "description": "Such as '20.00'." },
          "brands": { "type": "array", "items": { "type": "string" } },
          "dietary_claims": { "type": "array", "items": { "type": "string" } }
        }
      },
      "sort": {
        "type": "string",
        "enum": ["relevance", "price", "unit_price", "rating"],
        "default": "relevance",
        "description": "How to order products. Use unit_price to compare pack sizes."
      },
      "max_products": {
        "type": "integer",
        "minimum": 1,
        "maximum": 20,
        "default": 3,
        "description": "The most products to return."
      }
    },
    "required": ["query"]
  },
  "annotations": {
    "readOnlyHint": true,
    "openWorldHint": true
  }
}

The tool returns the same object as Create a search.

Changelog

More ways to search. Lookups by barcode, retailer ID or link, similar products, price history and suggestions, with three new MCP tools. Offers now carry ratings, badges, promotions and stock for shipping, pickup and same-day delivery. Searching is free within fair use.
Starforest API v1. Searches, products, fresh checks, buy links, retailers and the MCP server.

Coming soon

  • Stock at a store near a ZIP code
  • Whole-list compare
  • Price and stock alerts

To get your API tokens, request access.