Random Products
GEThttps://api-barcode-lookup.dataandapis.com/v1/products/random
Random Products es un endpoint de Barcode Lookup API. Nombre, marca, ingredientes y Nutri-Score de 4,3 millones de códigos de barras.
Envía tu clave en la cabecera X-Api-Key. Cada llamada cuesta 1 token; una clave gratuita incluye 500 tokens al mes.
Petición
Parámetros de consulta
| Parámetro | Ejemplo | |
|---|---|---|
| amount | 3 | Opcional |
Petición de ejemplo
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()Respuesta de ejemplo
Respuesta de ejemplo{
"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",
…
Ver la respuesta completa
Respuesta de ejemplo
{
"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"
}
}
]
}
