Random Products
GEThttps://api-barcode-lookup.dataandapis.com/v1/products/random
Random Products is an endpoint of the Barcode Lookup API. Product name, brand, ingredients and Nutri-Score for 4.3 million barcodes.
Send your key in the X-Api-Key header. Each call costs 1 token; a free key includes 500 tokens a month.
Request
Query parameters
| Parameter | Example | |
|---|---|---|
| amount | 3 | Optional |
Example request
curl
curl "https://api-barcode-lookup.dataandapis.com/v1/products/random?amount=3" \
-H "X-Api-Key: YOUR_API_KEY"Node.js
const res = await fetch("https://api-barcode-lookup.dataandapis.com/v1/products/random?amount=3", {
headers: { "X-Api-Key": process.env.DATAANDAPIS_KEY },
});
const data = await res.json();Python
import os, requests
r = requests.get(
"https://api-barcode-lookup.dataandapis.com/v1/products/random?amount=3",
headers={"X-Api-Key": os.environ["DATAANDAPIS_KEY"]},
)
data = r.json()Example response
Example response{
"ok": true,
"count": 1,
"results": [
{
"barcode": "4056489603337",
"name": "Ταχίνι Κακαο",
"brand": "Γλυκανθη",
"quantity": null,
"categories": "bg:cocoa-tahini",
"labels": "Rainforest Alliance",
"countries": "Greece",
"allergens": null,
"serving_size": "100 g",
"ingredients": "Tahini with cacas, Ingredients: 62% tahini (ground esame), sugar, 6% fat-reduced cocoa powder*, palm oil, emulsifier: soy lecithin, flavourings. * Rainforest Alliance Certified. Find out more at ra.org.",
"scores": {
"nutriscore": "e",
"nova_group": null,
"ecoscore": null
},
"nutriments_per_100g": {},
"completeness": 0.6,
"image_url": "https://images.openfoodfacts.org/images/products/405/648/960/3337/front_bg.6.400.jpg",
"last_modified": "2026-02-06",
"attribution": {
"dataset": "food",
"source": "Open Food Facts",
"source_url": "https://world.openfoodfacts.org/product/4056489603337",
…
Show full response
Example response
{
"ok": true,
"count": 1,
"results": [
{
"barcode": "4056489603337",
"name": "Ταχίνι Κακαο",
"brand": "Γλυκανθη",
"quantity": null,
"categories": "bg:cocoa-tahini",
"labels": "Rainforest Alliance",
"countries": "Greece",
"allergens": null,
"serving_size": "100 g",
"ingredients": "Tahini with cacas, Ingredients: 62% tahini (ground esame), sugar, 6% fat-reduced cocoa powder*, palm oil, emulsifier: soy lecithin, flavourings. * Rainforest Alliance Certified. Find out more at ra.org.",
"scores": {
"nutriscore": "e",
"nova_group": null,
"ecoscore": null
},
"nutriments_per_100g": {},
"completeness": 0.6,
"image_url": "https://images.openfoodfacts.org/images/products/405/648/960/3337/front_bg.6.400.jpg",
"last_modified": "2026-02-06",
"attribution": {
"dataset": "food",
"source": "Open Food Facts",
"source_url": "https://world.openfoodfacts.org/product/4056489603337",
…{
"ok": true,
"count": 1,
"results": [
{
"barcode": "4056489603337",
"name": "Ταχίνι Κακαο",
"brand": "Γλυκανθη",
"quantity": null,
"categories": "bg:cocoa-tahini",
"labels": "Rainforest Alliance",
"countries": "Greece",
"allergens": null,
"serving_size": "100 g",
"ingredients": "Tahini with cacas, Ingredients: 62% tahini (ground esame), sugar, 6% fat-reduced cocoa powder*, palm oil, emulsifier: soy lecithin, flavourings. * Rainforest Alliance Certified. Find out more at ra.org.",
"scores": {
"nutriscore": "e",
"nova_group": null,
"ecoscore": null
},
"nutriments_per_100g": {},
"completeness": 0.6,
"image_url": "https://images.openfoodfacts.org/images/products/405/648/960/3337/front_bg.6.400.jpg",
"last_modified": "2026-02-06",
"attribution": {
"dataset": "food",
"source": "Open Food Facts",
"source_url": "https://world.openfoodfacts.org/product/4056489603337",
"licence": "ODbL v1.0"
}
}
]
}
