Stats vs Analytics what is the difference.

Not applicable

Hi,

I am new to Apigee, and I am trying to find out what is the difference between the .../stats/ and .../analytics/ reference when making API calls. The /stats/ method seems to be more represented within the documentation.

The /stat/ as referenced here:

.... /stats/

api.enterprise.apigee.com/v1/organizations/(org)/environments/prod/stats

ref:https://community.apigee.com/articles/2621/querying-analytics-apis-in-apigee-edge.html

The /analytics/ as referenced here:

.../analytics/

../organizations/{org}/environments/{env}/analytics/admin/schema?type=fact

ref:https://community.apigee.com/questions/1986/analytics-filter-invalid-api-call.html

Specifically, I am wanting access a custom variable. What method should I use?

regards

Bruce

Solved Solved
1 2 323
1 ACCEPTED SOLUTION

@brucejenkins , Welcome to Apigee Community,

As explained by @padmanabhans , /stats is used to get the data from Apigee Analytics datastore. For example,

https://api.enterprise.apigee.com/v1/organizations/{ORG}/environments/{ENV}/stats/apis?select=sum(me... 00:00~06/26/2017 23:59

Sample Response below,

{
  "environments": [
    {
      "dimensions": [
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "5.0"
              ]
            }
          ],
          "name": "xxxx-API"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "2.0"
              ]
            }
          ],
          "name": "testoauth"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "36.0"
              ]
            }
          ],
          "name": "accounts"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "4.0"
              ]
            }
          ],
          "name": "Encrypt"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "8.0"
              ]
            }
          ],
          "name": "transfers"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "6.0"
              ]
            }
          ],
          "name": "Redirect"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "7.0"
              ]
            }
          ],
          "name": "Statement"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "201.0"
              ]
            }
          ],
          "name": "Transfer"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "4.0"
              ]
            }
          ],
          "name": "transfers-connector"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "65.0"
              ]
            }
          ],
          "name": "oauth"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "9.0"
              ]
            }
          ],
          "name": "oauthOpenAPI"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "18.0"
              ]
            }
          ],
          "name": "xxxxx"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "38.0"
              ]
            }
          ],
          "name": "BalanceInformation"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "275.0"
              ]
            }
          ],
          "name": "oauthV1"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "4069.0"
              ]
            }
          ],
          "name": "Accounts"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "16.0"
              ]
            }
          ],
          "name": "accounts-connector"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "37.0"
              ]
            }
          ],
          "name": "xxx"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "24.0"
              ]
            }
          ],
          "name": "Balance"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "2.0"
              ]
            }
          ],
          "name": "Transfer_test"
        }
      ],
      "name": "test"
    }
  ],
  "metaData": {
    "errors": [],
    "notices": [
      "Limit applied: xxxx",
      "query served by:xxxx",
      "Table used: xxxx",
      "source xxx"
    ]
  }
}

Above API will give you traffic by API Proxies between 1st June - 26th June.

Regarding, /analytics, It's used for getting metainfo not the actual data,

For example, If you would like access list of dimensions & metrics in your org & meta info like it's a custom dimension or out of the box dimension, You will use API call below,

https://api.enterprise.apigee.com/v1/organizations/{ORG}/environments/{ENV}/analytics/admin/schemav2...

