---
metadata:
  - name: generator
    content: Diplodoc Platform v5.46.1
alternate:
  - https://yandex.com/dev/partner-statistics/doc/en/reference/statistics-get2.md
  - https://yandex.com/dev/partner-statistics/doc/ru/reference/statistics-get2.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/partner-statistics/doc/en/llms.txt

# Statistics report

Generates a report for the selected statistics level for the specified period.

## Request format {#input}
```
https://partner.yandex.ru/api/statistics2/get
 ? [lang](*lang)=<string>
 & [[pretty](*pretty)=<integer>]
 & [[period](*period)=<string>]
 & [[field](*field)=<string>]
 & [[limits](*limits)=<string>]
 & [[dimension_field](*dimension_field)=<string|string>]
 & [[entity_field](*entity_field)=<string>]
 & [[filter](*filter)=<string>]
 & [[order_by](*order_by)=<string>]
 & [[vat](*vat)=<boolean>]
 & [[stat_type](*stat_type)=<string>]
 & [[currency](*currency)=<string>]
 & [[timezone](*timezone)=<string>]
```
 
{% note info %}
 
You can get statistics for any time period. To do this, enter two dates (the beginning and end of the period):
```no-highlight
period=2014-06-29&period=2014-07-28
```
 
{% endnote %}

- lang [*](*a)
  : Response language. Required in all requests.

- pretty
  : Formats the results for readability. Allowed value: `pretty=1`.

- period [*](*a)
  : The time period to get a report for. Acceptable values:

    - `today`: Statistics for today.
    - `yesterday`: Statistics for yesterday.
    - `thismonth`: Statistics for the current month.
    - `lastmonth`: Statistics for the previous month.
    - `30days`: Statistics for the last 30 days (including the current day).
    - `90days`: Statistics for the last 90 days (including the current day).
    - `180days`: Statistics for the last 180 days (including the current day).
    - `365days`: Statistics for the last 365 days (including the current day).
    - `thisyear`: Statistics for the current year (including the current day).


    {% note info %}

    You can get statistics for any time period. To do this, enter two dates (the beginning and end of the period):
    ```no-highlight
    period=2014-06-29&period=2014-07-28
    ```

    {% endnote %}

