Querying

Monthly usage for one metric

get/v2/metrics/{metric_id}/usage/monthly

Path parameters

metric_idstring required
Example:usd

LedgerUp metric identifier or three-letter currency code.

Query parameters

aggregation'sum' | 'min' | 'max' | 'avg' | 'latest' | 'count'

Aggregation applied to corrected usage events. latest returns the quantity from the event with the latest occurred_at; ties use accepted_at then event ID. count returns the number of events.

Example:sum

Response

Metric or currency usage grouped by UTC calendar month.

aggregation'sum' | 'min' | 'max' | 'avg' | 'latest' | 'count' required

Aggregation applied to corrected usage events. latest returns the quantity from the event with the latest occurred_at; ties use accepted_at then event ID. count returns the number of events.

Example response

{
  "aggregation": "sum",
  "data": [
    {
      "period_start_at": 1767225600,
      "data": [
        {
          "metric_id": "metric_0194f4e3a2b77c6aa91c4f6b4db2a980",
          "currency": "usd",
          "quantity": "1250.5"
        }
      ]
    }
  ]
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.