Search Products
Search request allows you to get products that match your search criteria.
It allows you create many custom APIs for your use case.
If a search query parameter has multiple values, separate them with commas (,).
When filtering with a language-specific parameter (fr, de, en, etc.),
specify the language code in the parameter name (for example: categories_tags_en).
Important: search API v2 does not support full text request (search_term), you have to use search API v1 for that. Upcoming search-a-licious project will fix that.
Limiting results
You can limit the size of returned objects thanks to the fields object (see below).
Example: fields=code,product_name,brands,attribute_groups
Please use it as much as possible to avoid overloading the servers.
The search endpoint uses pagination: see page and page_size parameters.
Beware: page_count is the number of products returned in the current page, not the total number of pages.
Conditions on tags
All `_tags`` parameters accepts either:
- a single value
- or a comma-separated list of values (doing a AND)
- or a pipe separated list of values (doing a OR)
You can exclude terms by using a "-" prefix.
For taxonomized entries, you might either use the tag id (recommended), or a known synonym (without language prefix)
labels_tags=en:organic,en:fair-tradefind items that are fair-trade AND organiclabels_tags=en:organic|en:fair-tradefind items that are fair-trade OR organiclabels_tags=en:organic,en:-fair-tradefind items that are organic BUT NOT fair-trade
Conditions on nutriments
To get a list of nutrients:
You can either query on nutrient per 100g (_100g suffix)
or per serving (serving suffix).
You can also add _prepared_
to get the nutrients in the prepared product instead of as sold.
You can add a comparison operator and value to the parameter name to get products with nutrient above or below a value. If you use a parameter value it exactly match it.
energy-kj_100g<200products where energy in kj for 100g is less than 200kjsugars_serving>10products where sugar per serving is greater than 10gsaturated-fat_100g=1products where saturated fat per 100g is exactly 10gsalt_prepared_serving<0.1products where salt per serving for prepared product is less than 0.1g
Combining filters and pagination (examples)
-
Breakfast cereals with Nutri-Score A or B, with explicit pagination:
/api/v2/search?categories_tags_en=breakfast-cereals&nutrition_grades_tags=a|b&page=2&page_size=20&fields=code,product_name,nutrition_grades -
Multiple constraints in one query (category + nutrients + sorting + compact fields):
/api/v2/search?categories_tags_en=orange-juices&sugars_100g%3C8&salt_100g%3C0.2&sort_by=last_modified_t&page=1&page_size=24&fields=code,product_name,nutriments -
Include/exclude tags together:
/api/v2/search?labels_tags=en:organic,en:-fair-trade&page=1&page_size=24&fields=code,product_name,labels_tags
Response structure at a glance
A successful response contains:
count: total number of matching productspage: current page numberpage_size: requested number of products per pagepage_count: number of products actually returned in this pageskip: number of products skipped before this pageproducts: array of products for the current page
Total page count can be computed with:
Math.floor((count - 1) / page_size) + 1
More references
See also wiki page
userAgentAuthUser-Agent<token>Identification using the User-Agent header. This is recommended in all requests so that we can contact you if there are issues. If we cannot identify the source of problematic API queries, we may have to block them. User-Agent header in the format 'app_name/app_version (URL or contact info)'
<nutrient>_lt_<value>?Search on nutrient lower than a value
<nutrient>_gt_<value>?Search on nutrient greater than a value
<nutrient>_eq_<value>?Search on nutrient for an exact quantity
fields?stringSpecific fields to return. Use 'knowledge_panels' for Knowledge Panels only.
^[a-zA-Z0-9_.-]+(,[a-zA-Z0-9_.-]+)*$sort_by?stringThe allowed values used to sort/order the search results.
product_namesorts on nameecoscore_score,nova_score,nutriscore_scorerank on the Eco-Score, Nova, or Nutri-Scorescans_n,unique_scans_nandpopularity_keyare about product popularity: number of scans on unique scans, rank of productcreated_t,last_modified_t, are about creation and modification datesnothing, 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)
"product_name""last_modified_t""scans_n""unique_scans_n""created_t""completeness""popularity_key""nutriscore_score""nova_score""nothing""ecoscore_score"page?integerThe page number you request to view (eg. in search results spanning multiple pages)
page_size?integerThe number of elements should be sent per page
OK
application/json- response
count?integerTotal number of products found
page?integerPage number of returned results.
You can get a different page, by using the page query parameter.
page_count?integerNumber of products returned in the current page.
This will differ from page_size only on the last page.
page_size?integerRequested number of products per page.
To get the number of pages, compute:
Math.floor((count - 1) / page_size) + 1
products?array<>The products matching the query corresponding to current page
skip?integerNumber of matching products skipped before the current page.
curl -X GET 'https://world.openfoodfacts.net/api/v2/search'{ "count": 0, "page": 0, "page_count": 0, "page_size": 0, "products": [ { "product_name": "string", "abbreviated_product_name": "string", "code": "string", "codes_tags": [ "code-13" ], "generic_name": "string", "id": "string", "lc": "string", "lang": "string", "nova_group": 0, "nova_groups": "string", "obsolete": "string", "obsolete_since_date": "string", "product_quantity": "string", "product_quantity_unit": "string", "quantity": "string", "schema_version": 0, "product_type": "beauty", "additives_n": 0, "checked": "string", "complete": 0, "completeness": 0, "ecoscore_grade": "string", "ecoscore_score": 0, "food_groups": "string", "food_groups_tags": [ "string" ], "nutrient_levels": { "fat": "low", "salt": "low", "saturated-fat": "low", "sugars": "low" }, "packaging_text": "string", "packagings": [ { "number_of_units": 6, "shape": { "id": "en:bottle", "lc_name": "bouteille" }, "material": { "id": "en:bottle", "lc_name": "bouteille" }, "recycling": { "id": "en:bottle", "lc_name": "bouteille" }, "quantity_per_unit": "25 cl", "quantity_per_unit_value": 25, "quantity_per_unit_unit": "cl", "weight_specified": 30, "weight_measured": 32, "weight_estimated": 26, "weight": 30, "weight_source_id": "specified" } ], "packagings_complete": 0, "pnns_groups_1": "string", "pnns_groups_1_tags": [ "string" ], "pnns_groups_2": "string", "pnns_groups_2_tags": [ "string" ], "popularity_key": 0, "popularity_tags": [ "string" ], "scans_n": 0, "unique_scans_n": 0, "serving_quantity": "string", "serving_quantity_unit": "string", "serving_size": "string", "brands": "string", "brands_tags": [ "string" ], "categories": "string", "categories_tags": [ "string" ], "checkers_tags": [ "string" ], "cities": "string", "cities_tags": [ {} ], "correctors_tags": [ "string" ], "countries": "string", "countries_tags": [ "string" ], "ecoscore_tags": [ "string" ], "emb_codes": "string", "emb_codes_tags": [ {} ], "labels": "string", "labels_tags": [ "string" ], "entry_dates_tags": [ "2016-03-11", "2016-03", "2016" ], "manufacturing_places": "string", "manufacturing_places_tags": [ "string" ], "nova_groups_tags": [ "string" ], "nutrient_levels_tags": [ "string" ], "brands_hierarchy": [ "string" ], "brands_lc": "string", "categories_hierarchy": [ "string" ], "categories_lc": "string", "countries_hierarchy": [ "string" ], "countries_lc": "string", "emb_codes_orig": "string", "labels_hierarchy": [ "string" ], "labels_lc": "string", "images": { "front": { "angle": 0, "coordinates_image_size": "string", "geometry": "string", "imgid": "string", "normalize": null, "rev": "string", "sizes": { "100": { "h": 0, "w": 0 }, "200": { "h": 0, "w": 0 }, "400": { "h": 0, "w": 0 }, "full": { "h": 0, "w": 0 } }, "white_magic": null, "x1": "string", "x2": "string", "y1": "string", "y2": "string" }, "property1": { "imgid": 0, "sizes": { "full": { "h": 0, "w": 0 } }, "uploaded_t": "string", "uploader": "string" }, "property2": { "imgid": 0, "sizes": { "full": { "h": 0, "w": 0 } }, "uploaded_t": "string", "uploader": "string" } }, "last_image_dates_tags": [ "string" ], "last_image_t": 0, "selected_images": { "front": { "display": {}, "small": {}, "thumb": {} } }, "image_small_url": "string", "image_thumb_url": "string", "image_url": "string", "ecoscore_data": { "adjustments": { "origins_of_ingredients": { "aggregated_origins": [ { "epi_score": "string", "origin": "string", "percent": 0, "transportation_score": null } ], "epi_score": 0, "epi_value": 0, "origins_from_categories": [ "string" ], "origins_from_origins_field": [ "string" ], "transportation_score": 0, "transportation_scores": { "property1": 0, "property2": 0 }, "transportation_value": 0, "transportation_values": { "property1": 0, "property2": 0 }, "value": 0, "values": { "property1": 0, "property2": 0 }, "warning": "string" }, "packaging": { "non_recyclable_and_non_biodegradable_materials": 0, "packagings": [ { "ecoscore_material_score": 0, "ecoscore_shape_ratio": 0, "material": "string", "shape": "string", "number_of_units": 1, "quantity_per_unit": "33 cL", "quantity_per_unit_unit": "cl", "quantity_per_unit_value": 33, "recycling": "en:recycle-in-sorting-bin", "weight_measured": 12.08 } ], "score": 0, "value": 0, "warning": "string" }, "production_system": { "labels": "vegan", "value": 0, "warning": "string" }, "threatened_species": { "ingredient": "string", "value": 0 } }, "agribalyse": { "agribalyse_proxy_food_code": "string", "agribalyse_food_code": "string", "co2_agriculture": 0, "co2_consumption": 0, "co2_distribution": 0, "co2_packaging": 0, "co2_processing": 0, "co2_total": 0, "co2_transportation": 0, "code": "string", "dqr": "string", "ef_agriculture": 0, "ef_consumption": 0, "ef_distribution": 0, "ef_packaging": 0, "ef_processing": 0, "ef_total": 0, "ef_transportation": 0, "is_beverage": 0, "name_en": "string", "score": 0, "version": "string" }, "grade": "string", "grades": {}, "missing": { "labels": 0, "origins": 0, "packagings": 0 }, "missing_data_warning": 0, "previous_data": { "grade": "string", "score": 0, "agribalyse": { "agribalyse_proxy_food_code": "string", "agribalyse_food_code": "string", "co2_agriculture": 0, "co2_consumption": 0, "co2_distribution": 0, "co2_packaging": 0, "co2_processing": 0, "co2_total": 0, "co2_transportation": 0, "code": "string", "dqr": "string", "ef_agriculture": 0, "ef_consumption": 0, "ef_distribution": 0, "ef_packaging": 0, "ef_processing": 0, "ef_total": 0, "ef_transportation": 0, "is_beverage": 0, "name_en": "string", "score": 0, "version": "string" } }, "score": 0, "scores": {}, "status": "string" }, "ecoscore_extended_data_version": "string", "environment_impact_level": "string", "environment_impact_level_tags": [ {} ], "additives_tags": [ "string" ], "allergens": "string", "allergens_lc": "string", "allergens_hierarchy": [ "string" ], "allergens_tags": [ "string" ], "ingredients": [ { "id": "string", "ingredients": [ {} ], "percent": 0, "percent_estimate": 0, "percent_max": "string", "percent_min": 0, "text": "string", "vegan": "string", "vegetarian": "string" } ], "ingredients_analysis": { "en:palm-oil": [ "string" ], "en:vegan-status-unknown": [ "string" ], "en:vegetarian-status-unknown": [ "string" ] }, "ingredients_analysis_tags": [ "string" ], "ingredients_from_or_that_may_be_from_palm_oil_n": 0, "ingredients_from_palm_oil_n": 0, "ingredients_from_palm_oil_tags": [ {} ], "ingredients_hierarchy": [ "string" ], "ingredients_n": 0, "ingredients_n_tags": [ "string" ], "ingredients_original_tags": [ "string" ], "ingredients_percent_analysis": 0, "ingredients_sweeteners_n": 0, "ingredients_non_nutritive_sweeteners_n": 0, "ingredients_tags": [ "string" ], "ingredients_lc": "string", "ingredients_text": "string", "ingredients_text_with_allergens": "string", "ingredients_that_may_be_from_palm_oil_n": 0, "ingredients_that_may_be_from_palm_oil_tags": [ {} ], "ingredients_with_specified_percent_n": 0, "ingredients_with_specified_percent_sum": 0, "ingredients_with_unspecified_percent_n": 0, "ingredients_with_unspecified_percent_sum": 0, "known_ingredients_n": 0, "origins": "string", "origins_hierarchy": [ {} ], "origins_lc": "string", "origins_tags": [ {} ], "traces": "string", "traces_hierarchy": [ {} ], "traces_lc": "string", "traces_tags": [ {} ], "unknown_ingredients_n": 0, "no_nutrition_data": "string", "nutrition_data_per": "serving", "nutrition_data_prepared_per": "serving", "nutriments": { "alcohol": 0, "carbohydrates": 0, "carbohydrates-total": 0, "energy": 0, "energy_value": 0, "energy_unit": "kcal", "energy-kcal": 0, "energy-kj": 0, "fat": 0, "fruits-vegetables-legumes-estimate-from-ingredients": 0, "fruits-vegetables-nuts-estimate-from-ingredients": 0, "nova-group": 0, "nutrition-score-fr": null, "proteins": 0, "salt": 0, "saturated-fat": 0, "sodium": 0, "sugars": 0, "carbon-footprint-from-known-ingredients_product": 0, "carbon-footprint-from-known-ingredients_serving": 0, "erythritol": 0 }, "nutrition_grade_fr": "string", "nutrition_grades": "string", "nutrition_grades_tags": [ "string" ], "nutrition_score_beverage": 0, "nutrition_score_warning_fruits_vegetables_nuts_estimate_from_ingredients": 0, "nutrition_score_warning_fruits_vegetables_nuts_estimate_from_ingredients_value": 0, "nutrition_score_warning_no_fiber": 0, "other_nutritional_substances_tags": [ {} ], "unknown_nutrients_tags": [ {} ], "vitamins_tags": [ {} ], "nutriscore": { "2021": { "category_available": 1, "grade": "d", "nutrients_available": 1, "nutriscore_applicable": 1, "nutriscore_computed": 1, "score": 13, "data": { "is_beverage": 0, "is_cheese": 0, "is_water": 0, "is_fat": 0, "energy": 1996, "energy_points": 5, "energy_value": 1996, "fiber": 3.8, "fiber_points": 4, "fiber_value": 3.8, "fruits_vegetables_nuts_colza_walnut_olive_oils": 0, "fruits_vegetables_nuts_colza_walnut_olive_oils_points": 0, "fruits_vegetables_nuts_colza_walnut_olive_oils_value": 0, "proteins": 6.6, "proteins_points": 4, "proteins_value": 6.6, "saturated_fat": 6.2, "saturated_fat_points": 6, "saturated_fat_value": 6.2, "sodium": 210, "sodium_points": 2, "sodium_value": 210, "sugars": 21.5, "sugars_points": 4, "sugars_value": 21.5, "negative_points": 17, "positive_points": 4, "grade": "d", "score": 13 } }, "2023": { "category_available": 1, "grade": "d", "nutrients_available": 1, "nutriscore_applicable": 1, "nutriscore_computed": 1, "score": 13, "data": { "is_beverage": 0, "is_cheese": 0, "is_water": 0, "is_fat_oil_nuts_seeds": 0, "is_red_meat_product": 0, "components": { "negative": [ { "id": "energy", "points": 5, "points_max": 10, "unit": "kJ", "value": 21.5 } ], "positive": [ { "id": "energy", "points": 5, "points_max": 10, "unit": "kJ", "value": 21.5 } ] }, "count_proteins": 0, "count_proteins_reason": "negative_points_greater_than_or_equal_to_11", "negative_points": 19, "positive_points": 1, "negative_points_max": 55, "positive_points_max": 10, "positive_nutrients": [ "fiber", "fruits_vegetables_legumes" ] } } }, "nutriscore_2021_tags": [ "d" ], "nutriscore_2023_tags": [ "d" ], "nutriscore_data": { "saturated_fat_ratio": 0, "saturated_fat_ratio_points": 0, "saturated_fat_ratio_value": 0, "is_beverage": 0, "is_cheese": 0, "is_water": 0, "is_fat": 0, "energy": 1996, "energy_points": 5, "energy_value": 1996, "fiber": 3.8, "fiber_points": 4, "fiber_value": 3.8, "fruits_vegetables_nuts_colza_walnut_olive_oils": 0, "fruits_vegetables_nuts_colza_walnut_olive_oils_points": 0, "fruits_vegetables_nuts_colza_walnut_olive_oils_value": 0, "proteins": 6.6, "proteins_points": 4, "proteins_value": 6.6, "saturated_fat": 6.2, "saturated_fat_points": 6, "saturated_fat_value": 6.2, "sodium": 210, "sodium_points": 2, "sodium_value": 210, "sugars": 21.5, "sugars_points": 4, "sugars_value": 21.5, "negative_points": 17, "positive_points": 4, "grade": "d", "score": 13 }, "nutriscore_grade": "d", "nutriscore_score": 13, "nutriscore_score_opposite": -13, "nutriscore_tags": [ "d" ], "nutriscore_version": "string", "data_quality_bugs_tags": [ "string" ], "data_quality_errors_tags": [ "string" ], "data_quality_info_tags": [ "string" ], "data_quality_tags": [ "string" ], "data_quality_warnings_tags": [ "string" ], "data_sources": "string", "data_sources_tags": [ "string" ], "last_check_dates_tags": [ "string" ], "last_checked_t": 0, "last_checker": "string", "states": "string", "states_hierarchy": [ "string" ], "states_tags": [ "string" ], "misc_tags": [ "string" ], "additives_original_tags": [ "string" ], "additives_prev_original_tags": [ "string" ], "added_countries_tags": [ {} ], "allergens_from_ingredients": "string", "allergens_from_user": "string", "amino_acids_prev_tags": [ {} ], "amino_acids_tags": [ {} ], "carbon_footprint_percent_of_known_ingredients": 0, "categories_properties": { "agribalyse_food_code:en": "string", "agribalyse_proxy_food_code:en": "string", "ciqual_food_code:en": "string" }, "categories_properties_tags": [ "string" ], "category_properties": { "property1": "string", "property2": "string" }, "ciqual_food_name_tags": [ "string" ], "compared_to_category": "string", "forest_footprint_2026": { "grade": "a", "summary": "missing_ingredients", "total_footprint_per_kg": 0, "primary_ingredients": { "property1": { "footprint_per_kg": 0, "grade": "a", "ingredients": [ { "equivalence_ingredient": 0, "equivalence_ingredient_category": 0, "footprint_per_kg": 0, "ingredient_category_id": "string", "ingredient_id": "string", "label_id": "string", "origin_footprint": 0, "origin_id": "string", "percent": 0, "primary_ingredient_id": "string", "risk_factor": 0, "transformation_factor": 0 } ] }, "property2": { "footprint_per_kg": 0, "grade": "a", "ingredients": [ { "equivalence_ingredient": 0, "equivalence_ingredient_category": 0, "footprint_per_kg": 0, "ingredient_category_id": "string", "ingredient_id": "string", "label_id": "string", "origin_footprint": 0, "origin_id": "string", "percent": 0, "primary_ingredient_id": "string", "risk_factor": 0, "transformation_factor": 0 } ] } } }, "conservation_conditions": "string", "customer_service": "string", "expiration_date": "string", "link": "string", "main_countries_tags": [ {} ], "minerals_prev_tags": [ {} ], "minerals_tags": [ {} ], "owner_fields": { "additionalProperties": 0 }, "nova_groups_markers": { "property1": [ [ "string" ] ], "property2": [ [ "string" ] ] }, "nucleotides_tags": [ {} ], "origin": "string", "purchase_places": "string", "purchase_places_tags": [ "string" ], "stores": "string", "stores_tags": [ "string" ], "traces_from_ingredients": "string", "traces_from_user": "string", "created_t": 0, "creator": "string", "editors_tags": [ "string" ], "informers_tags": [ "string" ], "interface_version_created": "string", "interface_version_modified": "string", "languages": {}, "languages_codes": {}, "languages_hierarchy": [ "string" ], "languages_tags": [ "string" ], "last_edit_dates_tags": [ "string" ], "last_editor": "string", "last_modified_by": "string", "last_modified_t": 0, "last_updated_t": 0, "owner": "string", "owners_tags": "string", "photographers_tags": [ "string" ], "rev": 0, "sources": [ { "fields": [ "string" ], "id": "string", "images": [ {} ], "import_t": 0, "manufacturer": 0, "name": "string", "source_licence": "string", "source_licence_url": "string", "url": null } ], "sources_fields": { "org-gs1": { "gln": "string", "gpcCategoryCode": "string", "gpcCategoryName": "string", "isAllergenRelevantDataProvided": "string", "lastChangeDateTime": "string", "partyName": "string", "productionVariantDescription": "string", "publicationDateTime": "string" } }, "teams": "string", "teams_tags": [ "string" ], "update_key": "string", "knowledge_panels": { "additionalProperties": "string" }, "attribute_groups": [ { "id": "string", "status": "known", "title": "string", "match": 0, "grade": "unknown", "name": "string", "icon_url": "string", "description": "string", "description_short": "string" } ] } ], "skip": 0}