Product by ID
Retrieve a specific product by its ID (from search or barcode results).
GET /v1/product/{product_id}Request
curl "https://api.c0r.ai/v1/product/c_abc123" \
-H "X-API-Key: fdb_your_key"Python
import requests
response = requests.get(
"https://api.c0r.ai/v1/product/c_abc123",
headers={"X-API-Key": "fdb_your_key"}
)
print(response.json())JavaScript
const response = await fetch(
"https://api.c0r.ai/v1/product/c_abc123",
{ headers: { "X-API-Key": "fdb_your_key" } }
);
const data = await response.json();
console.log(data);Path Parameters
| Parameter | Type | Description |
|---|---|---|
product_id | string | Product ID from a previous search or barcode response (e.g., c_abc123, p_4421903) |
Response — found
{
"id": "c_abc123",
"name": "Chicken breast, raw",
"barcode": null,
"brands": null,
"nutrition": {
"calories": 165,
"proteins": 31.0,
"fats": 3.6,
"carbs": 0.0,
"fiber": null,
"sugar": null,
"sodium": null
},
"food_group": "Meat & Poultry",
"image_url": null,
"source": "curated",
"verified": true
}Response — not found
HTTP/1.1 404 Not Found
{
"detail": "Product not found."
}Notes
- Product IDs starting with
c_are from the curated database. - Product IDs starting with
off_are from OpenFoodFacts. - Product IDs starting with
usda_are from USDA FoodData Central. - IDs are stable — they do not change between API versions.