Get information about calls to your APIs

This page applies to Apigee and Apigee hybrid.

View Apigee Edge documentation.

This page describes how to get information about calls to your APIs, including:

This information can help you evaluate your Apigee subscription level, as described in Subscription entitlements.

Total number of calls made to all APIs

To find the total number of calls made to all APIs in a single organization and environment for a given time range, use a Metrics API call similar to the one shown below. The result takes into account scenarios in which you have chained proxies together.

curl -v "https://apigee.googleapis.com/v1/organizations/ORG/environments/ENV/stats/?select=sum(message_count)&timeRange=03/01/2023+00:00~03/31/2023+23:59" \
-H "Authorization: Bearer $TOKEN"

In the above call:

  • ORG is the organization.
  • ENV is the environment.
  • timeRange is the time range for the report, in the form MM/DD/YYYY+HH:MM~MM/DD/YYYY+HH:MM, where the start date and time and the end date and time are of the form MM/DD/YYYY+HH:MM.
  • $TOKEN is an environment variable set to your OAuth 2.0 access token, as described in Obtaining an OAuth 2.0 access token. For information about the curl options used in this example, see Using curl.

The following is an example of the response to the above call:

{
  "environments": [
    {
      "metrics": [
        {
          "name": "sum(message_count)",
          "values": [
            "7.44944088E8"
          ]
        }
      ],
      "name": "prod"
    }
  ],
...
}

The values field of the response contains the number of calls made to the APIs in the organization and environment in the specified time range.

Total amount of data processed by all APIs

To find the total amount of data processed by all APIs in a single organization and environment for a given time range, use two calls: one for request data and another for response data.

To find the total amount of request data, use a call similar to the following:

curl -v "https://apigee.googleapis.com/v1/organizations/ORG/environments/ENV/stats/?select=sum(request_size)&timeRange=03/01/2023+00:00~03/31/2023+23:59" \
-H "Authorization: Bearer $TOKEN"

To find the total amount response data, use a call similar to the following:

curl -v "https://apigee.googleapis.com/v1/organizations/ORG/environments/ENV/stats/?select=sum(response_size)&timeRange=03/01/2023+00:00~03/31/2023+23:59" \
-H "Authorization: Bearer $TOKEN"

The variables in these calls are the same as in the previous example.

Note on proxy chaining

If an environment contains multiple proxies chained together, a single call to one of the proxies will be forwarded to the other proxies in the chain. This increases the total count of API calls and the total amount of data processed by all API calls. The commands that return this information, shown in the sections above, take proxy chaining into account.