{"openapi":"3.0.3","info":{"title":"bon happetee Food API","version":"1.0.0","description":"Indian food and nutrition data: search foods, then fetch nutrition, health-condition suitability and ingredients by food_item_id. Authenticate with your key in the x-api-key header."},"servers":[{"url":"https://api.bonhappetee.com"}],"security":[{"ApiKeyAuth":[]}],"tags":[{"name":"Search"},{"name":"Food"},{"name":"Ingredients"}],"paths":{"/search":{"get":{"operationId":"search","summary":"Search foods","description":"Search food items by name or keyword. Results are paginated and include each item's food_item_id, which the other endpoints take.","tags":["Search"],"parameters":[{"name":"value","in":"query","required":true,"description":"Food name or keyword to search for.","schema":{"type":"string"},"example":"dosa"},{"name":"limit","in":"query","required":false,"description":"Results per page.","schema":{"type":"integer","enum":[10,20,50,100]}},{"name":"page","in":"query","required":false,"description":"Page number, starting at 1.","schema":{"type":"integer"},"example":1}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Missing or invalid API key"},"429":{"description":"Rate limit or monthly quota exceeded"}}}},"/search/v2":{"get":{"operationId":"searchV2","summary":"Search foods (v2)","description":"Same parameters and response as /search, backed by the newer search algorithm. To switch, change the path; nothing else in your integration changes.","tags":["Search"],"parameters":[{"name":"value","in":"query","required":true,"description":"Food name or keyword to search for.","schema":{"type":"string"},"example":"dosa"},{"name":"limit","in":"query","required":false,"description":"Results per page.","schema":{"type":"integer","enum":[10,20,50,100]}},{"name":"page","in":"query","required":false,"description":"Page number, starting at 1.","schema":{"type":"integer"},"example":1}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Missing or invalid API key"},"429":{"description":"Rate limit or monthly quota exceeded"}}}},"/food":{"get":{"operationId":"food","summary":"Food details","description":"Full nutrition profile for one food item: nutrients per serving, serving units, tags and suitability for health conditions.","tags":["Food"],"parameters":[{"name":"food_item_id","in":"query","required":true,"description":"Unique ID of the food item, as returned by /search.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Missing or invalid API key"},"429":{"description":"Rate limit or monthly quota exceeded"}}}},"/food/basic":{"get":{"operationId":"foodBasic","summary":"Food basics","description":"A lighter version of /food with the core details only. Use it when you don't need the full nutrient breakdown.","tags":["Food"],"parameters":[{"name":"food_item_id","in":"query","required":true,"description":"Unique ID of the food item, as returned by /search.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"403":{"description":"Missing or invalid API key"},"429":{"description":"Rate limit or monthly quota exceeded"}}}},"/food/disorder":{"get":{"operationId":"foodDisorder","summary":"Health conditions","description":"How suitable a food item is for specific health conditions, with a risk factor, the reason, and healthier alternatives for each condition.","tags":["Food"],"parameters":[{"name":"food_item_id","in":"query","required":true,"description":"Unique ID of the food item, as returned by /search.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoodDisorder"}}}},"403":{"description":"Missing or invalid API key"},"429":{"description":"Rate limit or monthly quota exceeded"}}}},"/ingredients":{"get":{"operationId":"ingredients","summary":"Ingredients","description":"The ingredients that make up a food item, with each one's proportion and unit. Ingredients can contain nested sub-ingredients.","tags":["Ingredients"],"parameters":[{"name":"food_item_id","in":"query","required":true,"description":"Unique ID of the food item, as returned by /search.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Ingredient"}}}}},"403":{"description":"Missing or invalid API key"},"429":{"description":"Rate limit or monthly quota exceeded"}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"Ingredient":{"type":"object","properties":{"ingredient_id":{"type":"integer"},"ingredient_name":{"type":"string"},"food_id":{"type":"integer"},"proportion":{"type":"number"},"basic_unit_measure":{"type":"number"},"default_measure":{"type":"string"},"unit_name":{"type":"string"},"unit_option_id":{"type":"integer"},"unit_option_name":{"type":"string"},"ingredient_type":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"food_group":{"type":"string","nullable":true},"parent_group":{"type":"string","nullable":true},"food_category_id":{"type":"integer","nullable":true},"source_category_id":{"type":"integer","nullable":true},"sub_ingredients":{"type":"array","items":{"$ref":"#/components/schemas/Ingredient"}}}},"FoodDisorder":{"type":"object","properties":{"food_unique_id":{"type":"string"},"food_name":{"type":"string"},"common_names":{"type":"string"},"basic_unit_measure":{"type":"number"},"default_measure":{"type":"string"},"serving_size_unit":{"type":"string"},"unit_name":{"type":"string"},"unit_option_name":{"type":"string"},"positive_health":{"type":"string"},"negative_health":{"type":"string"},"allergens":{"type":"string"},"disorder_data":{"type":"array","items":{"type":"object","properties":{"disorder_id":{"type":"integer"},"disorder_name":{"type":"string"},"disorder_risk_factor":{"type":"number"},"disorder_risk_reason":{"type":"string"},"food_disorder_alts":{"type":"array","items":{"type":"object","properties":{"food_unique_id":{"type":"string"},"food_item_id":{"type":"integer"},"food_name":{"type":"string"},"priority":{"type":"integer"}}}}}}}}}}}}