How Dealophant calculates price per unit
Dealophant ranks Amazon listings by price per unit. This page says how, so the method can be checked against the code.
The pipeline
- Amazon search results. Each search reads Amazon's current results. The same search is cached for 15 minutes, so a price on the page can be up to 15 minutes old. A listing with no price, or a price of zero, is not shown as a deal.
- One unit for the whole search. The unit is decided once, not once per listing. Built-in category rules come first (toilet paper and paper towels are priced per 100 sheets, coffee pods per pod, and so on). If no rule matches, one call to a hosted LLM via OpenRouter picks the unit for that query, and the answer is cached.
- Measure each listing in that unit. A title regex and an LLM step compute the quantity. The model can mark a listing not comparable. Those listings are shown separately and are not ranked.
- Sanity checks. When Amazon's own per-unit price is in a comparable weight or volume unit, it is a cross-check, not the number we rank on. Amazon's data can be wrong too. If the two prices disagree by more than 10x, the listing is withheld from the confident ranking. For sheet units, our price per 100 sheets must also be within 1.5x of Amazon's when Amazon gives one, and an implied count outside 40 to 3000 sheets per roll is withheld the same way. A zero price is never shown.
- Rank by price per unit only. Comparable listings are sorted by price per unit. Nobody can pay to change that order. Links to Amazon are affiliate links.
Unit conversions
Weight is stored in ounces and volume in fluid ounces. A plain count is one item per count. A label such as "100 Sheets" stores the count in hundreds of sheets, so the price stays readable.
- Weight: 1 lb = 16 oz, 1 kg is about 35.274 oz, 1 g is about 0.035274 oz
- Volume: 1 gal = 128 fl oz, 1 L is about 33.814 fl oz, 1 mL is about 0.033814 fl oz
Why some listings are not ranked
A 30-serving tub and a 16-ounce tub are not the same comparison, because serving size is not standard across brands. The search picks one unit. A listing that cannot honestly be measured in that unit is shown under "Other formats" and is not ranked.
Hand-checked test set
As of 2026-05-03, this is a small hand-checked test set, not a measure of accuracy in general. 12 passed, 0 failed. On the fixtures that came back, 12 of 12 passed (100%). Each fixture is one real Amazon ASIN with a hand-checked unit type and count range. Source: script/validateUnitParser.ts. Latest results: data/parser-accuracy.json.
Model calls
Unit choice and listing measurement use a hosted LLM via OpenRouter, at temperature 0. Each model call stops after 5 seconds. The whole unit step stops after 12 seconds, because it may call the model twice (once to choose the unit, once to measure the listings). If a call fails or runs out of time, the regex-only result is used. The category rules are in server/unitResolver.ts. The measurement step is in server/aiUnitParser.ts.
Worked example: the Amazon cross-check
Amazon may send a per-unit string such as $1.86 / ounce. It is read with this pattern:
/\$?\s*([\d.]+)\s*\/\s*(?:(\d+(?:\.\d+)?)\s+)?([a-z][a-z\s]*?)\s*$/i
That match is amount 1.86, unit ounce, multiplier 1. It is converted to dollars per ounce and compared with our price per ounce. If the two differ by more than 10x, the listing is withheld from the confident ranking. Amazon's number does not replace ours. The check runs only for weight and volume units we can convert. A count such as sheets or pods is not used this way.
"Best Value" badge
The badge goes to the lowest price per unit among listings we are willing to stand behind, in the search's unit. Listings under "Other formats", and listings a sanity check withheld, are not eligible. If fewer than 3 listings qualify, the badge is not shown.
Ranking
Comparable listings are sorted by price per unit, low to high. The sort is total price divided by the count in the search's unit. There is no second signal and no paid placement. If two prices match, the order is the order Amazon returned. Links to Amazon are affiliate links. That commission does not enter the sort.
Known limitations
- Missing quantity. When the model step runs, a title with no usable quantity is marked not comparable and left out of the ranking. When the model step fails, the regex is used on its own, and a title with no quantity can be counted as 1.
- Marketing quantities. "Equals 24 regular rolls" is ignored. Toilet paper and paper towels are ranked per 100 sheets (rolls times sheets per roll). A listing with no stated sheet count is not ranked. The price per roll can still be shown beside the ranking.
- Dilution claims. Phrases such as "makes 32 gallons" are stripped before measuring. A few wordings can still slip through.
- United States only. Prices are US dollars from www.amazon.com. The same ASIN can cost something else on another Amazon site.
- Prices move. A cached search can be up to 15 minutes old, and Amazon can change a price again before you click. Confirm on Amazon before you buy.
What Dealophant does not do
- Rank by quality, taste, or reviews. The order is price per unit. "Best Value" means cheapest per unit among listings we can compare.
- Index stores other than Amazon US.
- Let affiliate commission, or any payment, change the order.
Common questions
- Is there a website that calculates price per unit for Amazon products?
- Yes. Dealophant searches Amazon, measures every listing in one unit (ounces, fluid ounces, sheets, pods, loads, batteries and so on) and sorts the results by price per unit, cheapest first. It is free and works in any browser.
- Do I need an account or a browser extension?
- No. Search on dealophant.com with no sign-up and nothing to install.
- What is the difference between a price history tracker and a price-per-unit tool?
- A price tracker such as Keepa or CamelCamelCamel follows one product's price over time, so you know when to buy it. A price-per-unit tool compares many sizes and brands right now, so you know which one to buy. Dealophant does the comparison and also keeps 90-day price history for products people search, so it can say when a price per unit is at a low.
- Does the data come live from Amazon or from a cache?
- From Amazon's own product data. A repeat of the same search can be up to 15 minutes old, and Amazon can change a price before you click, so confirm on Amazon before you buy.
- How does it handle products sold by weight, by count and by volume in the same search?
- Each search picks one unit. Listings that cannot be measured in that unit are shown separately under Other formats and are not ranked, because a price per ounce and a price per count cannot be compared fairly.
- Is the biggest pack always the cheapest per unit?
- No. Bigger packs are often cheaper per unit, but sales and coupons on smaller sizes regularly beat them. Comparing price per unit is the only reliable check.
- Is the ranking biased toward certain sellers or brands?
- No. The order is price per unit only. Nobody can pay to change it, and affiliate commission does not affect it. The method and a public API are on this page so anyone can check.
- How does a free price comparison tool make money?
- Links to Amazon are affiliate links. When someone buys through one, Amazon pays Dealophant a small commission at no extra cost to the shopper. Dealophant sells nothing to brands.
- Is Dealophant part of Amazon?
- No. Dealophant is independent and is not run or endorsed by Amazon.
Public API for verification
The search response is at https://dealophant.com/api/products/search?query=<term> with no authentication. It includes a fetchedAt timestamp, the dominantFamily, and the per-product fields used in the ranking, including Amazon's raw pricePerUnitDisplay string. The measurement code is in server/aiUnitParser.ts.
Affiliate disclosure
As an Amazon Associate, Dealophant earns from qualifying purchases. Links to Amazon are affiliate links. Commission does not change the order. The sort is price per unit only.