The Usage API is a free REST API that provides programmatic access and visibility into activity consumption across products for your enterprise account.
Enterprise
It is the most important and best tool for helping to monitor and manage usage across the different APIs under your account.
Important Disclaimer:
The usage counts returned from the Usage API may not match those on a billing invoice due to trials and other billing adjustments. All numbers are based on deduped activities consumed within a given day (in UTC).
enterprise
enterprise
enterprise
enterprise
Method | Description |
---|---|
GET /metrics/usage/accounts/.json | Retrieve usage data |
bucket | Optional. The unit of time for which usage data will be provided. Usage data can be returned with daily or monthly granularity. Requests made without a specified bucket will return monthly granularity. Options: ‘month’ or ‘day’ |
fromDate (YYYYMMDDHHMM) | Optional. Usage data is only available starting from May 1, 2018. The oldest UTC timestamp from which the usage data will be provided. Timestamp is in day granularity and is inclusive (i.e., 201805010000 includes the 0501 day). Requests that contain values other than ‘0000’ for hour and minute granularity will be defaulted to ‘0000’. Requests made without a fromDate or toDate will return usage data by month for the current month and include a historical reference for the past two months. Please note: Starting June 1, 2019, you can access the past 13 calendar months of usage data. For example, if it was the 10th of October, you can access usage data back to September 1st of the previous year. Example: 201810010000 will return data starting October 1st, 2018 onward, including October 1st. |
toDate (YYYYMMDDHHMM) | Optional. The latest UTC timestamp to which the usage data will be provided. Timestamp is in day granularity and is not inclusive (i.e., 201703020000 does not include data for the 0302 day). When a toDate is specified for either the current day or a day in the future, usage data will be returned up to the last full day (UTC). Requests that contain values other than ‘0000’ for hour and minute granularity will be defaulted to ‘0000’. A request with no toDate, will default to the next bucket (tomorrow for bucket=day and next month for bucket=month). A request made with no fromDate and toDate will default to bucket=month, and show data for the current month plus the two immediately previous months. Example: 201703050000 will return data to March 5, 2017, not including any data from March 5th. |
account | An object representing the account for which usage data was requested. |
bucket | The unit of time for which usage data is provided. Can be either ‘day’ or ‘month’. |
fromDate | The earliest UTC timestamp for which you want to pull usage data (inclusive). |
toDate | The latest UTC timestamp for which you want to pull usage data (exclusive). |
publishers | Includes three primary objects: Used, projected, and products. |