---
title: "Retrieve metric data"
method: POST
path: "/apps/{appId}/metrics"
---

# Retrieve metric data

`POST /apps/{appId}/metrics`

Gets metric values for multiple metrics

## Path parameters

- `appId` string, required

## Request body

- MetricsPostBodySchema[] — Metrics request body
  - `id` string, required — An identifier for this query. Must be unique within the post body of the request. This identifier will be the 'id' property of the response object representing this query.
  - `parameters` object, required — The parameters for a single metrics query
    - `metricId` 'requests/count' | 'requests/duration' | 'requests/failed' | 'users/count' | 'users/authenticated' | 'pageViews/count' | 'pageViews/duration' | 'client/processingDuration' | 'client/receiveDuration' | 'client/networkDuration' | 'client/sendDuration' | 'client/totalDuration' | 'dependencies/count' | 'dependencies/failed' | 'dependencies/duration' | 'exceptions/count' | 'exceptions/browser' | 'exceptions/server' | 'sessions/count' | 'performanceCounters/requestExecutionTime' | 'performanceCounters/requestsPerSecond' | 'performanceCounters/requestsInQueue' | 'performanceCounters/memoryAvailableBytes' | 'performanceCounters/exceptionsPerSecond' | 'performanceCounters/processCpuPercentage' | 'performanceCounters/processIOBytesPerSecond' | 'performanceCounters/processPrivateBytes' | 'performanceCounters/processorCpuPercentage' | 'availabilityResults/availabilityPercentage' | 'availabilityResults/duration' | 'billing/telemetryCount' | 'customEvents/count', required — ID of the metric. This is either a standard AI metric, or an application-specific custom metric.
    - `timespan` string — The timespan over which to retrieve metric values. This is an ISO8601 time period value. If timespan is omitted, a default time range of `PT12H` ("last 12 hours") is used. The actual timespan that is queried may be adjusted by the server based. In all cases, the actual time span used for the query is included in the response.
    - `aggregation` string[] — The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used.
    - `interval` string, duration — The time interval to use when retrieving metric values. This is an ISO8601 duration. If interval is omitted, the metric value is aggregated across the entire timespan. If interval is supplied, the server may adjust the interval to a more appropriate size based on the timespan used for the query. In all cases, the actual interval used for the query is included in the response.
    - `segment` string[] — The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter.
    - `top` integer — The number of segments to return. This value is only valid when segment is specified.
    - `orderby` string — The aggregation function and direction to sort the segments by. This value is only valid when segment is specified.
    - `filter` string — An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving.

## Response `200`

Successful response

- object[] — A set of metric results.
  - `id` string, required — The specified ID for this metric.
  - `status` integer, required — The HTTP status code of this metric query.
  - `body` MetricsResult, required — A metric result.
    - `value` MetricsResultInfo — A metric result data.
      - `start` string, date_time — Start time of the metric.
      - `end` string, date_time — Start time of the metric.
      - `interval` string, duration — The interval used to segment the metric data.
      - `segments` MetricsSegmentInfo[] — Segmented metric data (if segmented).
        - `start` string, date_time — Start time of the metric segment (only when an interval was specified).
        - `end` string, date_time — Start time of the metric segment (only when an interval was specified).
        - `segments` MetricsSegmentInfo[] — Segmented metric data (if further segmented).

## Other responses

- `default` — An error response object.

## Changes

- **2026-07-13** (2018-04-20) `5ba59b0ed852` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/azure/apis/applicationinsights-insights/changes/apps/:appId/metrics/post.md)

---

[API](https://skmtc.dev/azure/apis/applicationinsights-insights.md) · [All operations](https://skmtc.dev/azure/apis/applicationinsights-insights/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/applicationinsights-insights/revisions/5ba59b0ed852/schema)
