This R package implements methods for querying SEO and SEM data from SEMrush using its API. This API uses a basic authentication with an API key. NB : To get this API key, you need to have a SEMrush Business plan.
The script is explained step by step on my blog post "Guide complet de l’API de SEMrush avec R (package) (French)"
#CRAN R (official version)
install.packages("SEMrushR")
#Github (dev version)
devtools::install_github("remibacha/SEMrushR")
Get your SEMrush API key (you will have to replace the "xxxxxxxxxxxxxxxxxxx" in above examples with it) and load the SEMrushR package :
library(SEMrushR)
This function provides an extended list of related keywords, synonyms, and variations relevant to a queried term in a chosen database.
related_keywords("frank ocean","fr",10,"xxxxxxxxxxxxxxxxxxx")
This function provides a list of phrase matches and alternate search queries, including particular keywords or keyword expressions.provides an extended list of related keywords, synonyms, and variations relevant to a queried term in a chosen database.
phrase_match_keywords("kanye west","fr",10,"xxxxxxxxxxxxxxxxxxx")
This function provides a summary of a keyword, including its volume, CPC, competition, and the number of results in all regional databases.
keyword_overview_all("tyler the creator","fr","xxxxxxxxxxxxxxxxxxx")
This function lists domains that are ranking in Google top 20 organic search results with a requested keyword.
organic_results("travis scott","fr",100,"xxxxxxxxxxxxxxxxxxx")
This function provides a list of both phrase matches and related keywords to a queried term in a chosen database.
semrush_keywords("asap rocky","fr",20,"xxxxxxxxxxxxxxxxxxx")
Questions and feedbacks welcome!
You want to contribute ? Open a pull request ;-) If you encounter a bug or want to suggest an enhancement, please open an issue.