API Platform Base Path: https://api.enterprise.apigee.com/v1/o/{org_name}

API Resource Path: /environments/{environment_name}/stats/{dimension_name}

Use the GET method to retrieve metrics for a dimension

Verb: GET

Auth: Basic Auth

Content Types:

application/json

Developer Guide Topic

A report is generated using a GET request on the /stats API resource, accompanied by:

  • An optional URI parameter that defines the dimension for the report. Apigee defines a set of dimensions an pre-aggregates a set of metrics against those dimensions. If no dimension is defined (i.e., if the URI parameter is empty), then a report is generated for all APIs present in the environment specified.
  • A set of query parameters that define the metrics, time range, time interval, and filter/drill-down aspects of the report.

dimension_name: A URI parameter that defines the entity for which the API Platform metrics should be retrieved. Apigee defines a set of dimensions that can be used in reports. Supported dimensions include:

  • /stats/apis: APIs in an organization on the API Platform
  • /stats/apiproducts: API products defined in an organization
  • /stats/client_ip: IP addresses of apps making the request to APIs on the API Platform
  • /stats/developer_email: The email address of a developer registered in an organization on the API Platform
  • /stats/developer_app: The name of the developer app making the request to your API
  • /stats/access_token: The app end user's OAuth access token

For a complete list of dimensions, metrics, and sample requests, see the Analytics Developer Guide Topic. Custom dimensions can be added by defining custom variables as described in the Custom Analytics Developer Guide Topic.

Sample Request:

$ curl https://api.enterprise.apigee.com/v1/o/{org_name}/environments/{env_name}/stats/{dimension_name}?"select=message_count&timeRange=1/1/2013%2000:00~1/2/2013%2000:00&timeUnit=hour&sortby=message_count&sort=DESC&filter=(apis%20in%20'weather','news')" \
-u myname:mypass
Query Parameters:
Name Description Default Required?
select Designates the metric to be aggregated for the report. Supported metrics are message_count, error_count, total_response_time, max_response_time, min_response_time, data_exchange_size, end_point_response_time N/A Yes
timeRange The start and end time for the desired interval. The date format is MM/DD/YYYY HH:MM. For example, 1/1/2013%2000:00~1/2/2013%2000:00 N/A Yes
timeUnit second, minute, hour, day, week, month, quarter, year, decade, century, millennium N/A Yes
sortby When two or more select values are specified, 'sortby' can be used to specify the select used for sorting results: message_count, error_count, total_response_time, max_response_time, min_response_time, data_exchange_size, end_point_response_time N/A No
sort Supported sort scopes are DESC or ASC N/A No
topk Take "top k" results from results, for example, to return the top 5 results "topk=5". N/A No
filter Enables drill-down on specific dimension values N/A No
Sample Response:
{
  "environments" : [ {
	"dimensions" : [ {
  	  "metrics" : [ 
                 {
    	        "name" : "message_count",
    	        "values" : [ {
      	           "timestamp" : 1335241800000,
      	           "value" : "1.0"
    	         } ]
  	      } ,
                 {
    	         "name" : "error_count",
    	         "values" : [ {
      	            "timestamp" : 1335241800000,
      	            "value" : "0.0"
    	           } ]
  	    } 
              ],
  	
               "name" : "api1"
	}, 
            {
  	  "metrics" : [ 
               {
    	      "name" : "message_count",
    	      "values" : [ {
      	             "timestamp" : 1335241800000,
      	             "value" : "1.0"
    	          } ]
  	     },
                {
    	        "name" : "error_count",
    	        "values" : [ {
      	              "timestamp" : 1335241800000,
      	              "value" : "0.0"
    	        } ]
  	    } 
             ],
  	
             "name" : "api2"
	} 
          ],
        
         "name" : "test"
      } 
    ],
   "metaData" : {
    }
}
Response Payload Elements:
 
 
 
 
 
Name Description
metadata Metadata associated with the report
environments Environments in the organization where the statistics are collected (supports wildcard * for cross environment statistics collection)
metrics The values returned for the specified dimension
dimensions The dimension defined for measurement: in this example api_name.
metrics Metrics for the report
Last updated: 19 days ago