AnalyticsRetrieve machine data for a single day

Retrieve machine data for a single day

Retrieves comprehensive machine analytics for a single calendar day (with adjustments for shift boundaries). It aggregates shift data, real-time status info, live and planned orders, and optional timeseries data for features or legacy pulse. It supports processing either synchronously or asynchronously.

When async is true, the response returns an actor_name and message_id immediately. You must then use the POST /v2/analytics/ endpoint with the actor_name and message_id to retrieve the result.

curl -X POST "https://wm.novoai.de/v2/analytics/day?async=false&csv_format=false" \
  -H "Content-Type: application/json" \
  -H "accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -d '{
  "machine_list": [
    1
  ],
  "date": "2025-02-24",
  "features": true,
  "timeline": true,
  "live_orders": true,
  "window_period": "5m"
}'
{
  "machine_dict": {
    "1": {
      "id": 1,
      "name": "Machine A",
      "hall": {
        "id": 1,
        "name": "Hall 1"
      },
      "shift_group": {
        "id": 2,
        "name": "Group A"
      },
      "ratings": 4.5,
      "state": 1,
      "last_heartbeat": "2025-02-24 15:29:55",
      "live_timeline_reason": {
        "idx": 12345,
        "is_set": false,
        "created_at": "2025-02-24 15:00:00",
        "can_set": true
      },
      "day_data": {
        "availability": 0.85,
        "performance": 0.9,
        "quality": 0.99,
        "oee": 0.757,
        "production_duration": 25000,
        "idle_duration": 2000,
        "off_duration": 0,
        "timeline_reason": {
          "columns": [
            "timeline_reason_id",
            "timeline_reason_name",
            "duration_sec",
            "idx",
            "total_sec",
            "color"
          ],
          "data": [
            [
              1,
              "Setup",
              1200,
              1,
              1200,
              "#CCCCCC"
            ]
          ]
        }
      },
      "shift_data": {
        "Shift 1": {
          "shift_start": "2025-02-24T06:00:00",
          "shift_end": "2025-02-24T14:00:00",
          "availability": 0.88
        }
      },
      "tag_list": [
        {
          "id": 11,
          "name": "Tag1"
        }
      ],
      "timeline": {
        "columns": [
          "idx",
          "start",
          "end",
          "state",
          "timeline_reason_id",
          "start_timestamp",
          "end_timestamp"
        ],
        "data": [
          [
            101,
            "2025-02-24 06:00:00",
            "2025-02-24 07:00:00",
            2,
            null,
            1740376800,
            1740380400
          ]
        ]
      },
      "features": [
        {
          "id": 10,
          "name": "Speed",
          "unit": "rpm",
          "multiplication_factor": 1,
          "field_name": "rpm"
        }
      ],
      "timeseries_features": {
        "Speed": {
          "columns": [
            "_time",
            "value"
          ],
          "data": [
            [
              1740376800,
              1200
            ],
            [
              1740376860,
              1205
            ]
          ]
        }
      },
      "live_orders": [
        {
          "order_id": 505,
          "order_name": "Order-ABC",
          "assignment_id": 99,
          "status": "active",
          "product": {
            "id": 10,
            "name": "Widget X"
          }
        }
      ],
      "interval_list": [
        {
          "id": 800,
          "start": "2025-02-24 08:00:00",
          "end": "2025-02-24 09:00:00",
          "produced_qty": 500,
          "product": {
            "id": 10,
            "name": "Widget X"
          }
        }
      ],
      "range_analysis": [
        {
          "range_label": {
            "lower": 300,
            "upper": 600
          },
          "instance_count": 5,
          "total_seconds": 2000
        }
      ]
    }
  },
  "status": 1,
  "response_time": 0.452
}
POST
/v2/analytics/day
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token (JWT)
Bearer Tokenstring
Required

JWT Bearer token authentication. Include in the Authorization header as Bearer <token>.

