**版本：202201**

# 查询数据分析

**GET** `/openapi/2022-01/data/analysis`

## 请求

**Query参数**

- `begin_time` int32 (required)

  Begin time of analysis data, e.g. `1666512000`
- `end_time` int32 (required)

  End time of analysis data, e.g. `1682323199`
- `indicator` string[] (required)

  Analysis indicator, all dimension can choose from `pv` `uv` `add_cart_uv` `begin_checkout_pv` `begin_checkout_uv` `orders` `sales`, `shop` or country dimension can additionally choose from `conversion_rate` `add_cart_qty` `add_payment_info_uv`
- `tz` float

  Time zone, e.g. `8`
- `page` int32

  Page number
- `limit` int32

  Limit per page, default `20`, max `200`
- `sort_by` string

  Sort, choose from field of `indicator`
- `sort_direction` string

  Sort direction, choose from `asc` `desc`
- `dt_by` string

  Time aggregation granularity, choose `dt_by_hour` `dt_by_day`
- `dimension` string[]

  Analysis dimension, analysis shop dimension when field is empty, analysis country dimension when choose from `country_code`, analysis utm dimension when choose from`utm_source` `utm_medium` `utm_term` `utm_campaign` `utm_content`
- `filters` string[]

  Analysis filters, e.g. `utm_source=google` `country_code=CN`

## 响应

**200 | 422**

200

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `count` integer

  **默认值：** `0`

  **示例：** `2`
- `data` object[]

  *   Array [

  - `date_time` string

    **示例：** `2023-05-16T16:00:00Z`
  - `country_abbr` string

    **示例：** `shenzhen`
  - `country_code` string

    **示例：** `CN`
  - `utm_source` string

    **示例：** `-`
  - `utm_medium` string

    **示例：** `-`
  - `utm_campaign` string

    **示例：** `-`
  - `utm_term` string

    **示例：** `-`
  - `utm_content` string

    **示例：** `-`
  - `pv` integer

    **默认值：** `0`

    **示例：** `0`
  - `uv` integer

    **默认值：** `0`

    **示例：** `0`
  - `add_cart_uv` integer

    **默认值：** `0`

    **示例：** `0`
  - `add_cart_qty` integer

    **默认值：** `0`

    **示例：** `0`
  - `begin_checkout_pv` integer

    **默认值：** `0`

    **示例：** `0`
  - `begin_checkout_uv` integer

    **默认值：** `0`

    **示例：** `0`
  - `orders` integer

    **默认值：** `0`

    **示例：** `1`
  - `sales` number

    **默认值：** `0`

    **示例：** `10.6`
  - `conversion_rate` number

    **默认值：** `0`

    **示例：** `0.5`
  *   ]

```json
{
  "count": 2,
  "data": [
    {
      "date_time": "2023-05-16T16:00:00Z",
      "country_abbr": "shenzhen",
      "country_code": "CN",
      "utm_source": "-",
      "utm_medium": "-",
      "utm_campaign": "-",
      "utm_term": "-",
      "utm_content": "-",
      "pv": 0,
      "uv": 0,
      "add_cart_uv": 0,
      "add_cart_qty": 0,
      "begin_checkout_pv": 0,
      "begin_checkout_uv": 0,
      "orders": 1,
      "sales": 10.6,
      "conversion_rate": 0.5
    }
  ]
}
```

```json
{
    "count": 2,
    "data": [
        {
            "date_time": "2023-05-16T16:00:00Z",
          	"country_abbr":"shenzhen",
          	"country_code": "CN",
          	"utm_source": "-",
            "utm_medium": "-",
            "utm_campaign": "-",
            "utm_term": "-",
            "utm_content": "-",
            "pv": 0,
            "uv": 0,
            "add_cart_uv": 0,
            "add_cart_qty": 0,
            "begin_checkout_pv": 0,
            "begin_checkout_uv": 0,
            "orders": 1,
            "sales": 10.6,
          "conversion_rate":0.5
        },
        {
            "date_time": "2023-05-24T16:00:00Z",
          "country_abbr":"shenzhen",
            "country_code": "HK",
            "utm_source": "-",
            "utm_medium": "-",
            "utm_campaign": "-",
            "utm_term": "-",
            "utm_content": "-",
            "pv": 0,
            "uv": 0,
            "add_cart_uv": 0,
            "add_cart_qty": 0,
            "begin_checkout_pv": 0,
            "begin_checkout_uv": 0,
            "orders": 2,
            "sales": 24,
           "conversion_rate":0.5
        }
    ]
}
```

422

**application/json**

**数据结构 | 示例 | Result**

**数据结构**

- `errors` string[]

```json
{
  "errors": [
    "BeginTime is required"
  ]
}
```

```json
{
  "errors": [
    "BeginTime is required",
    "EndTime is required",
    "Indicator is required",
     "indicator not support when request is custom dimension ",
     "sort_by need choose in the indicator",
    "dt_by not support",
    "not support dimension or not support use custom together with utm"

  ]
}
```
