Simple Foods API (v1)

A REST API for retrieving information about food products with three ingredients or fewer.

Status: Early development


Getting Started

Base URL: https://simple-food-api.tonysancez.dev/api/v1

Example request:

GET /foods

Typical usage:


Typical Responses

GET /foods

{
  "data": [
    {
      "id": 1,
      "name": "Plain Yogurt",
      "brand": "Chobani",
      "ingredients": ["Milk", "Cultures"]
    }
  ],
  "page": 1,
  "total": 1
}

GET /foods/:id

{
  "id": 1,
  "name": "Plain Yogurt",
  "brand": "Chobani",
  "ingredients": ["Milk", "Cultures"]
}

Error Handling

The API returns standard HTTP status codes:

Example error response:

{
  "error": "Food not found"
}

Health Check Monitor

Check the server health programmatically via the endpoint or view a visual dashboard.

Health Endpoint: GET /health
{
  "uptime": "13 minutes, 31 seconds",
  "message": "OK",
  "timestamp": "Monday, October 13th, 2025 at 6:34:14 AM"
}
Public Dashboard: View Health Monitor

Displays uptime, status message, and timestamp in a simple dashboard.


Pagination Example

For examples of pagination implementation, you can view the static page: Pagination Example Page

This page demonstrates how paginated results are handled and displayed in the UI.