rym v0.5.1


Monthly downloads



R Interface to Yandex Metrica API

Allows work with 'Management API' for load counters, segments, filters, user permissions and goals list from Yandex Metrica, 'Reporting API' allows you to get information about the statistics of site visits and other data without using the web interface, 'Logs API' allows to receive non-aggregated data and 'Compatible with Google Analytics Core Reporting API v3' allows receive information about site traffic and other data using field names from Google Analytics Core API. For more information see official documents <https://tech.yandex.ru/metrika/doc/api2/concept/about-docpage/>.





Information for russian language users

Russian manuals ypu can find here

rym package

rym is an R interface to Yamdex.Metrica API.

rym work with next API:

  1. Management API - allows you to get tables with such objects as Yandex.Metrics sufficient counters, a list of configured goals, filters and segments, as well as a list of users who have access to the counter.
  2. API ќтчЄтов - allows you to receive information on the statistics of site visits and other data without using the Yandex.Metrica interface.
  3. API совместимый с Core API Google Analytics (v3) - allows you to query statistics using the names of the fields are the same as when working with Core Reporting API v3.
  4. Logs API - allows you to get raw, ungrouped data about your visit to your site from Yandex.Metrica.


CRAN: install.packages('rym') GitHub: devtools::install_github("selesnow/rym")

rym vignettes

You can read vignette @Intro to rym by run next code: vignette('intro-to-rym', package = 'rym')

Code example

# auth
rym_auth(login = "vipman.netpeak", token.path = "metrica_token")
rym_auth(login = "selesnow", token.path = "metrica_token")

# ManagementAPI
# получить список сч™тчиков
selesnow.counters <- rym_get_counters(login      = "selesnow",
                                      token.path = "metrica_token")

vipman.counters   <- rym_get_counters(login      = "vipman.netpeak",
                                      token.path = "metrica_token")

# get goals list
my_goals <- rym_get_goals(counter = 10595804,
                          login      = "vipman.netpeak",
                          token.path = "metrica_token")

# пget filter list
my_filter <- rym_get_filters(counter = 10595804,
                             login      = "vipman.netpeak",
                             token.path = "metrica_token")

# get segment list
my_segments <- rym_get_segments(counter = 10595804,
                                login      = "vipman.netpeak",
                                token.path = "metrica_token")

# get counter list
users <- rym_users_grants(counter = 10595804,
                          login      = "vipman.netpeak",
                          token.path = "metrica_token")

# Reporting API
reporting.api.stat <- rym_get_data(counters   = "23660530,10595804",
                                   date.from  = "2018-08-01",
                                   date.to    = "yesterday",
                                   dimensions = "ym:s:date,ym:s:lastTrafficSource",
                                   metrics    = "ym:s:visits,ym:s:pageviews,ym:s:users",
                                   sort       = "-ym:s:date",
                                   login      = "vipman.netpeak",
                                   token.path = "metrica_token",
                                   lang = "en")

# Logs API
logs.api.stat      <- rym_get_logs(counter    = 23660530,
                                   date.from  = "2018-08-01",
                                   date.to    = "2018-08-05",
                                   fields     = "ym:s:date,
                                   source     = "visits",
                                   login      = "vipman.netpeak",
                                   token.path = "metrica_token")

# API compatible with Core API Google Analytics v3
ga.api.stat        <- rym_get_ga(counter    = "ga:22584910",
                                 dimensions = "ga:date,ga:source",
                                 metrics    = "ga:sessions,ga:users",
                                 start.date = "2018-08-01",
                                 end.date   = "2018-08-05",
                                 sort       = "-ga:date",
                                 login      = "selesnow",
                                 token.path = "metrica_token")

Functions in rym

Name Description
rym_get_ga Work with 'compatible with the Google Analytics Core Reporting API (v3)'
rym_get_goals List of goals
rym_get_direct_clients Load Yandex.Direct clients
rym_get_filters List of filters
rym_get_logs Get raw data from yandex metrika.
rym_get_segments List of segments
rym-package rym
rym_auth Authentication in Yandex Metrika API
rym_users_grants List of users permissions
rym_get_counters Load Yandex Metrica counters
rym_get_data Load data by compatible with the 'Google Analytics Core Reporting API'
No Results!

Vignettes of rym

No Results!

Last month downloads


Type Package
Date 2019-01-17
BugReports https://github.com/selesnow/rym/issues
VignetteBuilder knitr
License GPL-2
URL http://selesnow.github.io/rym
Encoding UTF-8
Language ru
NeedsCompilation no
Packaged 2019-01-17 13:23:42 UTC; Alsey
Repository CRAN
Date/Publication 2019-01-17 13:40:03 UTC

Include our badge in your README