> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vexelia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get analytics

<Warning>
  You must provide a security nonce to use this endpoint, you can obtain one
  using the [Get analytics
  nonce](/api-reference/endpoint/nodes/get-analytics-nonce) endpoint.
</Warning>

<Card title="WebSockets ahead!" icon="plug-circle-exclamation" horizontal>
  This endpoint is a WebSocket endpoint, you must use a WebSocket client to
  receive data from this endpoint.
</Card>

## Usage

This endpoint initiates a message upon successful connection, followed by updates every 5 seconds containing the requested analytical data. Below is an example of the analytical data transmitted over this connection.

```json theme={null}
[
  {
    "timestamp": "2024-10-28T14:30:00Z",
    "memory": 8192.0,
    "memoryUsage": 4096.0,
    "disk": 500000.0,
    "diskWriteUsage": 120.5,
    "diskReadUsage": 95.3,
    "cpu": 4,
    "cpuUsage": 1.75,
    "networkInbound": 102400.0,
    "networkOutbound": 76800.0
  }
]
```

### Response

<ResponseField name="timestamp" type="datetime" required>
  Timestamp of the received analytical data.
</ResponseField>

<ResponseField name="memory" type="decimal" required>
  The total memory of the node in megabytes.
</ResponseField>

<ResponseField name="memoryUsage" type="decimal" required>
  The used memory of the node in megabytes.
</ResponseField>

<ResponseField name="disk" type="decimal" required>
  The total disk size of the node in megabytes.
</ResponseField>

<ResponseField name="diskWriteUsage" type="decimal" required>
  The current disk write usage in megabytes.
</ResponseField>

<ResponseField name="diskReadUsage" type="decimal" required>
  The current disk read usage in megabytes.
</ResponseField>

<ResponseField name="cpu" type="int64" required>
  The amount of CPU cores the node has.
</ResponseField>

<ResponseField name="cpuUsage" type="decimal" required>
  The current overall CPU usage across all cores on the node, expressed as a
  percentage.
</ResponseField>

<ResponseField name="networkInbound" type="decimal" required>
  The amount of inbound network usage in bytes
</ResponseField>

<ResponseField name="networkOutbound" type="decimal" required>
  The amount of outbound network usage in bytes.
</ResponseField>


## OpenAPI

````yaml GET /nodes/analytics
openapi: 3.0.1
info:
  title: Vexelia API
  description: >-
    The base Vexelia API for interfacing with the Vexelia platform through a
    REST interface.
  termsOfService: https://vexelia.com/terms
  contact:
    name: Support
    url: https://help.vexelia.com
    email: support@vexelia.com
  version: v0.0.1
servers:
  - url: https://api.vexelia.com
    description: The production Vexelia API
security:
  - bearer: []
tags:
  - name: Backup
    description: Controller that handles backing up and restoring VMs
  - name: HostNode
    description: Controller that handles getting and updating host nodes
  - name: Network
    description: Controller that handles network management for the platform
  - name: Node
    description: Handles the management of VPS servers and dedicated servers (nodes)
  - name: Payment
    description: Handles all payment-related systems and webhooks
  - name: Plan
    description: Controller that handles managing pricing plans
  - name: Template
    description: Manages templates for Proxmox
  - name: User
    description: >-
      Handles all user-related functions such as creating and authenticating
      users
  - name: Vnc
    description: Handles proxying VNC websockets to client safely
paths:
  /nodes/analytics:
    get:
      tags:
        - Node
      summary: Gets analytics for a node
      parameters:
        - name: nonce
          in: query
          description: The security nonce to use
          schema:
            type: string
      responses:
        '200':
          description: OK
components:
  securitySchemes:
    bearer:
      type: http
      description: Your API key goes here, you can generate one in your account settings.
      scheme: bearer
      bearerFormat: JWT

````