GET /foods/search

Search foods by name.

Query parameters

  • Name
    q
    Type
    string
    Description

    Search query.

Example request

curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.macrofy.com/foods/search?q=banana"

Example response

[
  {
    "id": "food_123",
    "name": "Banana",
    "brand": null,
    "serving": { "amount": 118, "unit": "g" },
    "macros": { "calories": 105, "protein": 1.3, "carbs": 27, "fat": 0.4 }
  }
]

Was this page helpful?