The aim of serpstatr is to provide a wrapper for the latest version of Serpstat API. The main purpose of this API is automation of common SEO and PPC tasks like keywords research and competitors analysis in Google.
All package functions names have the same structure:
Get your API key. It is required in all package functions.
Search analytics
Check if you have enough limits to make API calls
api_token <- Sys.getenv('SERPSTAT_API_TOKEN')
sst_sa_stats(api_token)$summary_info$left_lines
Get database ID to make requests:
sst_sa_database_info(api_token)$data
Call functions to get keywords data:
sst_sa_keywords_info(
api_token = api_token,
keywords = c('seo', 'ppc', 'serpstat'),
se = 'g_us',
sort = list(cost = 'asc'),
return_method = 'df'
)$data
Call functions to get the data on your rankings:
sst_rt_positions_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'),
url = 'serpstat.com',
sort = 'keyword',
order = 'desc',
page = 1,
size = 100,
return_method = 'list'
)$data$keywords
Call functions to get the data on the backlinks:
sst_bl_domain_summary(
api_token = api_token,
domain = 'serpstat.com',
search_type = 'domain',
return_method = 'list'
)$data
To get the current development version from GitLab:
devtools::install_gitlab('alexdanilin/serpstatr')
Send all issues on GitLab page.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.