API Documentation

The Diet Mate API allows you to retrieve meals recorded in the app and integrate them into your own tools (website, app, back office).
All requests are made over HTTPS and responses are returned in JSON format.
To get started, generate an API key in the application and include it in the Authorization header of each request.

Get an API key

Generate an API key from the Diet Mate app (Resources > Export (API, CSV)), then copy it and keep it in a secure place.

Authentication

The API uses API key–based authentication.
Include your API key in the Authorization header of every request.

Authorization: Bearer YOUR_API_KEY

Example (cURL)

curl -X GET "https://api.dietmate.app/v1/meals" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Replace YOUR_API_KEY with your own key. Never expose it on the client side (browser).

Errors

In case of an error, the API returns a standard HTTP status code along with a JSON response containing an error message.

{
  "error": {
    "message": "Invalid API key."
  }
}

Rate limits

Limits per API key: 1,000 requests per day and a minimum interval of 3 seconds between requests.
If the limit is exceeded, the API returns a 429 Too Many Requests error.

GET /v1/meals

Returns meals that have been modified since a given date (incremental sync).
The lastModifiedSince parameter is required.

Query parameters

  • lastModifiedSince (required) — Date ISO (ex: 2025-01-01T00:00:00Z)
  • limit (optional)Maximum number of meals (max 5000)

Example (cURL)

curl -X GET "https://api.dietmate.app/v1/meals?lastModifiedSince=2025-01-01T00:00:00Z&limit=100" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"

Response (200)

{
  "ok": true,
  "userId": "USER_ID",
  "lastModifiedSince": "2025-01-01T00:00:00.000Z",
  "count": 1,
  "meals": [
    {
      "id": "meal_123",
      "description": "Déjeuner au resto",
      "title": "Salade + poulet",
      "type": "lunch",
      "date": "2025-01-03T12:30:00.000Z",
      "caloriesTotal": 650.5,
      "proteins_g": 42.1,
      "fats_g": 18.0,
      "carbs_g": 70.2,
      "fibers_g": 9.4,
      "sodium_mg": 820.0,
      "iron_mg": 3.2,
      "calcium_mg": 120.0
    }
  ]
}