- field [*](*a)
  : Identifier of a field to include in the report. These are usually various indicators, such as ad impressions in blocks or ad requests in blocks. To get a list of such fields, see the `fields` structure for the [Statistics tree](https://yandex.com/dev/partner-statistics/doc/en/reference/statistics-tree2.md) resource.


    {% note info %}

    To add multiple fields to the report, specify the parameter multiple times:
    ```no-highlight
    field=shows&field=hits
    ```

    {% endnote %}

- limits
  : Pagination. Format:

    ```no-highlight
    {"limit":50,"offset":0}
    ```
  
- dimension_field
  : ID of the field to be used for grouping (for example, grouping by day or by week). To get a list of such fields, see the `dimension_fields` structure for the [Statistics tree](https://yandex.com/dev/partner-statistics/doc/en/reference/statistics-tree2.md) resource.

- entity_field
  : ID of the field that will be used for grouping by the values of this field in the report (for example, the site domain and name). To get a list of such fields, see the `entity_fields` structure, [Statistics tree](https://yandex.com/dev/partner-statistics/doc/en/reference/statistics-tree2.md) resource.


    {% note info %}

    To group by multiple fields, specify the field IDs as follows:
    ```no-highlight
    entity_field=domain&entity_field=page_id
    ```

    {% endnote %}

- filter
  : Filter for building a report. As parameters, the filter uses the fields from the `entity_filter_fields` structure, [Statistics tree](https://yandex.com/dev/partner-statistics/doc/en/reference/statistics-tree2.md) resource. For more information, see [Filter fields](https://yandex.com/dev/partner-statistics/doc/en/reference/report.md#filters).

- order_by
  : Sorting the results. Format: 
    ```no-highlight
    [{"field":"date","dir":"asc"}]
    ```

    For the `field` parameter value, you can add the ID of the field to be used for grouping (a list of such fields is output in the `dimension_fields` structure for the [Statistics tree](https://yandex.com/dev/partner-statistics/doc/en/reference/statistics-tree2.md) resource). As the `dir` parameter value, you can use `asc/desc` to sort values in ascending/descending order. 

- vat
  : Include or exclude VAT.

- stat_type
  : Report type. Acceptable values:

    - `stat_type=mm`: Mobile Mediation report.
    - `stat_type=dsp`: DSP report.
    - `stat_type=ssp`: SSP report.
    - `stat_type=main`: Report on basic statistics. Default value.

- currency
  : Report currency. Acceptable values:

    - `USD`: US dollars.
    - `EUR`: Euro.
    - `RUB`: Rubles. Default value.

- timezone
  : Additional parameter for retrieving statistics in the specified time zone.

    By default, statistics are based on Moscow time (`Europe/Moscow`, UTC+03:00).

    {% note info %}

    When requesting statistics broken down by day, the day boundaries will be based on your specified time zone.

    For example, passing the `Asia/Bishkek` time zone (UTC+06:00) shifts the start and end of the day by +3 hours relative to Moscow time (`Europe/Moscow`, UTC+03:00) — this will be accounted for in the statistics.

    Example:

    ```json
    {
      "timezone": "Asia/Bishkek"
    }
    ```

    {% endnote %}
    
    {% cut "Supported `timezone` values" %}
    
    | UTC       | `timezone` value      |
    | --------- | ------------------------ |
    | UTC-11:00 | `Pacific/Midway`         |
    | UTC-10:00 | `Pacific/Honolulu`       |
    | UTC-09:00 | `Pacific/Gambier`        |
    | UTC-09:30 | `Pacific/Marquesas`      |
    | UTC-08:00 | `Pacific/Pitcairn`       |
    | UTC-07:00 | `America/Creston`        |
    | UTC-06:00 | `America/Bahia_Banderas` |
    | UTC-05:00 | `America/Bogota`         |
    | UTC-04:00 | `America/Anguilla`       |
    | UTC-03:00 | `America/Araguaina`      |
    | UTC-03:30 | `America/St_Johns`       |
    | UTC-02:00 | `America/Noronha`        |
    | UTC-01:00 | `Atlantic/Azores`        |
    | UTC±00:00 | `America/Danmarkshavn`   |
    | UTC+01:00 | `Africa/Tunis`           |
    | UTC+02:00 | `Europe/Kaliningrad`     |
    | UTC+03:00 | `Europe/Moscow`          |
    | UTC+03:30 | `Asia/Tehran`            |
    | UTC+04:00 | `Europe/Astrakhan`       |
    | UTC+04:30 | `Asia/Kabul`             |
    | UTC+05:00 | `Asia/Aqtau`             |
    | UTC+05:30 | `Asia/Calcutta`          |
    | UTC+05:45 | `Asia/Katmandu`          |
    | UTC+06:00 | `Asia/Bishkek`           |
    | UTC+06:30 | `Asia/Rangoon`           |
    | UTC+07:00 | `Asia/Bangkok`           |
    | UTC+08:00 | `Asia/Brunei`            |
    | UTC+08:45 | `Australia/Eucla`        |
    | UTC+09:00 | `Asia/Chita`             |
    | UTC+09:30 | `Australia/Darwin`       |
    | UTC+10:00 | `Asia/Ust-Nera`          |
    | UTC+10:30 | `Australia/Adelaide`     |
    | UTC+11:00 | `Asia/Magadan`           |
    | UTC+12:00 | `Asia/Anadyr`            |
    | UTC+13:00 | `Pacific/Apia`           |
    | UTC+13:45 | `Pacific/Chatham`        |
    | UTC+14:00 | `Pacific/Kiritimati`     |

    
    {% endcut %}
    
\* Required parameter.

## Request headers {#headers}

**Header** | **Description** | **Required**
----- | ----- | -----
`Authorization` | User access token. | Yes


The general response structure is given below. The order of elements is not guaranteed.

## Format of a JSON response {#output-JSON}

```json
{
   "data" : {
      "currencies" : [
         {
            "code" : {string},
            "id" : {string}
         },
         {
            ...
         }
      ],
      "dimensions" : {
         "field_name" : {string}
      },
      "is_last_page" : {boolean},
      "measures" : {
         "field_name" : {string}
         
      },
      "periods" : [
         [
            {string},
            {string}
         ]
      ],
      "points" : [
         {
            "dimensions" : {
               "field_name" : {string}
            },
            "measures" : [
               {
                  ...
               }
            ]
         }
      ],
      "report_title" : {string},
      "totals" : {
         "2" : [
            {
               ...
            }
         ]
      }
   },
   "result" : {string}
}      
```

## Response parameters {#spec-output}



- data
  : Statistics tree.
    - currencies
      : Currency description.
        - code
          : Currency code.
        - id
          : Currency ID.
    - totals
      : Objects with summary data in the report. Each object contains a field with the currency ID and a list of values, such as the number of clicks and impressions.
    - is_last_page
      : Indicates whether the current page is the last one (used for pagination). Acceptable values: 
        - `false`: The page isn't the last one.
        - `true`: The page is the last one.

    - points
      : Array of objects with data.
        - measures
          : Fields listed in the request.
        - dimensions
          : Fields that the report is grouped by.
    - dimensions
      : Description of the fields that the report is grouped by.
    - report_title
      : Report name.
- result
  : The result of executing the method. Acceptable values: 
    - `ok`: Method call was successful.
    - `error`: An error occurred when calling the method.


## Example for JSON {#example-JSON}

> Request:
> 
> ```no-highlight
> curl -i -g -H 'Authorization: OAuth 123qwe456a...' \
> -X GET 'https://partner.yandex.ru/api/statistics2/get.json? \
> lang=ru \
> &pretty=1 \
> &dimension_field=date|day \
> &period=thismonth \
> &entity_field=page_level \
> &field=shows \
> &field=hits_render \
> &field=hits \
> &filter=["page_id","=","458472"] \
> &field=fillrate' \
> ```
> 
> Response:
>
> ```json
> HTTP/1.1 200 OK
> Server: nginx
> Date: Wed, 16 Dec 2020 10:40:13 GMT
> Content-Type: application/json; charset=UTF-8
> Transfer-Encoding: chunked
> Connection: keep-alive
>
> {
>    "data" : {
>       "currencies" : [
>          {
>             "code" : "USD",
>             "id" : "1"
>          },
>          {
>             "code" : "RUB",
>             "id" : "2"
>          },
>          {
>             "code" : "EUR",
>             "id" : "3"
>          }
>       ],
>       "dimensions" : {
>          "date" : {
>             "index" : 1,
>             "title" : "Date",
>             "type" : "date"
>          },
>          "page_level" : {
>             "index" : 2,
>             "title" : "Product level",
>             "type" : "categories"
>          }
>       },
>       "is_last_page" : true,
>       "measures" : {
>          "fillrate" : {
>             "index" : 6,
>             "title" : "Fill rate of ad units accounting for viewability check",
>             "type" : "percent",
>             "unit" : "percent"
>          },
>          "hits" : {
>             "index" : 5,
>             "title" : "Ad requests in ad units",
>             "type" : "number",
>             "unit" : "count"
>          },
>          "hits_render" : {
>             "index" : 4,
>             "title" : "Ads rendered in ad units",
>             "type" : "number",
>             "unit" : "count"
>          },
>          "shows" : {
>             "index" : 3,
>             "title" : "Impressions in ad units",
>             "type" : "number",
>             "unit" : "count"
>          }
>       },
>       "periods" : [
>          [
>             "2020-12-01",
>             "2020-12-15"
>          ]
>       ],
>       "points" : [
>          {
>             "dimensions" : {
>                "date" : [
>                   "2020-12-15"
>                ],
>                "page_level" : "Content platforms"
>             },
>             "measures" : [
>                {
>                   "fillrate" : 50,
>                   "hits" : 2,
>                   "hits_render" : 2,
>                   "shows" : 1
>                }
>             ]
>          },
>          {
>             "dimensions" : {
>                "date" : [
>                   "2020-12-02"
>                ],
>                "page_level" : "Content platforms"
>             },
>             "measures" : [
>                {
>                   "fillrate" : 0,
>                   "hits" : 0,
>                   "hits_render" : 0,
>                   "shows" : 0
>                }
>             ]
>          },
>          {
>             "dimensions" : {
>                "date" : [
>                   "2020-12-11"
>                ],
>                "page_level" : "Content platforms"
>             },
>             "measures" : [
>                {
>                   "fillrate" : 16.9291338582677,
>                   "hits" : 254,
>                   "hits_render" : 254,
>                   "shows" : 43
>                }
>             ]
>          },
>          {
>             "dimensions" : {
>                "date" : [
>                   "2020-12-14"
>                ],
>                "page_level" : "Content platforms"
>             },
>             "measures" : [
>                {
>                   "fillrate" : 0,
>                   "hits" : 0,
>                   "hits_render" : 0,
>                   "shows" : 0
>                }
>             ]
>          },
>          {
>             "dimensions" : {
>                "date" : [
>                   "2020-12-08"
>                ],
>                "page_level" : "Content platforms"
>             },
>             "measures" : [
>                {
>                   "fillrate" : 0,
>                   "hits" : 0,
>                   "hits_render" : 0,
>                   "shows" : 0
>                }
>             ]
>          }
>       ],
>       "report_title" : "Report for the period from 01.12.2020 to 15.12.2020",
>       "total_rows" : 5,
>       "totals" : {
>          "2" : [
>             {
>                "fillrate" : 17.1875,
>                "hits" : 256,
>                "hits_render" : 256,
>                "shows" : 44
>             }
>          ]
@@ -477,77 +463,78 @@
> ```

[*lang]: Response language. Required in all requests.

[*pretty]: Formats the results for readability. Allowed value: `pretty=1`.

[*period]: The time period to get a report for. Acceptable values:
 
  - `today`: Statistics for today.
  - `yesterday`: Statistics for yesterday.
  - `thismonth`: Statistics for the current month.
  - `lastmonth`: Statistics for the previous month.
  - `30days`: Statistics for the last 30 days (including the current day).
  - `90days`: Statistics for the last 90 days (including the current day).
  - `180days`: Statistics for the last 180 days (including the current day).
  - `365days`: Statistics for the last 365 days (including the current day).
  - `thisyear`: Statistics for the current year (including the current day).

[*field]: Identifier of a field to include in the report. These are usually various indicators, such as ad impressions in blocks or ad requests in blocks. To get a list of such fields, see the `fields` structure for the [Statistics tree](https://yandex.com/dev/partner-statistics/doc/en/reference/statistics-tree2.md) resource.
 
{% note info %}
 
To add multiple fields to the report, specify the parameter multiple times:
 
```no-highlight
field=shows&field=hits
```
 
{% endnote %}


[*limits]: Pagination. Format:
 
```no-highlight
{"limit":50,"offset":0}
```

[*dimension_field]: ID of the field to be used for grouping (for example, grouping by day or by week). To get a list of such fields, see the `dimension_fields` structure for the [Statistics tree](https://yandex.com/dev/partner-statistics/doc/en/reference/statistics-tree2.md) resource.

[*entity_field]: ID of the field that will be used for grouping by the values of this field in the report (for example, the site domain and name). To get a list of such fields, see the `entity_fields` structure, [Statistics tree](https://yandex.com/dev/partner-statistics/doc/en/reference/statistics-tree2.md) resource.
 
{% note info %}
 
To group by multiple fields, specify the field IDs as follows:
```no-highlight
entity_field=domain&entity_field=page_id
```
 
{% endnote %}

[*filter]: Filter for building a report. As parameters, the filter uses the fields from the `entity_filter_fields` structure, [Statistics tree](https://yandex.com/dev/partner-statistics/doc/en/reference/statistics-tree2.md) resource. For more information, see [Filter fields](https://yandex.com/dev/partner-statistics/doc/en/reference/report.md#filters).

[*order_by]: Sorting the results. Format:
 
```no-highlight
[{"field":"date","dir":"asc"}]
```
 
For the `field` parameter value, you can add the ID of the field to be used for grouping (a list of such fields is output in the `dimension_fields` structure for the [Statistics tree](https://yandex.com/dev/partner-statistics/doc/en/reference/statistics-tree2.md) resource). As the `dir` parameter value, you can use `asc/desc` to sort values in ascending/descending order.

[*vat]: Include or exclude VAT.

[*stat_type]: Report type. Acceptable values:
 
  - `stat_type=mm`: Mobile Mediation report.
  - `stat_type=dsp`: DSP report.
  - `stat_type=ssp`: SSP report.
  - `stat_type=main`: Report on basic statistics. Default value.

[*currency]: Report currency. Acceptable values:
 
  - `USD`: US dollars
  - `EUR`: Euro.
  - `RUB`: Rubles Default value.

[*a]: Required parameter.

[*timezone]: Additional parameter for retrieving statistics in the specified time zone. By default, statistics are based on Moscow time (`Europe/Moscow`, UTC+03:00).