{
  "dimensions": [
    {
      "name": "organization",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.585Z"
      }
    },
    {
      "name": "environment",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.590Z"
      }
    },
    {
      "name": "apiproxy",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.592Z"
      }
    },
    {
      "name": "request_uri",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.594Z"
      }
    },
    {
      "name": "proxy",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.596Z"
      }
    },
    {
      "name": "proxy_basepath",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.598Z"
      }
    },
    {
      "name": "request_verb",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.600Z"
      }
    },
    {
      "name": "response_status_code",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.604Z"
      }
    },
    {
      "name": "client_ip",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.623Z"
      }
    },
    {
      "name": "access_token",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.624Z"
      }
    },
    {
      "name": "client_id",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.626Z"
      }
    },
    {
      "name": "developer",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.628Z"
      }
    },
    {
      "name": "developer_app",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.629Z"
      }
    },
    {
      "name": "api_product",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.631Z"
      }
    },
    {
      "name": "flow_resource",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.633Z"
      }
    },
    {
      "name": "target",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.635Z"
      }
    },
    {
      "name": "target_url",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.636Z"
      }
    },
    {
      "name": "target_host",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.638Z"
      }
    },
    {
      "name": "apiproxy_revision",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.640Z"
      }
    },
    {
      "name": "proxy_pathsuffix",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.641Z"
      }
    },
    {
      "name": "proxy_client_ip",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.643Z"
      }
    },
    {
      "name": "target_basepath",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.644Z"
      }
    },
    {
      "name": "target_ip",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.647Z"
      }
    },
    {
      "name": "request_path",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.649Z"
      }
    },
    {
      "name": "developer_email",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.652Z"
      }
    },
    {
      "name": "virtual_host",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.654Z"
      }
    },
    {
      "name": "gateway_flow_id",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.655Z"
      }
    },
    {
      "name": "x_forwarded_for_ip",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.667Z"
      }
    },
    {
      "name": "useragent",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.669Z"
      }
    },
    {
      "name": "target_response_code",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.670Z"
      }
    },
    {
      "name": "ax_ua_agent_type",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.678Z"
      }
    },
    {
      "name": "ax_ua_os_version",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.684Z"
      }
    },
    {
      "name": "ax_ua_os_family",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.682Z"
      }
    },
    {
      "name": "ax_ua_agent_version",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.681Z"
      }
    },
    {
      "name": "ax_ua_device_category",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.676Z"
      }
    },
    {
      "name": "ax_ua_agent_family",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.679Z"
      }
    },
    {
      "name": "ax_geo_continent",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.688Z"
      }
    },
    {
      "name": "ax_geo_city",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.685Z"
      }
    },
    {
      "name": "ax_geo_country",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.687Z"
      }
    },
    {
      "name": "ax_geo_timezone",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.689Z"
      }
    },
    {
      "name": "gateway_source",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.713Z"
      }
    },
    {
      "name": "ax_month_of_year",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.711Z"
      }
    },
    {
      "name": "ax_hour_of_day",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.707Z"
      }
    },
    {
      "name": "ax_week_of_month",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.710Z"
      }
    },
    {
      "name": "ax_day_of_week",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.709Z"
      }
    },
    {
      "name": "ax_cache_key",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.718Z"
      }
    },
    {
      "name": "ax_cache_source",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.720Z"
      }
    },
    {
      "name": "ax_cache_name",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.716Z"
      }
    },
    {
      "name": "ax_edge_execution_fault_code",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.723Z"
      }
    },
    {
      "name": "ax_execution_fault_policy_name",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.725Z"
      }
    },
    {
      "name": "ax_execution_fault_flow_state",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.728Z"
      }
    },
    {
      "name": "ax_execution_fault_flow_name",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.727Z"
      }
    },
    {
      "name": "ax_dn_region",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.725Z"
      }
    },
    {
      "name": "ax_mp_host",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.730Z"
      }
    },
    {
      "name": "ax_geo_region",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.738Z"
      }
    },
    {
      "name": "ax_true_client_ip",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.739Z"
      }
    },
    {
      "name": "senseaction",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-08-23T17:53:40.480Z"
      }
    },
    {
      "name": "color",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-06-02T20:40:03.872Z"
      }
    },
    {
      "name": "cititesqueried",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2017-05-25T08:40:06.881Z"
      }
    },
    {
      "name": "name",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-12T07:10:15.409Z"
      }
    },
    {
      "name": "catalog",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.899Z"
      }
    },
    {
      "name": "subcategory",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.891Z"
      }
    },
    {
      "name": "product",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.889Z"
      }
    },
    {
      "name": "category",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.897Z"
      }
    },
    {
      "name": "productid",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.895Z"
      }
    },
    {
      "name": "email",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.893Z"
      }
    },
    {
      "name": "eatary_type",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-05-06T11:42:54.299Z"
      }
    },
    {
      "name": "state",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-05-06T11:42:54.393Z"
      }
    }
  ],
  "meta": [],
  "metrics": [
    {
      "name": "request_size",
      "properties": {
        "type": "bigint",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.602Z"
      }
    },
    {
      "name": "is_error",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.606Z"
      }
    },
    {
      "name": "response_size",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.650Z"
      }
    },
    {
      "name": "message_count",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.658Z"
      }
    },
    {
      "name": "total_response_time",
      "properties": {
        "type": "double",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.659Z"
      }
    },
    {
      "name": "request_processing_latency",
      "properties": {
        "type": "double",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.661Z"
      }
    },
    {
      "name": "response_processing_latency",
      "properties": {
        "type": "double",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.662Z"
      }
    },
    {
      "name": "target_response_time",
      "properties": {
        "type": "double",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.664Z"
      }
    },
    {
      "name": "cache_hit",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.666Z"
      }
    },
    {
      "name": "target_error",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.673Z"
      }
    },
    {
      "name": "policy_error",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.675Z"
      }
    },
    {
      "name": "ax_cache_l1_count",
      "properties": {
        "type": "bigint",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.721Z"
      }
    },
    {
      "name": "ax_cache_executed",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.714Z"
      }
    },
    {
      "name": "ax_edge_is_apigee_fault",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.724Z"
      }
    }
  ]
}

