Wger Nutritiondiary API

The nutritiondiary API from Wger — 3 operation(s) for nutritiondiary.

Operations 7

GET /api/v2/nutritiondiary/ #
POST /api/v2/nutritiondiary/ #
GET /api/v2/nutritiondiary/{id}/ #
PUT /api/v2/nutritiondiary/{id}/ #
PATCH /api/v2/nutritiondiary/{id}/ #
DELETE /api/v2/nutritiondiary/{id}/ #
GET /api/v2/nutritiondiary/{id}/nutritional_values/ #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/wger-nutritiondiary-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

wger-nutritiondiary-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: wger Nutritiondiary API
  version: 2.7.0a2
  description: "Self hosted FLOSS workout and fitness tracker.\n\n## Authentication\n\nSystem-wide data such as the exercise database, ingredients and units can be\nread without authenticating. Everything tied to a user account needs one of the\nfollowing, which are tried in this order:\n\n* `Authorization: Token <key>` with a personal API key. Users create one on the\n  API key page of their profile, e.g. `/en/user/api-key`.\n* `Authorization: Bearer <token>` with a JWT access token.\n* The session cookie, which is what a logged-in browser uses.\n\n## Pagination\n\nList endpoints take `limit` and `offset`, and answer with `count`, `next`,\n`previous` and `results`. The default page size is 20 and `limit` is capped\nat 999.\n\n`/api/v2/ingredient-sync/` is the exception. It uses cursor pagination so that\nsyncing the catalogue stays fast no matter how far a client has paginated. That\nresponse carries no `count`, and clients follow `next` instead of picking an\noffset.\n\n## Filtering and ordering\n\nMost list endpoints accept filters on a subset of their fields, plus `ordering`\nwith a field name that can be prefixed with `-` to reverse it. Both are listed\nper endpoint.\n\n## Unknown fields are dropped on write\n\nA field that the endpoint does not declare is ignored instead of rejected. Such\na request still answers 200 or 201, and the unknown field simply has no effect,\nso check a write against the response body rather than the status code.\n\n## Rate limits\n\nThe ingredient endpoints are rate limited because the catalogue holds millions\nof rows, and creating exercises is capped as well. Limits count per user for\nauthenticated callers and per IP otherwise. Exceeding one answers 429.\n"
  license:
    name: AGPL-3.0-or-later
    url: https://www.gnu.org/licenses/agpl-3.0.html
servers:
- url: /
  description: This server
- url: https://wger.de
  description: The "official" upstream wger instance
tags:
- name: nutritiondiary
paths:
  /api/v2/nutritiondiary/:
    get:
      operationId: nutritiondiary_list
      description: API endpoint for a meal log item
      parameters:
      - in: query
        name: amount
        schema:
          type: number
      - in: query
        name: datetime
        schema:
          type: string
          format: date-time
      - in: query
        name: datetime__date
        schema:
          type: string
          format: date
      - in: query
        name: datetime__gt
        schema:
          type: string
          format: date-time
      - in: query
        name: datetime__gte
        schema:
          type: string
          format: date-time
      - in: query
        name: datetime__lt
        schema:
          type: string
          format: date-time
      - in: query
        name: datetime__lte
        schema:
          type: string
          format: date-time
      - in: query
        name: ingredient
        schema:
          type: integer
      - name: limit
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - name: offset
        required: false
        in: query
        description: The initial index from which to return the results.
        schema:
          type: integer
      - name: ordering
        required: false
        in: query
        description: Which field to use when ordering the results.
        schema:
          type: string
      - in: query
        name: plan
        schema:
          type: string
          format: uuid
      - in: query
        name: weight_unit
        schema:
          type: integer
      tags:
      - nutritiondiary
      security:
      - cookieAuth: []
      - tokenAuth: []
      - headlessJwtAuth: []
      - oidcAuth: []
      - jwtAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedLogItemList'
          description: ''
    post:
      operationId: nutritiondiary_create
      description: API endpoint for a meal log item
      tags:
      - nutritiondiary
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LogItemRequest'
        required: true
      security:
      - cookieAuth: []
      - tokenAuth: []
      - headlessJwtAuth: []
      - oidcAuth: []
      - jwtAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogItem'
          description: ''
  /api/v2/nutritiondiary/{id}/:
    get:
      operationId: nutritiondiary_retrieve
      description: API endpoint for a meal log item
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this log item.
        required: true
      tags:
      - nutritiondiary
      security:
      - cookieAuth: []
      - tokenAuth: []
      - headlessJwtAuth: []
      - oidcAuth: []
      - jwtAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogItem'
          description: ''
    put:
      operationId: nutritiondiary_update
      description: API endpoint for a meal log item
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this log item.
        required: true
      tags:
      - nutritiondiary
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LogItemRequest'
        required: true
      security:
      - cookieAuth: []
      - tokenAuth: []
      - headlessJwtAuth: []
      - oidcAuth: []
      - jwtAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogItem'
          description: ''
    patch:
      operationId: nutritiondiary_partial_update
      description: API endpoint for a meal log item
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this log item.
        required: true
      tags:
      - nutritiondiary
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedLogItemRequest'
      security:
      - cookieAuth: []
      - tokenAuth: []
      - headlessJwtAuth: []
      - oidcAuth: []
      - jwtAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogItem'
          description: ''
    delete:
      operationId: nutritiondiary_destroy
      description: API endpoint for a meal log item
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this log item.
        required: true
      tags:
      - nutritiondiary
      security:
      - cookieAuth: []
      - tokenAuth: []
      - headlessJwtAuth: []
      - oidcAuth: []
      - jwtAuth: []
      responses:
        '204':
          description: No response body
  /api/v2/nutritiondiary/{id}/nutritional_values/:
    get:
      operationId: nutritiondiary_nutritional_values_retrieve
      description: Return an overview of the nutritional plan's values
      parameters:
      - in: path
        name: id
        schema:
          type: string
          format: uuid
        description: A UUID string identifying this log item.
        required: true
      tags:
      - nutritiondiary
      security:
      - cookieAuth: []
      - tokenAuth: []
      - headlessJwtAuth: []
      - oidcAuth: []
      - jwtAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NutritionalValues'
          description: ''
