Start Exploring Keyword Ideas

Use Serpstat to find the best keywords for your website

4737 80
SEO 13 min read September 26, 2022

Brilliant Ways to Automate SEO Routine Using Serpstat for R: SEO Dashboard

Brilliant Ways to Automate SEO Routine Using Serpstat for R: SEO Dashboard
Ekaterina Hordiienko
Research Editor at Serpstat
Report creation and updating can consume up to 25% of your weekly working time if you operate with multiple sites or clients' projects. Find out how to make a customized dashboard and save one week in a month with the Serpstat package for R.

How to use Serpstat package for R?

R is a programming language mainly focused on data analysis. Using the advantages of programming, you can request API data in batches, which can help process numerous keywords or check the quality of multiple domains at once. R is free to use, well documented, and capable of creating almost any type of publication-ready graphs. Deep analysis helps you to make further decisions about your expansion, especially with large-scale businesses.

You can find the primary documentation here. The easiest way to run R code is to use Google Colab. So we will use it here as a development environment.
Install the serpstatr package using install.packages("serpstatr"). Then, load the library:
All package function names have the same structure: each function name starts with sst_ prefix followed by Serpstat modules prefix (for example, sa_ for Search Analytics, rt_ for the Rank Tracker), followed by a self-explanatory function name.
Copy your API key from the profile page. The API key is a unique identifier that authenticates requests associated with your profile for billing purposes. Please, note that your token is sensitive information. If you accidentally shared your API key with a third person, you should revoke the old one and generate a new one by pressing the "Refresh API token" button on your profile page.
We highly recommend storing your API token as an environment variable and calling it using Sys.getenv() built in R function. The API key won't be exposed if you share your code with someone. Believe me, it is a common case to evidently share API tokens while presenting some slides with screenshots or any kind of public speaking. Please keep this in mind before using the sensitive data in your code like this:
Variables on R
Thy to call sst_sa_database_info ('your token', return_method = "list") method to get a list of all available regions:
Results by the search databases
If everything is correct, you will see the results.

R wrapper for your dashboard

Solving fundamental issues for a small website is not difficult if you have quality SEO tools. If you work with multiple sites and analyze a lot of data, you must find ways to save time on data collection and visualization. At this point, you may consider implementing API advantages into your process.

A dashboard is a great way to look at overall website performance. Instead of spending hours analyzing data in multiple reports, you can easily track the keywords and positions of your website. If you're a business owner, you can track all SEO changes and paid campaigns' effectiveness.

