Search foods by text. Return maximum of 20 items
Query parameters
Preferred catalogue filter for recipe ingredient pickers (e.g. cnf). When set, only return DBFood rows whose nutrition_source or primary_data_origin_code matches. Takes precedence over primary_data_origin_code when both are sent.
Legacy alias for the catalogue filter. Prefer nutrition_source. When set (and nutrition_source is omitted), only return DBFood rows whose primary_data_origin_code or nutrition_source matches.
food returns catalogue foods only. recipe returns recipes only. all returns the owner's recipes first, then foods.
Comma-separated recipe filter tags. Applied only to recipe hits. Every tag must be present.
Per-serving nutrient ranges, applied only to recipe hits. Comma separated nutrient:min..max; either bound may be omitted, e.g. protein_g:20..,sodium_mg:..600,fiber_g:5..15. Limited to the 21 nutrients recipe search indexes: the Canadian Nutrition Facts panel (energy_kcal, fat_g, fattyacids_totalsaturated_g, fattyacids_totaltrans_g, carbohydrate_g, fiber_g, sugars_g, protein_g, cholesterol_mg, sodium_mg, potassium_mg, calcium_mg, iron_mg) plus added_sugars_g, netcarb_g, polyols_g, magnesium_mg, phosphorus_mg, vitamin_c_mg, vitamin_d_iu and folate_dfe_ug. An unknown nutrient or malformed expression is a 400 rather than a silently ignored filter, and at most 10 ranges may be combined.
Shorthand for nutrient_ranges=energy_kcal:<min>... Ignored if nutrient_ranges already sets energy_kcal.
Shorthand for nutrient_ranges=energy_kcal:..<max>.
Shorthand for nutrient_ranges=protein_g:<min>...
Shorthand for nutrient_ranges=protein_g:..<max>.
Response
successful operation
Example response
{
"results": [
{
"nutrient_overrides": {
"aa_patient": {
"ontology": {
"id": 42,
"levels": [
"food"
]
}
},
"bb_reviewer": {
"ontology": {
"id": 42,
"levels": [
"food"
]
}
},
"cc_external": {
"ontology": {
"id": 42,
"levels": [
"food"
]
}
},
"dd_estimate": {
"ontology": {
"id": 42,
"levels": [
"food"
]
}
},
"ee_validation": {
"ontology": {
"id": 42,
"levels": [
"food"
]
}
}
}
}
]
}Changes
Changed in 2 of the 15 revisions of this API.13
- ○
added the new optional
queryrequest parameternutrition_sourcenew-optional-request-parameter
- ○
- ○
added the new optional
queryrequest parameterenergy_kcal_maxnew-optional-request-parameter
- ○
added the new optional
queryrequest parameterenergy_kcal_minnew-optional-request-parameter
- ○
added the new optional
queryrequest parameternutrient_rangesnew-optional-request-parameter
- ○
added the new optional
queryrequest parameterprotein_g_maxnew-optional-request-parameter
- ○
added the new optional
queryrequest parameterprotein_g_minnew-optional-request-parameter
- ○
added the new optional
queryrequest parameterrecipe_tagsnew-optional-request-parameter
- ○
added the new optional
queryrequest parameterresult_kindnew-optional-request-parameter
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○