These tutorials explain how to get your usage from the Usage API. You can obtain your usage by filtering for your organizations, app ID, project HRN, billing tag, feature ID, time range, and detail level. When filters are added, the response includes elements which match the filter criteria.
When billable usage is calculated at the hour level, the greatest level of detail is an hour, and the maximum time range that can be queried is 95 days.
API response records are sorted alphabetically in ascending order by subscription ID, category (service name), and charge item (subcategory of service).
Send a request to the Usage API to get your usage. You then receive a response containing your usage information, from the Usage API. Usage changes can take up to two hours for Location Services and up to 48 hours for billable services usage to enact.
For more details, see the Usage API Reference.
The term "realm" means "organization". For more information, see Manage your organization.
The Usage API requires a realmId for each query, which is the ID for your organization.
To access the Usage API, you must create an app and credentials. See OAuth token documentation for additional details.
You can filter your usage using a time range, which specifies start dates, end dates, and hourly times.
startDate (yyyy-MM-dd'T'HH:mm:ss) endDate (yyyy-MM-dd'T'HH:mm:ss) startDate (yyyy-MM-dd'T'HH:mm:ss), for example, 2021-07-01T10:39:51 endDate (yyyy-MM-dd'T'HH:mm:ss), for example, 2021-08-30T10:39:51
In coordination with the time range, you can use the
detailLevel parameter to select one of the levels of detail to view in your usage records. Levels of detail include: summarized, hour, day, or month. The summarized detail level shows you a summary of your usage and is the default. The
usageDateTime field value is not present if
detailLevel is set to summarized.
More information can be found in the Usage API Reference.