JWT Bearer token authentication. Include in the Authorization header as Bearer <token>.
API Key (header: X-API-KEY)
X-API-KEYstring
Required

API-Access Key authentication. Include the generated key in the X-API-KEY header.

API-Access Key authentication. Include the generated key in the X-API-KEY header.
query
asyncboolean

Default false. If true, returns an actor_name and message_id immediately instead of waiting for the full result. Use the POST /v2/analytics/ endpoint to retrieve the result afterward.

query
csv_formatboolean

Default false. If true, returns CSV formatted data inside the JSON result (if the actor supports it).

Content-Typestring
Required

The media type of the request body

Options: application/json
header
acceptstring
Required

Must be application/json.

header
Content-Typestring
Required

Must be application/json for POST requests.

machine_listarray

IDs of machines. If empty or missing, fetches all accessible machines.

datestring

Target date (YYYY-MM-DD). Defaults to today if not provided.

Format: date
energy_databoolean

Include energy_consumption and energy_wastage in calculations.

anomaliesboolean

Include anomaly detection data.

cyclesboolean

Include cycle lists (cycles).

timelineboolean

Include status timeline segments (timeline).

timeline_reasonboolean

Include reason codes/durations nested within day/shift data properties.

pulseboolean

Include legacy pulse timeseries (pulse).

featuresboolean

Include generic machine feature timeseries (features and timeseries_features).

window_periodstring

Aggregation bucket size for pulse (e.g., 1m, 5s).

externboolean

Include external data timeseries (extern).

range_analysisboolean

Include uptime range distribution analysis (range_analysis).

live_ordersboolean

Include lists of currently running (live_orders) and planned (planned_orders) orders.

interval_listboolean

Include detailed production intervals (interval_list).

timeline_windowstring

Overrides the lookback window for the timeline request (e.g., 3h for last 3 hours).

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token (JWT). JWT Bearer token authentication. Include in the Authorization header as Bearer \<token\>.

header
X-API-KEYstring
Required

API Key for authentication. API-Access Key authentication. Include the generated key in the X-API-KEY header.

Query Parameters

asyncboolean

Default false. If true, returns an actor_name and message_id immediately instead of waiting for the full result. Use the POST /v2/analytics/ endpoint to retrieve the result afterward.

Example:
false
csv_formatboolean

Default false. If true, returns CSV formatted data inside the JSON result (if the actor supports it).

Example:
false

Headers

acceptstring
Required

Must be application/json.

Example:
application/json
Content-Typestring
Required

Must be application/json for POST requests.

Example:
application/json

Body

application/json
machine_listarray

IDs of machines. If empty or missing, fetches all accessible machines.

Example:
[1,2]
datestring

Target date (YYYY-MM-DD). Defaults to today if not provided.

Example:
2025-02-24
energy_databoolean

Include energy_consumption and energy_wastage in calculations.

anomaliesboolean

Include anomaly detection data.

cyclesboolean

Include cycle lists (cycles).

timelineboolean

Include status timeline segments (timeline).

timeline_reasonboolean

Include reason codes/durations nested within day/shift data properties.

pulseboolean

Include legacy pulse timeseries (pulse).

featuresboolean

Include generic machine feature timeseries (features and timeseries_features).

window_periodstring

Aggregation bucket size for pulse (e.g., 1m, 5s).

Example:
1m
externboolean

Include external data timeseries (extern).

range_analysisboolean

Include uptime range distribution analysis (range_analysis).

live_ordersboolean

Include lists of currently running (live_orders) and planned (planned_orders) orders.

interval_listboolean

Include detailed production intervals (interval_list).

timeline_windowstring

Overrides the lookback window for the timeline request (e.g., 3h for last 3 hours).

Example:
3h

Responses

machine_dictobject
Required

Machine analytics data keyed by machine ID (as string).

statusinteger
Required

Indicates the success of the request. 1 for success, 0 for failure.

messagestring

Optional message (present in logical error responses, e.g., no access or no machines found).

response_timenumber
Required

Response time in seconds.