Open Prices (Open Food Facts) API
Free grocery price API with no key for reads: crowdsourced product prices tied to a barcode, a shop location from OpenStreetMap and a date. Tested example included.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the Open Prices (Open Food Facts) API?
Open Prices is the Open Food Facts project's price database, readable without an API key. Each record ties a price and currency to a product barcode, an OpenStreetMap shop location and the date the price was observed, along with discount details where relevant.
Product databases are common; price databases are not, because prices are local, volatile and commercially valuable. Open Prices tackles that by crowdsourcing them the same way Open Food Facts crowdsources nutrition data — contributors photograph a shelf label or a receipt, and the resulting record is published openly with the proof attached.
The join keys are what make it interesting. Every price carries a `product_code`, which is the barcode you can look up in Open Food Facts for the full product record, and a `location_osm_id`, which resolves to a real shop in OpenStreetMap. A price here is therefore never a floating number — it is anchored to a specific product, in a specific shop, on a specific date. Coverage is thin and heavily skewed towards France, where the project started, so treat it as a research dataset rather than a pricing feed. Reads are open; contributing a price needs an account, and that write path is outside what this page covers.
Quick facts
- Base URL
https://prices.openfoodfacts.org/api/v1- Authentication
- No key for reads. Adding a price requires an Open Food Facts account and a bearer token; that write path is not documented here.
- Rate limit
- No published hard limit. The project asks for reasonable use and a descriptive User-Agent.
- Pricing
- Free. The data is published under an open licence.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the Open Prices (Open Food Facts) API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. Fetch the most recent crowdsourced prices
GET https://prices.openfoodfacts.org/api/v1/prices?size=1
curl 'https://prices.openfoodfacts.org/api/v1/prices?size=1'const res = await fetch("https://prices.openfoodfacts.org/api/v1/prices?size=1");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://prices.openfoodfacts.org/api/v1/prices?size=1", timeout=20)
res.raise_for_status()
print(res.json()){
"items": [
{
"id": 1,
"product_id": 1,
"location_id": 1,
"proof_id": 9880,
"product": {
"id": 1,
"code": "1541513213246",
"source": null,
"source_last_synced": null,
"product_name": null,
"image_url": null,
"product_quantity": null,
"product_quantity_unit": null,
"quantity": null,
"categories_tags": [],
"brands": null,
"brands_tags": [],
"labels_tags": [],
"nutriscore_grade": null,
"ecoscore_grade": null,
"nova_group": null,
"creator": null,
"unique_scans_n": 0,
"price_count": 3,
"price_currency_count": 1,
"location_count": 1,
"location_type_osm_country_count": 1,
"user_count": 1,
"proof_count": 3,
"created": "2023-11-27T11:37:14.015774Z",
"updated": null
},
"location": {
"id": 1,
"osm_brand_logo_url": null,
"type": "OSM",
"osm_id": 1392117416,
"osm_type": "NODE",
"osm_name": "L'Éléfàn",
"osm_display_name": "L'Éléfàn, 32, Avenue Marcelin Berthelot, Capuche, Secteur 4, Grenoble, Isère, Auvergne-Rhône-Alpes, France métropolitaine, 38100, France",
"osm_tag_key": "shop",
"osm_tag_value": "supermarket",
"osm_brand": null,
"osm_address_postcode": "38100",
"osm_address_city": "Grenoble",
"osm_address_country": "France",
"osm_address_country_code": "FR",
"osm_lat": 45.1750672,
"osm_lon": 5.7304083,Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
size | query | Optional | Records per page, up to 100. Defaults to 50. 1 |
page | query | Optional | 1-based page number. 1 |
product_code | query | Optional | Filter to one barcode — the same identifier Open Food Facts uses. 3017620425035 |
location_osm_id | query | Optional | Filter to one shop by its OpenStreetMap id. 1392117416 |
currency | query | Optional | ISO 4217 currency code. EUR |
order_by | query | Optional | Sort field; prefix with `-` to reverse, for example `-date`. -date |
Response fields
itemsarray- The price records for this page.
items[].pricefloat- The observed price in `currency`. Always read the two together — the field is not normalised to any base currency.
items[].currencystring- ISO 4217 code, most often EUR given the project's origins.
items[].product_codestring- Barcode, joinable straight into the Open Food Facts product API.
items[].datestring- Date the price was observed, `YYYY-MM-DD`. This is the field that matters — `created` is when it was uploaded, which can be much later.
items[].price_is_discounted / price_without_discount / discount_typeboolean / float / string- Promotion details. A discounted price is not the shelf price, so filter on the flag when comparing.
items[].location_osm_id / location_osm_typeinteger / string- OpenStreetMap reference for the shop, with the nested `location` object carrying its resolved name and address.
items[].productobject- Denormalised Open Food Facts record — name, brands, quantity, Nutri-Score, categories. Many fields are null for products the main database has not enriched.
items[].ownerstring- Contributor username who submitted the price.
total / page / pages / sizeinteger- Pagination envelope.
What you can build with the Open Prices (Open Food Facts) API
- Research price variation for the same barcode across shops and countries
- Build a shopping-basket cost comparison for a small geographic area
- Join price history onto Open Food Facts nutrition data for affordability analysis
- Track how often a given product appears in promotions
Common errors and how to fix them
Almost every product field is null
The barcode has a price record but no enriched entry in the main Open Food Facts database.
Fix: Fall back to the Open Food Facts product API by `product_code`, and be ready for genuinely unknown products.
No data for your country
Coverage is crowdsourced and heavily concentrated in France.
Fix: Check counts before building anything on top. Sparse coverage is this dataset's defining limitation.
Prices look inconsistent
Some records are promotional prices, some are shelf prices, and dates span years.
Fix: Filter on `price_is_discounted` and constrain `date` before any comparison.
401 when submitting a price
Writes need an authenticated Open Food Facts account.
Fix: Reads are open; contributing is not. This page documents the read path only.
Open Prices (Open Food Facts) API — frequently asked questions
Is the Open Prices API free?
Yes, free with no key for reading, and the data is published under an open licence. Contributing a price needs an Open Food Facts account.
How complete is the price data?
Not very. It is crowdsourced, concentrated in France and covers a small fraction of products. It suits research and comparison work rather than anything needing a reliable current price.
How does it link to Open Food Facts?
Through `product_code`, which is the product barcode. The same identifier fetches the full nutrition and ingredient record from the main Open Food Facts API.
What does location_osm_id refer to?
The shop, identified by its OpenStreetMap node or way id. The nested `location` object resolves it to a name and address so you do not have to query OSM yourself.
Tools that pair with this API
Percentage Calculator
Calculate what X% of a number is, what percent one number is of another, and percentage increase or decrease between two values — instantly and free.
Wholesale Price Calculator
Build a wholesale and retail price ladder from unit cost, with margin, markup and profit per unit at every tier plus the deepest discount you can offer.
CSV Column Statistics Calculator
Profile a CSV column by column: type, blanks, distinct values, min, max, mean, median, standard deviation and percentiles, plus top values — all in-browser.
ISBN Validator & Converter
Validate an ISBN check digit, convert between ISBN-10 and ISBN-13, add the correct hyphens and check a whole list at once with a pass or fail column.
Open Prices (Open Food Facts) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.