[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-05 (世界標準時間)。"],[[["\u003cp\u003eThis documentation outlines how to retrieve information about API calls within Apigee and Apigee hybrid environments.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine the total number of calls made to all APIs within a specific organization and environment for a set timeframe using the Metrics API.\u003c/p\u003e\n"],["\u003cp\u003eThe Metrics API also allows you to calculate the total amount of request and response data processed by all APIs within a specified organization, environment, and time range.\u003c/p\u003e\n"],["\u003cp\u003eTo obtain comprehensive data for all API activity, you must repeat the API calls for each environment and organization.\u003c/p\u003e\n"],["\u003cp\u003eProxy chaining within an environment is factored into the total count of API calls and the amount of processed data.\u003c/p\u003e\n"]]],[],null,["# Get information about calls to your APIs\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\nThis page describes how to get information about calls to your APIs, including:\n\n- The [total number of calls made to all APIs](#total-number-of-calls-made-to-all-apis).\n- The [total amount of data processed by\n all APIs](#total-amount-of-data-processed-by-all-apis).\n\nThis information can help you\nevaluate your Apigee subscription level,\nas described in [Subscription entitlements](/apigee/docs/api-platform/reference/subscription-entitlements).\n| **Note:** To make the API calls described below, you must have the `apigee.environments.getStats` permission. To learn which Apigee roles have this permission, see [Apigee roles](https://cloud.google.com/iam/docs/understanding-roles#apigee-roles).\n\nTotal number of calls made to all APIs\n--------------------------------------\n\nTo find the total number of calls made to all APIs in a single organization and environment for\na given time range, use a\n[Metrics API](/apigee/docs/api-platform/analytics/use-analytics-api-measure-api-program-performance) call similar to the one shown below. The result takes into account\nscenarios in which you have [chained proxies](#note-on-proxy-chaining) together. \n\n```\ncurl -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\" \\\n-H \"Authorization: Bearer $TOKEN\"\n```\n\nIn the above call:\n\n- \u003cvar translate=\"no\"\u003eORG\u003c/var\u003e is the organization.\n- \u003cvar translate=\"no\"\u003eENV\u003c/var\u003e is the environment.\n- `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`.\n- `$TOKEN` is an environment variable set to your OAuth 2.0 access token, as described in [Obtaining an OAuth 2.0 access token](/apigee/docs/api-platform/get-started/api-get-started#oauth20). For information about the `curl` options used in this example, see [Using curl](/apigee/docs/api-platform/get-started/api-get-started#curl).\n\n| **Note:** To find the total number of calls made to your APIs, you must repeat the above call for all your environments and organizations.\n\nThe following is an example of the response to the above call: \n\n```\n{\n \"environments\": [\n {\n \"metrics\": [\n {\n \"name\": \"sum(message_count)\",\n \"values\": [\n \"7.44944088E8\"\n ]\n }\n ],\n \"name\": \"prod\"\n }\n ],\n...\n}\n```\n\nThe `values` field of the response contains the number of calls made to the APIs\nin the organization and environment in the specified time range.\n\nTotal amount of data processed by all APIs\n------------------------------------------\n\nTo find the total amount of data processed by all APIs in a single organization and environment\nfor a given time range, use two calls: one for request data and another for response data.\n| **Note:** The total includes the size of the payload data in the calls, but not header size.\n\nTo find the total amount of request data, use a call similar to the following: \n\n```\ncurl -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\" \\\n-H \"Authorization: Bearer $TOKEN\"\n```\n\nTo find the total amount response data, use a call similar to the following: \n\n```\ncurl -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\" \\\n-H \"Authorization: Bearer $TOKEN\"\n```\n\nThe variables in these calls are the same as in the\n[previous example](#total-number-of-calls-made-to-all-apis).\n| **Note:** To find the total amount of data processed by your APIs, you must repeat the above calls for all your environments and organizations.\n\nNote on proxy chaining\n----------------------\n\nIf an environment contains multiple proxies\n[chained together](/apigee/docs/api-platform/fundamentals/connecting-proxies-other-proxies),\na single call to one of the proxies\nwill be forwarded to the other proxies in the chain. This increases the total count of API calls\nand the total amount of data processed by all API calls. The commands that return this information,\nshown in the sections above, take proxy chaining into account."]]