components:
  schemas:
    LogItemRequest:
      type: object
      description: LogItem serializer
      properties:
        id:
          type: string
          format: uuid
        plan:
          type: string
          format: uuid
          title: Nutrition plan
        meal:
          type:
          - string
          - 'null'
          format: uuid
        ingredient:
          type: integer
        weight_unit:
          type:
          - integer
          - 'null'
        datetime:
          type: string
          format: date-time
          title: Date and Time (Approx.)
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,4}(?:\.\d{0,2})?$
      required:
      - amount
      - ingredient
      - plan
    PaginatedLogItemList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type:
          - string
          - 'null'
          format: uri
          example: http://api.example.org/accounts/?offset=400&limit=100
        previous:
          type:
          - string
          - 'null'
          format: uri
          example: http://api.example.org/accounts/?offset=200&limit=100
        results:
          type: array
          items:
            $ref: '#/components/schemas/LogItem'
    NutritionalValues:
      type: object
      description: Nutritional values serializer
      properties:
        energy:
          type: number
          format: double
        protein:
          type: number
          format: double
        carbohydrates:
          type: number
          format: double
        carbohydrates_sugar:
          type:
          - number
          - 'null'
          format: double
        fat:
          type: number
          format: double
        fat_saturated:
          type:
          - number
          - 'null'
          format: double
        fiber:
          type:
          - number
          - 'null'
          format: double
        sodium:
          type:
          - number
          - 'null'
          format: double
      required:
      - carbohydrates
      - carbohydrates_sugar
      - energy
      - fat
      - fat_saturated
      - fiber
      - protein
      - sodium
    LogItem:
      type: object
      description: LogItem serializer
      properties:
        id:
          type: string
          format: uuid
        plan:
          type: string
          format: uuid
          title: Nutrition plan
        meal:
          type:
          - string
          - 'null'
          format: uuid
        ingredient:
          type: integer
        weight_unit:
          type:
          - integer
          - 'null'
        datetime:
          type: string
          format: date-time
          title: Date and Time (Approx.)
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,4}(?:\.\d{0,2})?$
      required:
      - amount
      - ingredient
      - plan
    PatchedLogItemRequest:
      type: object
      description: LogItem serializer
      properties:
        id:
          type: string
          format: uuid
        plan:
          type: string
          format: uuid
          title: Nutrition plan
        meal:
          type:
          - string
          - 'null'
          format: uuid
        ingredient:
          type: integer
        weight_unit:
          type:
          - integer
          - 'null'
        datetime:
          type: string
          format: date-time
          title: Date and Time (Approx.)
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,4}(?:\.\d{0,2})?$
  securitySchemes:
    cookieAuth:
      type: apiKey
      in: cookie
      name: sessionid
    headlessJwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token issued by the allauth headless endpoints
    jwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    oidcAuth:
      type: oauth2
      description: Access token issued by the OAuth2/OIDC provider
      flows:
        authorizationCode:
          authorizationUrl: https://wger.de/identity/o/authorize
          tokenUrl: https://wger.de/identity/o/api/token
          scopes:
            api:read: View your training, nutrition and body data
            api:write: Add and change your training, nutrition and body data
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"
externalDocs:
  url: https://wger.readthedocs.io
  description: wger documentation