You are viewing the Apigee Management API reference documentation. For the main product docs, and to search all docs, go to For cross-site search, click Search all in the search results.

Get API message counts

Resource Summary


Content Type





Get API message counts

Use this API call to get the number of API messages made per time interval in an organization and environment. If you are using Edge Microgateway with the analytics plugin enabled (default), API calls to Edge Microgateway are included in the count.


If you have multiple organizations and environments, make this API call for each one and add them to get the total number of calls per time interval for your API program.


To convert the JSON response to a CSV format for use in spreadsheets, use a tool like


For different and more granular metrics, use the Get metrics organized by dimensions management API. For more information on the analytics management API, see Use the analytics API to measure API program performance.


You can also try this API Traffic Summarizer tool to get and graph traffic data by API proxy over a specific time range.


Resource URL /organizations/{org_name}/environments/{env_name}/stats/

Query Parameters

Name Values Description

Use sum(message_count) to tell the API you want the message count.


The UTC start and end time for the desired interval. The date format is MM/DD/YYYY HH:MM. For example, 03/01/2016 00:00~03/31/2016 23:59 returns data for the month of March 2016.

If you make a request through this SmartDocs page, it automatically URL encodes the space character before HH:MM. However, if you are entering the time range in a cURL command from the command line, manually insert "%20" for the space character, in the form: MM/DD/YYYY%20HH:MM~MM/DD/YYYY%20HH:MM. (See the cURL tab below after you make a request.)

Note: Data older than six months from the current date is not accessible by default. If you want to access data older than six months, contact Apigee Support.


Leave this blank to return the total number of API calls. However, if you want to return counts in time intervals, specify a value of second, minute, hour, day, or week.

The Epoch timestamp in milliseconds that is returned is the start time of each interval.

Request Body

org_name Mention the organization name true

env_name Mention the environment name, such as test or prod true

HTTP Basic

OAuth 2.0



Make a request and see the response.

Make a request and see the response.

Make a request and see the response.


Help or comments?

  • If something's not working: Ask the Apigee Community or see Apigee Support.
  • If something's wrong with the docs: Click the "Send Feedback" button.
    (Incorrect? Unclear? Broken link? Typo?)