An APIÂ token is required. Set it as an environment variable before running the examples:
Get aggregated consumption
Returns the selected metric aggregated across all matching clients into a single daily total for the reporting period.
The API returns:
The amount field reports the accrued value of the selected metric for that date.
Get consumption per client
Returns the selected metric as one entry per client instead of a single aggregated total. from, to, and client_ids filter the report as they do for the aggregated total. limit, offset, and count count clients. limit accepts 1 to 100 and defaults to 100, and offset defaults to 0.
The API returns:
Each object in results is one client. items holds that client’s date and amount pairs, all on the same page.