Looks like /analytics endpoint has been changed, Notice /schemav2 in the API Path above which worked for me.

Regarding your query, Access a custom variable. What method should I use?

I am not sure what do you mean custom variable , I believe it's part of API Runtime. By default, We don't capture any API payload into analytics. It might contain personal information which we don't want to capture out of the box. But, You can do same using statistics-collector-policy & run the reports to fetch the custom variables data using Custom Reports in Edge.

Hope it helps. Keep us posted if any.

View solution in original post

2 REPLIES 2

Not applicable

Hi Bruce, the /stats calls are teh ones to use for actual queries of the analytics data.

The /analytics calls are for getting schema data and related metadata.

@brucejenkins , Welcome to Apigee Community,

As explained by @padmanabhans , /stats is used to get the data from Apigee Analytics datastore. For example,

https://api.enterprise.apigee.com/v1/organizations/{ORG}/environments/{ENV}/stats/apis?select=sum(me... 00:00~06/26/2017 23:59

Sample Response below,

{
  "environments": [
    {
      "dimensions": [
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "5.0"
              ]
            }
          ],
          "name": "xxxx-API"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "2.0"
              ]
            }
          ],
          "name": "testoauth"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "36.0"
              ]
            }
          ],
          "name": "accounts"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "4.0"
              ]
            }
          ],
          "name": "Encrypt"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "8.0"
              ]
            }
          ],
          "name": "transfers"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "6.0"
              ]
            }
          ],
          "name": "Redirect"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "7.0"
              ]
            }
          ],
          "name": "Statement"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "201.0"
              ]
            }
          ],
          "name": "Transfer"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "4.0"
              ]
            }
          ],
          "name": "transfers-connector"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "65.0"
              ]
            }
          ],
          "name": "oauth"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "9.0"
              ]
            }
          ],
          "name": "oauthOpenAPI"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "18.0"
              ]
            }
          ],
          "name": "xxxxx"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "38.0"
              ]
            }
          ],
          "name": "BalanceInformation"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "275.0"
              ]
            }
          ],
          "name": "oauthV1"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "4069.0"
              ]
            }
          ],
          "name": "Accounts"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "16.0"
              ]
            }
          ],
          "name": "accounts-connector"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "37.0"
              ]
            }
          ],
          "name": "xxx"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "24.0"
              ]
            }
          ],
          "name": "Balance"
        },
        {
          "metrics": [
            {
              "name": "sum(message_count)",
              "values": [
                "2.0"
              ]
            }
          ],
          "name": "Transfer_test"
        }
      ],
      "name": "test"
    }
  ],
  "metaData": {
    "errors": [],
    "notices": [
      "Limit applied: xxxx",
      "query served by:xxxx",
      "Table used: xxxx",
      "source xxx"
    ]
  }
}

