v2

latestOpenAPI 3.0.3Apache 2.0raw.githubusercontent.com2026-07-21130282381.6 KB
API Analytics

Perform analytics on API data

Perform analytics on API data

Perform analytics on API data based on the provided query parameters.

get/environments/{envId}/apis/{apiId}/analytics

Query parameters

frominteger

Start timestamp (epoch millis)

tointeger

End timestamp (epoch millis)

intervalinteger

Interval in milliseconds

fieldstring

Field to aggregate on

sizeinteger

Size of the result set

type'STATS' | 'COUNT' | 'HISTOGRAM' | 'GROUP_BY'

The type of the analytics

Example:STATS

Type of analytics (STATS, COUNT, HISTOGRAM, GROUP_BY)

rangesstring

Ranges for aggregation, e.g. "100:199;200:299"

aggregationsstring

Aggregations to apply, e.g. "avg:response-time,avg:api-response-time"

orderstring

Parameter format <descending '-'><type 'avg' or 'count'>:<field>.
Example: -avg:gateway-response-time-ms will sort descending by average response time,
count:_key will order ascending by count in bucket.

querystring

Custom search query

termsstring[]

Optional filters like plan-id, application-id applied in the dashboard, e.g. "plan-id:xyz,application-id:abc"

Response

Successful analytics response

OR
OR
OR

Example response

{
  "analyticsType": "STATS"
}