sst_rt_serp_history: Get search results history in search region by keywords

Description Usage Arguments Value API rows consumption Examples

View source: R/rank_tracker.R

Description

This method method returns top 100 search results in Google and top 50 search results in Yandex by region and project keywords.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sst_rt_serp_history(
  api_token,
  project_id,
  region_id,
  date_from,
  date_to,
  keywords,
  sort = "keyword",
  order = "desc",
  page = 1,
  size = 100,
  return_method = "list"
)

Arguments

api_token

(required) Serpstat API token from your profile.

project_id

(required) The ID of your project in Serpstat. You can find this ID in the URL of any rank tracker report. As an example, in https://serpstat.com/rank-tracker/keywords/12345/positions?get_params the ID would be 12345.

region_id

(required) The ID of a region returned by sst_rt_project_regions.

date_from

(optional) The date string in 'YYYY-MM-DD' format to specify the initial date of retrieved data.

date_to

(optional) The date string in 'YYYY-MM-DD' format to specify the final date of retrieved data. Must not exceed date_from + 30 days.

keywords

(optional) A vector of keywords for witch the data should be retrieved. Maximum 1000 keywords per request.

sort

(optional) Must be one of 'keyword' (default) to sort the results alphabetically or 'date' to sort the results by date.

order

(optional) The sorting order. Must be one of string 'desc' (default) for descending sorting or 'asc' for ascending sorting.

page

(optional) Page number if there are many pages in response. The default value is 1.

size

(optional) Page size. Must be one of 20, 50, 100, 200, 500.The default value is 100.

return_method

(optional) Accepted values are 'list' (default) to return data object as list or 'df' to return data object as data.frame.

Value

Returns the search engine results for specific dates and region including positions and URLs.

API rows consumption

0

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
api_token  <- 'api_token'
project_id <- 12345
region_id  <- sst_rt_project_regions(
  api_token  = api_token,
  project_id = project_id
  )$data$regions[[1]]$id
sst_rt_serp_history(
  api_token     = api_token,
  project_id    = project_id,
  region_id     = region_id,
  date_from     = '2020-12-01',
  date_to       = '2020-12-30',
  keywords      = c('seo', 'ppc', 'serpstat'),
  sort          = 'keyword',
  order         = 'desc',
  page          = 1,
  size          = 100,
  return_method = 'list'
)

## End(Not run)

serpstatr documentation built on Jan. 11, 2021, 1:36 a.m.