Get Daily Country Aggregates
This method retrieves daily aggregate Web API log metrics grouped by country. It returns
Daily Country Aggregate objects.
Parameters
This method is accessed by https://api.cryptolens.io/api/ai/GetDailyCountryAggregates
| Parameter |
Description |
Remarks |
| Limit |
Specifies how many aggregate records should be returned. |
default is 100 and at most 1000 |
| StartingAfter |
Works as a forward cursor. If the last result had id=125, setting this to 125 returns results after 125. |
optional. Results are ordered by Id ascending. |
| EndingBefore |
Works as a backward cursor. If the first result had id=125, setting this to 125 returns results before 125. |
optional. Results are ordered by Id descending. If both cursors are supplied, EndingBefore is used. |
| ProductId |
The product id to filter on. |
optional |
| CountryCode |
The country code to filter on. |
optional, two-letter ISO country code such as US or SE |
| Start |
Only return aggregate records on or after this date. |
optional, format yyyy-MM-dd |
| End |
Only return aggregate records on or before this date. |
optional, format yyyy-MM-dd |
| token |
An access token with Usage Analytics permission. |
required |
| v |
Method version. |
optional. by default, it's 1. |
Results
| Parameter |
Description |
Remarks |
| Aggregates |
A list of Daily Country Aggregate objects. |
returned if no errors are thrown |
| Result |
This is either 0(=success) or 1(=error). |
always returned |
| Message |
The message that provides additional information about the result. |
always returned. |
Example results
{"aggregates":[{"id":44,"productId":3349,"date":"2026-05-25","countryCode":"US","totalRequests":42,"successful":40,"failed":2}],"result":0,"message":null}
Remarks
- Usage analytics are updated asynchronously, so very recent activity may not appear immediately.
- Daily country aggregates exclude license keys configured to be excluded from usage analytics. See the KPI dashboard guide for details about excluding test licenses.
- Country is resolved from request IP addresses. Activity without a resolvable country is not included in this result.
- The CountryCode filter is normalized to uppercase.
- The Start and End filters are inclusive.
Errors
| Error |
| Access denied. |
| The input parameters were incorrect. |
| Could not find the product. |
| The 'CountryCode' parameter has the wrong format. |
| The 'Start' parameter has the wrong format. |
| The 'End' parameter has the wrong format. |