Create OFF object
Fetch implementation to use
Optional
init: RequestInitOptional
init: RequestInitOptions for the OFF Object
Readonly
rawReadonly
rawReadonly
robotoffRobotoff API
Adds or edits a product using the V2 API
The product data to add or edit
Optional
credentials: { password: string; username: string }Optional credentials for authentication
A promise that resolves to true if successful, false otherwise
Crops and selects an image for a product
The barcode of the product
Identifier of the image to select (should be a number)
Identifier of the selected image field (format: {IMAGE_TYPE}_{LANG})
Crop coordinates and options
A promise that resolves to the crop response
Deletes an uploaded image for a product
The barcode of the product corresponding to the image
The id of the image to be deleted
A promise that resolves to the deletion response
Returns all available attribute groups
A promise that resolves to an array of attribute groups
Returns product attributes for a given barcode
The barcode of the product
A promise that resolves to an array of product attributes
Returns an array of image names for the product
The barcode of the product
A promise that resolves to an array of image names or null if not found
Returns only the product name for a given barcode
The barcode of the product
Optional
lang: stringOptional language code for localization
A promise that resolves to the product name or null if not found
Returns reduced product data suitable for displaying on cards
The barcode of the product
Optional
lang: stringOptional language code for localization
A promise that resolves to reduced product data
Returns product data using the V2 API
The barcode of the product
A promise that resolves to the product data or undefined if not found
Returns product details by barcode with optional fields
An array of keys from ProductV3 to return
The barcode of the product
Optional
query: Omit<An optional query object to filter the returned fields
A promise that resolves to a product object with the specified fields or undefined if not found
Rotates an image for a product
The barcode of the product
Identifier of the selected image field (format: {IMAGE_TYPE}_{LANG})
Identifier of the image to rotate (should be a number as string)
Angle of rotation in degrees (90, 180, or 270 clockwise)
A promise that resolves to the rotation response
Optional
<nutrient>_eq_<value>?: Record<string, never>Optional
<nutrient>_gt_<value>?: Record<string, never>Optional
<nutrient>_lt_<value>?: Record<string, never>Optional
<tag_name>_tags_<language_code>?: Record<string, never>Optional
additives_tags?: stringThe additives_tags in english of product(s) you are searching for.
The Open Food Facts Web App has a list of possible values for additives
. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/additives.json
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Optional
allergens_tags?: stringThe allergens_tags in english of product(s) you are searching for.
The Open Food Facts Web App has a list of possible values for allergens
. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/allergens.json
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Optional
brands_tags?: stringThe brands_tags of product(s) you are searching for.
The Open Food Facts Web App has a list of possible values for brands
. Taxonomized values are available at https://static.openfoodfacts.org/data/taxonomies/brands.json
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Optional
categories_tags?: stringThe category of product(s) you are searching for.
The Open Food Facts Web App has a list of possible values for categories
. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/categories.json
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Optional
countries_tags_en?: stringThe countries_tags_en of product(s) you are searching for.
The Open Food Facts Web App shows a list of possible values for countries
. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/countries.json
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Optional
emb_codes_tags?: stringOptional
fields?: stringOptional
labels_tags?: stringThe labels_tags in english of product(s) you are searching for.
The Open Food Facts Web App has a list of possible values for labels
.
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Optional
manufacturing_places_tags?: stringThe manufacturing_places_tags of product(s) you are searching for.
The Open Food Facts Web App has a list of possible values for manufacturing-places
.
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Optional
nutrition_grades_tags?: stringThe nutrition_grades_tags of product(s) you are searching for.
The Open Food Facts Web App has a list of possible values for nutrition-grades
.
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Optional
origins_tags?: stringThe origins_tags of product(s) you are searching for. The Open Food Facts Web App has a list of possible values for origins
.
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Optional
packaging_tags_de?: stringThe packaging_tag in german of product(s) you are searching for.
The Open Food Facts Web App has a list of possible values for packaging
.
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Optional
page?: numberOptional
page_size?: numberOptional
purchase_places_tags?: stringOptional
sort_by?: The allowed values used to sort/order the search results.
* `product_name` sorts on name
* `ecoscore_score`, `nova_score`, `nutriscore_score` rank on the [Eco-Score](https://world.openfoodfacts.org/eco-score-the-environmental-impact-of-food-products), [Nova](https://world.openfoodfacts.org/nova), or [Nutri-Score](https://world.openfoodfacts.org/nutriscore)
* `scans_n`, `unique_scans_n` and `popularity_key` are about product popularity: number of scans on unique scans, rank of product
* `created_t`, `last_modified_t`, are about creation and modification dates
* `nothing`, tells not to sort at all (because if you do not provide the sort_by argument we default to sorting on popularity (for food) or last modification date)
Optional
states_tags?: stringThe states_tags in english of product(s) you are searching for.
The Open Food Facts Web App has a list of possible values for states
. Translated values are available at https://static.openfoodfacts.org/data/taxonomies/states.json
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Optional
stores_tags?: stringOptional
traces_tags?: stringThe traces_tags of product(s) you are searching for.
The Open Food Facts Web App shows a list of possible values for traces
.
You can use multiple values by using a comma separated list.
You can add a "-" before values to avoid matching a tag.
Unselects an image for a product
The barcode of the product
Image field (image id) of the photo to unselect (e.g., "front_fr")
A promise that resolves to the unselect response
Uploads an image to OpenFoodFacts for a product.
The barcode of the product
The image file to upload
The field name for the image (e.g., "front", "ingredients", "nutrition")
A promise that resolves to the upload response
Static
getGets URL for a product image based on its barcode and image name
Product barcode
Name of the image (e.g., "front", "ingredients", "nutrition")
Image metadata from product data
Image size (100, 200, 400, or full) - defaults to 400
Complete URL to the specific image or null if not found
Wrapper of OFF API