> ## Documentation Index
> Fetch the complete documentation index at: https://help.cryptolens.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Daily Country Aggregates

> This method retrieves daily aggregate Web API log metrics grouped by country. It returns Daily Country Aggregate objects.

This method retrieves daily aggregate Web API log metrics grouped by country. It returns
[Daily Country Aggregate](/api-reference/generated/model/DailyCountryAggregate) objects.

### Parameters

This method is accessed by [https://api.cryptolens.io/api/ai/GetDailyCountryAggregates](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](/api-reference/generated/model/DailyCountryAggregate) 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

```text theme={null}
{"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](https://help.cryptolens.io/feature/web-ui/kpi-dashboards#excluding-licenses-that-are-used-for-testing-purposes) 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. |
