---
title: Calculate average metric values (summarize)
source: https://docs.newrelic.com/docs/apis/rest-api-v2/basic-functions/calculate-average-metric-values-summarize
---

> #### ⚠️ IMPORTANT
>
> While the example utilizes New Relic's REST API v2, we recommend using [NRQL functions](https://docs.newrelic.com/docs/nrql/get-started/introduction-nrql-new-relics-query-language/) for executing metric timeslice queries. Each API value can be mapped to an equivalent NRQL function. To learn how to create NRQL queries based on these API examples, refer to our [documentation](https://docs.newrelic.com/docs/apis/rest-api-v2/migrate-to-nrql/).

By default, New Relic REST API calls return a series of metric data values based on [time range restrictions](https://docs.newrelic.com/docs/apm/apis/requirements/extracting-metric-data#time). To obtain the average of these values, include `&summarize=true` in your API call. For example:

```sh
curl -X GET "https://api.newrelic.com/v2/applications/${APP_ID}/metrics/data.json" \
     -H "Api-Key:$API_KEY" -i \
     -d 'names[]=Agent/MetricsReported/count&from=2014-08-11T14:42:00%2B08:00&to=2014-08-11T15:12:00%2B08:00&summarize=true'
```

If you have an [EU region account](https://docs.newrelic.com/docs/using-new-relic/welcome-new-relic/getting-started/introduction-eu-region-data-center), the above URL begins with `https://api.eu.newrelic.com`.

> #### 💡 TIP
>
> To prevent summarizing data, omit `summarize` in your API call. You do not need to specify `&summarize=false`.
