Search-a-licious API
Search-a-licious is the pluggable search service Open Food Facts runs over the product collection. It exposes search, facet and chart endpoints and serves its own OpenAPI 3.1 document from the live host.
Search-a-licious is the pluggable search service Open Food Facts runs over the product collection. It exposes search, facet and chart endpoints and serves its own OpenAPI 3.1 document from the live host.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/open-food-facts-search-a-licious"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
{"openapi":"3.1.0","info":{"title":"search-a-licious API","description":"\nThe Search-a-licious API helps you quickly build applications with search capabilities.\n\nYou can find the API documentation here.\n\nSee also the available [web-components](../static/web-components.html) to build your search interface.\n\nSee the [project](https://github.com/openfoodfacts/search-a-licious/) for more information.\n","contact":{"name":"The Open Food Facts team","url":"https://world.openfoodfacts.org/","email":"contact@openfoodfacts.org"},"license":{"name":" AGPL-3.0","url":"https://www.gnu.org/licenses/agpl-3.0.en.html"},"version":"0.1.0"},"paths":{"/document/{identifier}":{"get":{"summary":"Get Document","description":"Fetch a document from Elasticsearch with specific ID.","operationId":"get_document_document__identifier__get","parameters":[{"name":"identifier","in":"path","required":true,"schema":{"type":"string","title":"Identifier"}},{"name":"index_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Index ID to use for the search, if not provided, the default index is used.\n If there is only one index, this parameter is not needed.","title":"Index Id"},"description":"Index ID to use for the search, if not provided, the default index is used.\n If there is only one index, this parameter is not needed."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/search":{"post":{"summary":"Search","operationId":"search_search_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchParameters"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Search Get","operationId":"search_get_search_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The search query, it supports Lucene search query\nsyntax (https://lucene.apache.org/core/3_6_0/queryparsersyntax.html). Words\nthat are not recognized by the lucene query parser are searched as full text\nsearch.\n\nExample: `categories_tags:\"en:beverages\" strawberry brands:\"casino\"` query use a\nfilter clause for categories and brands and look for \"strawberry\" in multiple\nfields.\n\nThe query is optional, but `sort_by` value must then be provided.","title":"Q"},"description":"The search query, it supports Lucene search query\nsyntax (https://lucene.apache.org/core/3_6_0/queryparsersyntax.html). Words\nthat are not recognized by the lucene query parser are searched as full text\nsearch.\n\nExample: `categories_tags:\"en:beverages\" strawberry brands:\"casino\"` query use a\nfilter clause for categories and brands and look for \"strawberry\" in multiple\nfields.\n\nThe query is optional, but `sort_by` value must then be provided."},{"name":"langs","in":"query","required":false,"schema":{"type":"string","description":"List of languages we want to support during search.\nThis list should include the user expected language, and additional languages (such\nas english for example).\n\nThis is currently used for language-specific subfields to choose in which\nsubfields we're searching in.\n\nIf not provided, `['en']` is used.","title":"Langs"},"description":"List of languages we want to support during search.\nThis list should include the user expected language, and additional languages (such\nas english for example).\n\nThis is currently used for language-specific subfields to choose in which\nsubfields we're searching in.\n\nIf not provided, `['en']` is used."},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","description":"Number of results to return per page.","default":10,"title":"Page Size"},"description":"Number of results to return per page."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page to request, starts at 1.","default":1,"title":"Page"},"description":"Page to request, starts at 1."},{"name":"fields","in":"query","required":false,"schema":{"type":"string","description":"List of fields to include in the response. All other fields will be ignored.","title":"Fields"},"description":"List of fields to include in the response. All other fields will be ignored."},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"\nField name to use to sort results, the field should exist\nand be sortable. If it is not provided, results are sorted by descending relevance score.\n\nIf you put a minus before the name, the results will be sorted by descending order.\n\nIf the field name match a known script (defined in your configuration),\nit will be use for sorting.\n\nIn this case you also need to provide additional parameters corresponding to your script parameters.\nIf a script needs parameters, you can only use the POST method.\n\nBeware that this may have a big [impact on performance][perf_link]\n\nAlso bare in mind [privacy considerations][privacy_link] if your script parameters contains sensible data.\n\n[perf_link]: https://openfoodfacts.github.io/search-a-licious/users/how-to-use-scripts/#performance-considerations\n[privacy_link]: https://openfoodfacts.github.io/search-a-licious/users/how-to-use-scripts/#performance-considerations\n","title":"Sort By"},"description":"\nField name to use to sort results, the field should exist\nand be sortable. If it is not provided, results are sorted by descending relevance score.\n\nIf you put a minus before the name, the results will be sorted by descending order.\n\nIf the field name match a known script (defined in your configuration),\nit will be use for sorting.\n\nIn this case you also need to provide additional parameters corresponding to your script parameters.\nIf a script needs parameters, you can only use the POST method.\n\nBeware that this may have a big [impact on performance][perf_link]\n\nAlso bare in mind [privacy considerations][privacy_link] if your script parameters contains sensible data.\n\n[perf_link]: https://openfoodfacts.github.io/search-a-licious/users/how-to-use-scripts/#performance-considerations\n[privacy_link]: https://openfoodfacts.github.io/search-a-licious/users/how-to-use-scripts/#performance-considerations\n"},{"name":"facets","in":"query","required":false,"schema":{"type":"string","description":"Name of facets to return in the response as a comma-separated value.\n If None (default) no facets are returned.","title":"Facets"},"description":"Name of facets to return in the response as a comma-separated value.\n If None (default) no facets are returned."},{"name":"charts","in":"query","required":false,"schema":{"type":"string","description":"Name of vega representations to return in the response.\n Can be distribution chart or scatter plot","title":"Charts"},"description":"Name of vega representations to return in the response.\n Can be distribution chart or scatter plot"},{"name":"index_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Index ID to use for the search, if not provided, the default index is used.\n If there is only one index, this parameter is not needed.","title":"Index Id"},"description":"Index ID to use for the search, if not provided, the default index is used.\n If there is only one index, this parameter is not needed."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ErrorSearchResponse"},{"$ref":"#/components/schemas/SuccessSearchResponse"}],"title":"Response Search Get Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/autocomplete":{"get":{"summary":"Taxonomy Autocomplete","operationId":"taxonomy_autocomplete_autocomplete_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","description":"User autocomplete query.","title":"Q"},"description":"User autocomplete query."},{"name":"taxonomy_names","in":"query","required":true,"schema":{"type":"string","description":"Name(s) of the taxonomy to search in, as a comma-separated value.","title":"Taxonomy Names"},"description":"Name(s) of the taxonomy to search in, as a comma-separated value."},{"name":"lang","in":"query","required":false,"schema":{"type":"string","description":"Language to search in, defaults to 'en'.","default":"en","title":"Lang"},"description":"Language to search in, defaults to 'en'."},{"name":"size","in":"query","required":false,"schema":{"type":"integer","description":"Number of results to return.","default":10,"title":"Size"},"description":"Number of results to return."},{"name":"fuzziness","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Fuzziness level to use, default to no fuzziness.","title":"Fuzziness"},"description":"Fuzziness level to use, default to no fuzziness."},{"name":"index_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Index ID to use for the search, if not provided, the default index is used.\n If there is only one index, this parameter is not needed.","title":"Index Id"},"description":"Index ID to use for the search, if not provided, the default index is used.\n If there is only one index, this parameter is not needed."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Off Demo","operationId":"off_demo__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/off-test":{"get":{"summary":"Html Search","operationId":"html_search_off_test_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","default":24,"title":"Page Size"}},{"name":"langs","in":"query","required":false,"schema":{"type":"string","default":"fr,en","title":"Langs"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"index_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Index ID to use for the search, if not provided, the default index is used.\n If there is only one index, this parameter is not needed.","title":"Index Id"},"description":"Index ID to use for the search, if not provided, the default index is used.\n If there is only one index, this parameter is not needed."},{"name":"display_debug","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Display Debug"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/robots.txt":{"get":{"summary":"Robots Txt","operationId":"robots_txt_robots_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/health":{"get":{"summary":"Healthcheck","operationId":"healthcheck_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"DistributionChartType":{"properties":{"chart_type":{"type":"string","enum":["DistributionChartType"],"const":"DistributionChartType","title":"Chart Type","default":"DistributionChartType"},"field":{"type":"string","title":"Field"}},"type":"object","required":["field"],"title":"DistributionChartType","description":"Describes an entry for a distribution chart"},"ErrorSearchResponse":{"properties":{"debug":{"$ref":"#/components/schemas/SearchResponseDebug"},"errors":{"items":{"$ref":"#/components/schemas/SearchResponseError"},"type":"array","title":"Errors"}},"type":"object","required":["debug","errors"],"title":"ErrorSearchResponse"},"FacetInfo":{"properties":{"name":{"type":"string","title":"Name"},"items":{"items":{"$ref":"#/components/schemas/FacetItem"},"type":"array","title":"Items"},"count_error_margin":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count Error Margin"}},"type":"object","required":["name","items"],"title":"FacetInfo","description":"Search result for a facet"},"FacetItem":{"properties":{"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"},"selected":{"type":"boolean","title":"Selected"}},"type":"object","required":["key","name","count","selected"],"title":"FacetItem","description":"Describes an entry of a facet"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ScatterChartType":{"properties":{"chart_type":{"type":"string","enum":["ScatterChartType"],"const":"ScatterChartType","title":"Chart Type","default":"ScatterChartType"},"x":{"type":"string","title":"X"},"y":{"type":"string","title":"Y"}},"type":"object","required":["x","y"],"title":"ScatterChartType","description":"Describes an entry for a scatter plot"},"SearchParameters":{"properties":{"q":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q","description":"The search query, it supports Lucene search query\nsyntax (https://lucene.apache.org/core/3_6_0/queryparsersyntax.html). Words\nthat are not recognized by the lucene query parser are searched as full text\nsearch.\n\nExample: `categories_tags:\"en:beverages\" strawberry brands:\"casino\"` query use a\nfilter clause for categories and brands and look for \"strawberry\" in multiple\nfields.\n\nThe query is optional, but `sort_by` value must then be provided."},"langs":{"items":{"type":"string"},"type":"array","title":"Langs","description":"List of languages we want to support during search.\nThis list should include the user expected language, and additional languages (such\nas english for example).\n\nThis is currently used for language-specific subfields to choose in which\nsubfields we're searching in.\n\nIf not provided, `['en']` is used.","default":["en"]},"page_size":{"type":"integer","title":"Page Size","description":"Number of results to return per page.","default":10},"page":{"type":"integer","minimum":1.0,"title":"Page","description":"Page to request, starts at 1.","default":1},"fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Fields","description":"List of fields to include in the response. All other fields will be ignored."},"sort_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By","description":"\nField name to use to sort results, the field should exist\nand be sortable. If it is not provided, results are sorted by descending relevance score.\n\nIf you put a minus before the name, the results will be sorted by descending order.\n\nIf the field name match a known script (defined in your configuration),\nit will be use for sorting.\n\nIn this case you also need to provide additional parameters corresponding to your script parameters.\nIf a script needs parameters, you can only use the POST method.\n\nBeware that this may have a big [impact on performance][perf_link]\n\nAlso bare in mind [privacy considerations][privacy_link] if your script parameters contains sensible data.\n\n[perf_link]: https://openfoodfacts.github.io/search-a-licious/users/how-to-use-scripts/#performance-considerations\n[privacy_link]: https://openfoodfacts.github.io/search-a-licious/users/how-to-use-scripts/#performance-considerations\n"},"facets":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Facets","description":"Name of facets to return in the response as a comma-separated value.\n If None (default) no facets are returned."},"charts":{"anyOf":[{"items":{"anyOf":[{"$ref":"#/components/schemas/DistributionChartType"},{"$ref":"#/components/schemas/ScatterChartType"}]},"type":"array"},{"type":"null"}],"title":"Charts","description":"Name of vega representations to return in the response.\n Can be distribution chart or scatter plot"},"sort_params":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Sort Params","description":"Additional parameters when using a sort script in sort_by.\n If the sort script needs parameters, you can only be used the POST method."},"index_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Index Id","description":"Index ID to use for the search, if not provided, the default index is used.\n If there is only one index, this parameter is not needed."}},"type":"object","title":"SearchParameters","description":"Common parameters for search"},"SearchResponseDebug":{"properties":{"query":{"type":"object","title":"Query"}},"type":"object","required":["query"],"title":"SearchResponseDebug"},"SearchResponseError":{"properties":{"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["title"],"title":"SearchResponseError"},"SuccessSearchResponse":{"properties":{"hits":{"items":{"type":"object"},"type":"array","title":"Hits"},"aggregations":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Aggregations"},"facets":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/FacetInfo"},"type":"object"},{"type":"null"}],"title":"Facets"},"charts":{"anyOf":[{"additionalProperties":{"type":"object"},"type":"object"},{"type":"null"}],"title":"Charts"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"page_count":{"type":"integer","title":"Page Count"},"debug":{"$ref":"#/components/schemas/SearchResponseDebug"},"took":{"type":"integer","title":"Took"},"timed_out":{"type":"boolean","title":"Timed Out"},"count":{"type":"integer","title":"Count"},"is_count_exact":{"type":"boolean","title":"Is Count Exact"},"warnings":{"anyOf":[{"items":{"$ref":"#/components/schemas/SearchResponseError"},"type":"array"},{"type":"null"}],"title":"Warnings"}},"type":"object","required":["hits","page","page_size","page_count","debug","took","timed_out","count","is_count_exact"],"title":"SuccessSearchResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}