traffic_analytics_reports: Request SEMRush Overview Reports

Description Usage Arguments Value

View source: R/traffic_analytics_reports.R

Description

This function creates a request to the SEMRush SEO database for users with a subscription and sufficient API units. See the SEMRush API website (https://www.semrush.com/api-analytics/) for additional information, including a list of codes for the regional databases and export variables.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
traffic_analytics_reports(
  type,
  key,
  domain,
  domains,
  channel_type,
  device_type,
  display_offset,
  display_limit,
  country,
  display_date,
  export_columns,
  return_url = FALSE
)

Arguments

type

string. The report type to be generated. Available report types are 'traffic_summary','traffic_sources','traffic_destinations','traffic_geo', or 'traffic_subdomains'.

key

string. An identification key assigned to a user after subscribing to SEMrush. The key is available on the Profile page.

domain

string. The unique name of a domain that you want to analyze (example.com).

domains

vector. A vector of character strings where each element is a unique name of a domain you would like to investigate [c("example-1.com","example-2.com",...)].

channel_type

string. The traffic channel filter. This parameter allows you to filter traffic sources by a specific channel type. If the channel type is not specified, data for all channels will be shown by default. Options are 'direct','referral','search','social', or 'paid'.

device_type

string. The device filter. This parameter allows you to choose whether to retrieve desktop or mobile data, or both. If the device filter is not specified, data for all devices will be shown by default. Options are 'all', 'desktop', or 'mobile'.

display_offset

integer. This parameter allows you to skip a specified number of results before sending a report. Please keep in mind that if you use the option display_offset, display_limit, the value should be increased by value display_offset.

display_limit

integer. The number of results returned to a request. If this parameter is set to 0, up to 10,000 lines will be returned. Default is 5 lines.

country

string. The country code parameter ("XX") allows you to filter traffic data for a particular country. If the parameter is not specified, global data is shown by default.

display_date

string. Date in format "YYYYMM15". A date on which a report will be shown. You can roll back to the past or choose an actual date.

export_columns

vector. A vector of character strings specifying the variables to be included in the report, which vary according to the report type (see 'type' argument). If this parameter is not specified, default columns will be sent.

return_url

logical. If TRUE, prints the request URL used to generate the report. Default value is FALSE.

Value

A data table (tibble) with columns for each requested variable.


ericvc/semRush documentation built on Aug. 7, 2020, 12:54 p.m.