# Open Food Facts on Onekey > 2 endpoints for Open Food Facts (2 stable, 0 beta), 1 to 5 credits each. Category: E-commerce & marketplaces. One key, one JSON shape. Base URL: https://api.onekey.dev Auth: header `x-api-key: `. Call shape: `GET /v1/{platform}/{endpoint}?{params}`. Every response is `{success, data, metadata, error}`; check `success` first. Cost is in `metadata.credits_charged`. Free when served from cache (0.2 credit for a cached response over 100 KB). Failed and not-found calls are refunded. Status: stable = verified against the live source; beta = not yet verified, fields may be missing. Page: https://onekey.dev/platforms/openfoodfacts Reference (Markdown): https://onekey.dev/docs/api/openfoodfacts.md All docs: https://onekey.dev/llms.txt ## Canonical fields returned Unified-schema fields (same names on every platform), with how many of the 2 mapped Open Food Facts endpoints return each: - `entity.category` (string): 2 - `entity.id` (string): 2 - `entity.name` (string): 2 - `listing.brand` (string): 2 - `media.thumbnailUrl` (URL): 2 - plus 12 platform-specific fields under `ext.` ## Endpoints ### openfoodfacts.product Open Food Facts: product by barcode. - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/openfoodfacts/product?code=737628064502` with header `x-api-key: YOUR_API_KEY` - Parameters: - `code` (string, required): Barcode (EAN/UPC), digits only - Fields returned: `entity.id`, `entity.name`, `listing.brand`, `entity.category`, `media.thumbnailUrl`, `ext.quantity`, `ext.ingredients`, `ext.countries`, `ext.nutriscore`, `ext.nova`, `ext.ecoscore`, `ext.allergens`, `ext.kcalPer100g`, `ext.fatPer100g`, `ext.sugarsPer100g`, `ext.proteinPer100g`, `ext.saltPer100g` - Reference: https://onekey.dev/docs/api/openfoodfacts/product.md ### openfoodfacts.search Open Food Facts: full-text product search. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/openfoodfacts/search?q=nutella` with header `x-api-key: YOUR_API_KEY` - Parameters: - `q` (string, required): Search query - Fields returned: `entity.id`, `entity.name`, `listing.brand`, `entity.category`, `media.thumbnailUrl`, `ext.quantity`, `ext.ingredients`, `ext.countries`, `ext.nutriscore`, `ext.nova`, `ext.ecoscore`, `ext.allergens`, `ext.kcalPer100g`, `ext.fatPer100g`, `ext.sugarsPer100g`, `ext.proteinPer100g`, `ext.saltPer100g` - Reference: https://onekey.dev/docs/api/openfoodfacts/search.md ## Sample request ```bash curl "https://api.onekey.dev/v1/openfoodfacts/product?code=737628064502" \ -H "x-api-key: YOUR_API_KEY" ```