---
updatedAt: 2025-07-02T09:41:33.000Z
agentTools:
  projectIndex: https://docs.vitro.io/llms.txt
---

# List metric measures

Returns all measures of a single metric from a battery over a period of time.

This endpoint receives a metric and some time ranges and grouping, and returns a list of aggregated data points. This allows for the creation of charts, as well as obtaining the historical data for analytical purposes.

<Image align="center" border={false} caption="6 months of data for the core temperature of a single battery" src="https://files.readme.io/9f0c5470f0080e3d667de8ff0aa812b6cc6905a24024bf2efc498739c0bb8aea-image.png" />

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Astra HTTP API",
    "description": "API Specification for the ASTRA backend, which will expose datacenters and battery information for the UI application to construct dashboards. ",
    "contact": {
      "email": "rafal@kult.io"
    },
    "version": "1.0-BETA"
  },
  "servers": [
    {
      "url": "https://api.dev.vitro.link/api/",
      "description": "Development"
    }
  ],
  "tags": [
    {
      "name": "Standard"
    }
  ],
  "paths": {
    "/metrics": {
      "get": {
        "summary": "List metric measures",
        "description": "Returns all measures of a single metric from a battery over a period of time.",
        "operationId": "getMetrics",
        "tags": [
          "Standard"
        ],
        "parameters": [
          {
            "name": "batteryId",
            "in": "query",
            "description": "ID of battery to return",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "metric",
            "in": "query",
            "description": "Battery metric to return",
            "required": true,
            "schema": {
              "enum": [
                "TEMP_CORE",
                "TEMP_POLE_DIFF",
                "RESISTANCE",
                "VOLTAGE",
                "CHARGE"
              ]
            }
          },
          {
            "name": "fromDate",
            "in": "query",
            "description": "Start date time of the history (format ISO 8601)",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "description": "Last date time of the history (format ISO 8601). Defaults to today.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "lastDays",
            "in": "query",
            "description": "Number of past days to return, only used if fromDate and toDate are not provided",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "binning",
            "in": "query",
            "description": "Binning of the data. It affects how the data will be grouped when returned. Defaults to DAY.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "DAY",
                "HOUR",
                "MINUTE"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetricsHistory"
                }
              }
            }
          },
          "400": {
            "description": "Invalid ID supplied"
          },
          "404": {
            "description": "Battery not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MetricsHistory": {
        "type": "object",
        "properties": {
          "metric": {
            "enum": [
              "TEMP_CORE",
              "TEMP_POLE_DIFF",
              "VOLTAGE",
              "RESISTANCE",
              "CHARGE"
            ]
          },
          "values": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "metric_name": {
                  "type": "string",
                  "example": "TEMP_CORE"
                },
                "metric_value": {
                  "type": "number",
                  "format": "float",
                  "example": 60.5
                },
                "timestamp": {
                  "type": "string",
                  "example": "2023-01-01 00:00:00",
                  "format": "date-time"
                },
                "datetime": {
                  "type": "string",
                  "example": "2013-03-01T13:05:16",
                  "format": "date-time"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ]
}
```