List of filters

Attention.

Access tokens will not be accepted in URL parameters starting February 13, 2019. To continue working with the Yandex.Metrica API, set up authorization by passing the token in the HTTP header.

The outdated authorization method will be temporarily disabled on January 23, January 30, and February 6 for maintenance. Authorization using URL parameters will be unavailable on these dates.

Returns information about counter filters.

  1. Request syntax
  2. Response format

Request syntax

counterId — counter ID, the information about the filters which you want to get.

https://api-metrica.yandex.net/management/v1/counter/{counterId}/filters
 ? [callback=<string>]
Query parameters
callbackCallback function which returns an API response.

Response format


{
    "filters" : [ {
        "id" :  < int > ,
        "attr" :  < filter_attribute > ,
        "type" :  < filter_type > ,
        "value" :  < string > ,
        "action" :  < filter_action > ,
        "status" :  < filter_status > ,
        "start_ip" :  < string > ,
        "end_ip" :  < string > ,
        "with_subdomains" :  < boolean > 
    }, ... ]
}
ParametersDescription
filtersCounter filter.
filters
id

Filter ID. Specify this parameter when changing a counter filter

attrType of data, to which a filter is applied.

Possible values:

  • referer — referrer;
  • uniq_id — special filter attribute “don't factor in my sessions”.
  • client_ip — IP-address;
  • title — page title;
  • url — page URL;
typeFilter type or action for filter.

Possible values:

  • equal — equals;
  • contain — contains;
  • me — my visits, used only with the type of data attr = uniq_id;
  • start — begins with;
  • interval — in the interval, is used only with data type “IP-address” (attr = client_ip);
  • only_mirrors — only site and mirrors, used only for data type “page URL” (attr = url) and filter type “only record traffic” (action = include), as well as when mirrors are specified for the counter.
valueFilter value.
actionFilter type.

Possible values:

  • include — keep traffic only.
  • exclude — exclude traffic;
statusFilter status.

Possible values:

  • active — filter is used;
  • disabled — filter disabled (without deletion).
start_ipFirst IP-address range.
end_ipLast IP-address of range.
with_subdomainsFilter by subdomains.