Levain LabsLevain Labs
ApiMetrics

Metrics Data

Compute metric values over a time window.

Compute metric values over a time window.

keys is a comma-separated list of metric keys (see GET /api/v1/metrics); when omitted, every metric of the connected apps is computed. Each metric returns the value for the window, the value for the same-length window immediately before it, and a bucketed series for plotting. The window is capped at 366 days.

GET
/api/v1/metrics/data

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

keys?string|null
granularity?Granularity
Default"day"
Value in"day" | "week" | "month"
start?|null
end?|null

Header Parameters

X-API-Key?string|null

Response Body

application/json

application/json

curl -X GET "https://api.levainlabs.com/api/v1/metrics/data"
{
  "start": "2019-08-24T14:15:22Z",
  "end": "2019-08-24T14:15:22Z",
  "granularity": "day",
  "metrics": [
    {
      "key": "string",
      "name": "string",
      "format": "currency",
      "currency": "string",
      "current": 0,
      "previous": 0,
      "series": [
        {
          "bucket": "2019-08-24",
          "value": 0
        }
      ]
    }
  ]
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}