/v1/unit-price
Requires API key
Compare offers by price per unit
Compares two to fifty offers by price per unit of measure. Quantities are written as people write them (`750 ml`, `6 x 330 ml`, `1 lb 4 oz`) and read with the same rules as Normalize. All offers must measure the same kind of thing. Prices are decimal strings in one currency of your choice; no currency conversion happens. Returns each offer's price per unit, its rank (1 is cheapest, ties share a rank), and how much more it costs than the cheapest offer. Requires the Developer plan or higher.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
offers
|
array | Yes | 2 to 50 objects with a decimal-string `price` and a written `quantity` |
per
|
string | No | Unit to compare in (for example l or kg). Defaults to the category base unit. |
locale
|
string | No | Language tag used to read quantities such as "1,5 l" |
decimals
|
integer | No | Round unit prices to this many fractional places (0-40, half-even). |
Possible errors
INVALID_REQUEST
·
INVALID_VALUE
·
UNKNOWN_UNIT
·
AMBIGUOUS_UNIT
·
INCOMPATIBLE_UNITS
·
PLAN_REQUIRED
·
UNAUTHORIZED
·
INVALID_API_KEY
·
RATE_LIMIT_EXCEEDED
·
QUOTA_EXCEEDED