Use Serpstat Data in R Scripts and Dashboards
The serpstatr package is a ready-to-use R API wrapper for Serpstat. Install it from CRAN and use it to pull keyword research, competitor analysis, and backlink data directly into R scripts, RMarkdown reports, and Shiny dashboards — without manual data exports.
What you can achieve:
Build automated SEO dashboards in R: Use serpstatr to feed Serpstat data into Shiny apps or RMarkdown documents that refresh automatically — without manual exports each time.
Run statistical analysis on SEO data: Pull large keyword and domain datasets into R and apply R's statistical and visualization capabilities for deeper analysis than spreadsheet tools allow.
Automate recurring competitor research: Script Serpstat competitor and keyword queries in R and schedule them to run on a regular cadence — delivering fresh data to your analysis environment without manual intervention.
Getting Started
In your R environment, install the package from CRAN:
install.packages("serpstatr").Load the package:
library(serpstatr).Go to your Serpstat account → Profile → copy your API token. API access requires the Team plan or higher.
Set your token in R:
serpstatr::sst_auth(token = "YOUR_API_TOKEN").Use serpstatr functions to query domain, keyword, or backlink data. See the package manual on CRAN (serpstatr.pdf) for the full function reference.
What You Can Query
Competitor analysis: Pull organic and paid competitor lists for any domain — use this to map the competitive landscape in R and visualize keyword overlap.
Keyword research: Retrieve keyword metrics, related keywords, and SERP data for keyword lists — process and cluster them in R for semantic analysis.
Backlink data: Access referring domain counts, backlink dynamics, and anchor data — feed into R models for link profile analysis.
Domain history: Time-series visibility and traffic data — combine with R's time-series modeling tools (forecast, prophet) for trend prediction.
Pro Tip: Automate an SEO Dashboard With Shiny and serpstatr
Shiny + serpstatr lets you build an interactive SEO monitoring app that any stakeholder can use — without them needing R or Serpstat access.
Build a Shiny app with a text input for domain and a date range selector. Use serpstatr to pull domain history on app load.
Render the visibility and traffic trends as ggplot2 charts inside the Shiny UI — responsive and interactive.
Deploy the app to shinyapps.io (free tier available) and share the URL with stakeholders. They get an always-current dashboard without touching R or Serpstat.
See the community guide "Brilliant Ways to Automate SEO Routine Using Serpstat for R: SEO Dashboard" on the Serpstat blog for a full worked example.
⚠️ Important: serpstatr requires API access, which is available from the Team plan or higher. API credits are consumed per function call. Review your remaining credits in your Serpstat profile before running large automated jobs. The CRAN package manual (serpstatr.pdf) contains the full function reference and usage examples. |
❓ Frequently Asked Questions
Q: Where is the package documentation?
A: The full serpstatr manual is available on CRAN at cran.r-project.org/web/packages/serpstatr/serpstatr.pdf. It includes all function signatures, parameters, and return value descriptions.
Q: Which R version is required?
A: serpstatr is compatible with R 3.5 and above. Install from CRAN with install.packages("serpstatr").
Q: Does the package work with RStudio?
A: Yes — serpstatr works in any R environment including RStudio, RMarkdown, Shiny, and command-line R. It has no IDE-specific dependencies.
Next Steps
Keyword Lists — Collect and prepare keyword data in Serpstat before processing it in R.
Site Analysis — Overview — Understand the domain and competitor data you can pull via serpstatr.
Backlink Dashboard — Explore the backlink data available for R-based analysis via the Serpstat API.