An informative panel is also a quick way for SEOs to keep track of the overall progress throughout the year, creating one for each project. This way, you can keep track of the numbers for each search database (like and Additionally, you can visualize data for further analysis.
You can create a dashboard in three steps:
Collect and clean data from the Serpstat report.
Structure your data on the dashboard.
Add a visualization and plots.
The first section we will add to our dashboard shows the high-ranking URLs at the top of the SERP (Search Engine Result Page). The report Top by keyword can give you a particular idea of where to optimize. The method to reproduce this data on R is called sst_sa_keyword_top.

An example:
api_token = api_token,
keyword = 'tiktok',
se = 'g_us',
top_size = 10
The output with URLs in the top
The first domain report you can use to get valuable metrics from your website is sst_sa_domains_info or Domains summary. Multiple domains can be input into this batch method. The domains’ info returns the keywords in the top 20 for each domain in SEO and PPC, the number of search queries, the new keywords' quantity, out-of-the-top and raised keywords, online visibility, SEO traffic, and other metrics.

An example:
api_token <- Sys.getenv('SERPSTAT_API_TOKEN')
api_token = api_token,
domains = c('', ''),
se = 'g_us',
return_method = 'df'
The output with the domain info

Another element you can add to your new dashboard is sst_sa_domain_keywords or Domain organic keywords. This method returns up to 60 000 organic keywords from a selected region for the domain, with metrics for each keyword. To include or exclude some keywords, you can use the filtering parameters.

For example:
url = '',
keywords = list('google'),
minusKeywords = list('update'),
Here is an example of a method in action:
Domain's organic keywords
The following method is sst_bl_referring_domains or Referring domains, which returns the list of referring domains with main backlinks' metrics for a domain, for example, domain authority — SDR (Serpstat Domain Rank).
api_token = api_token,
domain = '',
page = 1,
size = 100,
sort = 'domain_rank',
order = 'desc',
filter = NULL,
return_method = 'list'
Referring domains
This information will be extremely helpful for your link-building strategy to find high-quality referring domains via competitor analysis.

Now, we came to the sst_rt_competitors Rank tracker method. It wraps around the getTopCompetitorsDomainsHistory API method and returns the competing domains in the top 20 of SERP for your project in the Rank Tracker. Arguments required for this method are:

  • api_token;
  • project_id — the identificator of your project in Serpstat from the URL of any rank tracker report;
  • region_id — the identificatior of a region;
You can get the complete list of project regions using “sst_rt_project_regions”:
Regions available
The List of the Project's Regions
  • date_from — date string in ’YYYY-MM-DD’ format;
  • date_to — date string in ’YYYY-MM-DD’ format.
Step #1: Set the Rank tracker project id — project_id <- ‘your project id’
Step #2: Find the region you are going to use:
regions <- sst_rt_project_regions(
  api_token  = api_token, 
  project_id = project_id
regions # Check and find the region_id you want to use
Project regions
Look through the list of regions in your projects and save the region ID as a variable. I will use the second (Google, New York, desktop, organic, 328594):
region_id <- regions[[2]]$id
Step #3: In sst_rt_competitors method, properly set parameters and format results:
competitors <- sst_rt_competitors( 
  api_token  = api_token, 
  project_id = project_id, 
  region_id  = region_id, 
  date_from  = '2022-06-01',
  date_to    = '2022-07-31',
  domains    = ''
sst_rt_competitors method
The Output of the sst_rt_competitors Method
Want to speed up your search marketing growth with Serpstat?

Try the platform with free access for 7 days :)

How to work with obtained results? Charts and plots

Often, an SEO dashboard will consist of just a timeline with some basic stats on the back-end. But, over the years, these dashboards have evolved to become more complex and include various types of charts and graphs that can provide valuable insights into the key performance indicators (KPIs) of their campaigns.
Thankfully, the elaboration of the programming has made analyzing and utilizing these data much more effortless.

For the dashboard, we will use the dplyr and ggplot2 packages. The first will help us transform the data, and the second will create graphics. We will use them to show the visibility level by domain and the average position of competitors in the Rank Tracker.
Step#1: Load libraries:
Libraries for visualization
Step#2: Use sst_sa_domains_info to get data for your plots:
Data for the plots
Step#3: Plot visibility distribution:
Visibility distribution
Step #4: Use sst_rt_competitor’s data for another informative plot:
The trend on competitors
The Average Position using the Rank Tracker Data
Step#5: Add some kittens to make your workspace fabulous :)
Kittens in Colab
The code from the article can be found in Colab, where you can experiment.


You don’t need to hire a developer or become one to create your customized and actionable SEO dashboard. Using the R package from Serpstat, you can get all your data on SEO performance in a nifty way. 

All packages in R, including serpstatr, are open source. We would appreciate any suggestions you may have to improve the package or add new features. Reach us at Gitlab.
To keep up with all the news from the Serpstat blog, subscribe to our newsletter. Also, follows us on LinkedIn, Facebook, and Twitter ;)

Speed up your search marketing growth with Serpstat!

Keyword and backlink opportunities, competitors' online strategy, daily rankings and SEO-related issues.

A pack of tools for reducing your time on SEO tasks.

Get free 7-day trial

Rate the article on a five-point scale

The article has already been rated by 8 people on average 5 out of 5
Found an error? Select it and press Ctrl + Enter to tell us

Discover More SEO Tools

Backlink Cheсker

Backlinks checking for any site. Increase the power of your backlink profile


Search big data and get results using SEO API

Competitor Website Analytics

Complete analysis of competitors' websites for SEO and PPC

Keyword Rank Checker

Google Keyword Rankings Checker - gain valuable insights into your website's search engine rankings

Share this article with your friends

Are you sure?

Introducing Serpstat

Find out about the main features of the service in a convenient way for you!

Please send a request, and our specialist will offer you education options: a personal demonstration, a trial period, or materials for self-study and increasing expertise — everything for a comfortable start to work with Serpstat.




We are glad of your comment
I agree to Serpstat`s Privacy Policy.

Thank you, we have saved your new mailing settings.

Report a bug

Open support chat
mail pocket flipboard Messenger telegramm