Above API will give you traffic by API Proxies between 1st June - 26th June.

Regarding, /analytics, It's used for getting metainfo not the actual data,

For example, If you would like access list of dimensions & metrics in your org & meta info like it's a custom dimension or out of the box dimension, You will use API call below,

https://api.enterprise.apigee.com/v1/organizations/{ORG}/environments/{ENV}/analytics/admin/schemav2...

{
  "dimensions": [
    {
      "name": "organization",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.585Z"
      }
    },
    {
      "name": "environment",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.590Z"
      }
    },
    {
      "name": "apiproxy",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.592Z"
      }
    },
    {
      "name": "request_uri",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.594Z"
      }
    },
    {
      "name": "proxy",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.596Z"
      }
    },
    {
      "name": "proxy_basepath",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.598Z"
      }
    },
    {
      "name": "request_verb",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.600Z"
      }
    },
    {
      "name": "response_status_code",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.604Z"
      }
    },
    {
      "name": "client_ip",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.623Z"
      }
    },
    {
      "name": "access_token",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.624Z"
      }
    },
    {
      "name": "client_id",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.626Z"
      }
    },
    {
      "name": "developer",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.628Z"
      }
    },
    {
      "name": "developer_app",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.629Z"
      }
    },
    {
      "name": "api_product",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.631Z"
      }
    },
    {
      "name": "flow_resource",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.633Z"
      }
    },
    {
      "name": "target",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.635Z"
      }
    },
    {
      "name": "target_url",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.636Z"
      }
    },
    {
      "name": "target_host",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.638Z"
      }
    },
    {
      "name": "apiproxy_revision",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.640Z"
      }
    },
    {
      "name": "proxy_pathsuffix",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.641Z"
      }
    },
    {
      "name": "proxy_client_ip",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.643Z"
      }
    },
    {
      "name": "target_basepath",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.644Z"
      }
    },
    {
      "name": "target_ip",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.647Z"
      }
    },
    {
      "name": "request_path",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.649Z"
      }
    },
    {
      "name": "developer_email",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.652Z"
      }
    },
    {
      "name": "virtual_host",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.654Z"
      }
    },
    {
      "name": "gateway_flow_id",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.655Z"
      }
    },
    {
      "name": "x_forwarded_for_ip",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.667Z"
      }
    },
    {
      "name": "useragent",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.669Z"
      }
    },
    {
      "name": "target_response_code",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.670Z"
      }
    },
    {
      "name": "ax_ua_agent_type",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.678Z"
      }
    },
    {
      "name": "ax_ua_os_version",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.684Z"
      }
    },
    {
      "name": "ax_ua_os_family",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.682Z"
      }
    },
    {
      "name": "ax_ua_agent_version",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.681Z"
      }
    },
    {
      "name": "ax_ua_device_category",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.676Z"
      }
    },
    {
      "name": "ax_ua_agent_family",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.679Z"
      }
    },
    {
      "name": "ax_geo_continent",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.688Z"
      }
    },
    {
      "name": "ax_geo_city",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.685Z"
      }
    },
    {
      "name": "ax_geo_country",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.687Z"
      }
    },
    {
      "name": "ax_geo_timezone",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.689Z"
      }
    },
    {
      "name": "gateway_source",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.713Z"
      }
    },
    {
      "name": "ax_month_of_year",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.711Z"
      }
    },
    {
      "name": "ax_hour_of_day",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.707Z"
      }
    },
    {
      "name": "ax_week_of_month",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.710Z"
      }
    },
    {
      "name": "ax_day_of_week",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.709Z"
      }
    },
    {
      "name": "ax_cache_key",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.718Z"
      }
    },
    {
      "name": "ax_cache_source",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.720Z"
      }
    },
    {
      "name": "ax_cache_name",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.716Z"
      }
    },
    {
      "name": "ax_edge_execution_fault_code",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.723Z"
      }
    },
    {
      "name": "ax_execution_fault_policy_name",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.725Z"
      }
    },
    {
      "name": "ax_execution_fault_flow_state",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.728Z"
      }
    },
    {
      "name": "ax_execution_fault_flow_name",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.727Z"
      }
    },
    {
      "name": "ax_dn_region",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.725Z"
      }
    },
    {
      "name": "ax_mp_host",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.730Z"
      }
    },
    {
      "name": "ax_geo_region",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.738Z"
      }
    },
    {
      "name": "ax_true_client_ip",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.739Z"
      }
    },
    {
      "name": "senseaction",
      "properties": {
        "type": "string",
        "custom": "false",
        "createTime": "2016-08-23T17:53:40.480Z"
      }
    },
    {
      "name": "color",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-06-02T20:40:03.872Z"
      }
    },
    {
      "name": "cititesqueried",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2017-05-25T08:40:06.881Z"
      }
    },
    {
      "name": "name",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-12T07:10:15.409Z"
      }
    },
    {
      "name": "catalog",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.899Z"
      }
    },
    {
      "name": "subcategory",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.891Z"
      }
    },
    {
      "name": "product",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.889Z"
      }
    },
    {
      "name": "category",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.897Z"
      }
    },
    {
      "name": "productid",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.895Z"
      }
    },
    {
      "name": "email",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-04-20T05:40:32.893Z"
      }
    },
    {
      "name": "eatary_type",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-05-06T11:42:54.299Z"
      }
    },
    {
      "name": "state",
      "properties": {
        "type": "STRING",
        "custom": "true",
        "createTime": "2016-05-06T11:42:54.393Z"
      }
    }
  ],
  "meta": [],
  "metrics": [
    {
      "name": "request_size",
      "properties": {
        "type": "bigint",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.602Z"
      }
    },
    {
      "name": "is_error",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.606Z"
      }
    },
    {
      "name": "response_size",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.650Z"
      }
    },
    {
      "name": "message_count",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.658Z"
      }
    },
    {
      "name": "total_response_time",
      "properties": {
        "type": "double",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.659Z"
      }
    },
    {
      "name": "request_processing_latency",
      "properties": {
        "type": "double",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.661Z"
      }
    },
    {
      "name": "response_processing_latency",
      "properties": {
        "type": "double",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.662Z"
      }
    },
    {
      "name": "target_response_time",
      "properties": {
        "type": "double",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.664Z"
      }
    },
    {
      "name": "cache_hit",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.666Z"
      }
    },
    {
      "name": "target_error",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.673Z"
      }
    },
    {
      "name": "policy_error",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.675Z"
      }
    },
    {
      "name": "ax_cache_l1_count",
      "properties": {
        "type": "bigint",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.721Z"
      }
    },
    {
      "name": "ax_cache_executed",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.714Z"
      }
    },
    {
      "name": "ax_edge_is_apigee_fault",
      "properties": {
        "type": "int",
        "custom": "false",
        "createTime": "2016-02-26T10:23:09.724Z"
      }
    }
  ]
}

Looks like /analytics endpoint has been changed, Notice /schemav2 in the API Path above which worked for me.

Regarding your query, Access a custom variable. What method should I use?

I am not sure what do you mean custom variable , I believe it's part of API Runtime. By default, We don't capture any API payload into analytics. It might contain personal information which we don't want to capture out of the box. But, You can do same using statistics-collector-policy & run the reports to fetch the custom variables data using Custom Reports in Edge.

Hope it helps. Keep us posted if any.