What Is an API?
Software Programming Interface (API) is a technique of gathering uncooked knowledge from Semrush with out utilizing the usual web site interface.
If the Semrush interface is like strolling by a grocery retailer to pick your groceries by hand; an API is like ordering your groceries in bulk from a same-day drone supply.
Pulling knowledge by way of an API could be automated, so it is a superb resolution for gathering huge units of knowledge effectively.
You may get knowledge quicker than through the use of the interface and use it to combine Semrush knowledge into your dashboards and different software program.
Frequent makes use of of APIs embrace:
-
Customized dashboards for a digital company’s purchasers
-
Inside firm dashboards for eCommerce, funding corporations, and so on.
-
Re-selling Semrush knowledge by a software program service
-
Gathering large units of knowledge at a quicker fee in comparison with utilizing the Semrush interface (wonderful for intensive key phrase analysis or massive Place Monitoring campaigns)
-
Pulling site visitors knowledge on your entire opponents in a single report
What’s the catch? Effectively, in case you are unfamiliar with APIs, it may be a bit technical.
However, for those who or a teammate or coworker of yours has expertise with an API, the Semrush API must be comparatively straightforward to select up.
This publish is for introducing the fundamentals of APIs and the way they are often helpful. We’ll get into the specifics of Semrush APIs as effectively. For an inventory of all of our calls, parameters, and technical particulars, please find (and bookmark!) the Semrush API Documentation.
Who Are APIs for?
An API can be utilized for an infinite variety of functions. Anybody that may program scripts with API and has the necessity to collect digital advertising knowledge could make use of it.
Specifically, Semrush’s API is standard amongst digital companies, knowledge scientists, analysis corporations, SaaS software program builders, enterprise capitalists, and re-sellers of Semrush knowledge.
How Does an API Work?
An API operates primarily based on a easy name and response. The weather of an API name (defined additional under on this publish) create an HTTP handle and embrace parameters (separated by the “&” image) for the precise report you might be requesting, the database, question, any filters, and naturally, your API key.
Turning the Uncooked Knowledge into One thing Tangible
To make use of an API successfully would require somebody aware of net improvement to create a script or an identical program that may automate the reception and integration of knowledge.
In pc science, a script is a doc written in a dynamic programming language (widespread languages embrace Python, Perl, Powershell, Tcl) that ship directions to pc packages to automate duties.
With a script, you possibly can work with our API calls to show the .CSV or JSON output into one thing readable like a spreadsheet or dashboard.
Internet builders can write scripts to take uncooked knowledge from the Semrush API and combine it into readable tables, dashboards, studies, and interfaces.
Under I’ll speak concerning the totally different APIs provided on Semrush and present an instance of how a script can pull this knowledge and combine it right into a spreadsheet.
In case you are involved in buying a script that works with an API from us, you possibly can contact us by cellphone or e mail or from the Customized Report web page right here.
What APIs Does Semrush Provide?
Semrush affords two primary API packages:
- Commonplace Semrush API, which incorporates:
- Analytics API (Area Analytics and Key phrase Analysis)
- Tasks API (Website Audit, Place Monitoring, and Mission Administration)
- Developments API (a separate API for Site visitors Analytics knowledge, launched in 2019)
How Can You Get It?
To make use of our Analytics API and Tasks API, that you must:
-
Subscribe to the Enterprise Semrush plan
-
Buy the API bundle and the variety of API items that can suit your wants
To make use ofSemrush Developments API, you first must have a Semrush subscription plan (it doesn’t should be a Marketing strategy). The Developments API is available in two kinds: Primary and Prolonged.
- The Developments Primary API allows you to collect knowledge from the Site visitors & Market Site visitors Overview report.
- Site visitors Knowledge
- Month-to-month Visits
- Distinctive Visits
- Pages Per Go to
- Common Go to Length
- Cell vs. Desktop
- Bounce Charges
- Developments Premium API gathers knowledge from the extra in-depth dashboards from the Site visitors & Market Toolkit. In consists of all the things from the Developments Primary API, in addition to:
- Each day Site visitors
- Weekly Site visitors
- Buy Conversion
- Business Classes
- Site visitors Sources
- Site visitors Locations
- Subdomain Site visitors
- Subfolder Site visitors
- Geographic Distribution
- High Pages
- Site visitors Rank
- Viewers Insights
- Age and Intercourse Distribution
- Family Measurement, Earnings, Schooling, and Occupation distributions
- Viewers Pursuits
- Social Media Preferences
For extra particulars, please be at liberty to confer with Developments API documentation
You’ll be able to add a Developments API to your plan instantly out of your Subscription Data web page or you possibly can attain out to our gross sales staff. We’ll make it easier to determine what number of API items you want and give you your API key.
Your API key could be discovered within the API items tab of the Subscription Data web page.

Setting up an API Name
To obtain knowledge by way of Analytics API, that you must construct an API name (often known as a request).
An API name is a request despatched to the server for knowledge from the Semrush database.
The API name is constructed by combining parameters to outline the info that you just need to obtain. Parameters embrace the kind of report, your API key, the area you might be querying, the database, show date, export columns, filters, and extra.
Under is a color-coded breakdown of a Area Overview API name for seobook.com (US database) with 8 columns.

The parameters on this name are as follows:

Discover the show date is about to January 2018, making this a name for historic knowledge (20180115 represents January 2018 in YYYYMM15 format). Since this name is in our Analytics database, the info will characterize a month-to-month determine. Due to this fact, 15 is only a placeholder to make use of for the day in the usual YYYYMMDD format.
Utilizing Tasks API, in case you are pulling knowledge from a Place Monitoring undertaking, you possibly can specify a single date to drag the info for.
The parameters and variety of traces included in every name will decide the price of the decision in API items. A name that asks for six columns of knowledge for 100 domains will price ten occasions the quantity of items in comparison with a name asking for a similar six columns of knowledge for ten domains.
Examples of all parameters, columns, filters, sorting, and databases can all be discovered within the API Documentation.
Column names, for instance, could be discovered within the “Columns” part of the API Documentation.

Along with the fundamental parameters, there are additionally parameters for including filters, sorting by metrics, and setting a show restrict to the variety of traces the decision will return. All of those parameters could be discovered within the menu on the API documentation.
API Output
After constructing your API name (or request) and sending it to our server, Semrush will return uncooked knowledge with the column headers and the info. In case you kind the decision right into a browser’s handle bar, for instance, it is going to return the uncooked knowledge within the browser and seem like this:

This response is 1 line as a result of it’s only reporting knowledge for 1 area.
This output is technically a .CSV file. The outputs of our APIs are:
-
Analytics API: .CSV
-
Developments API: .CSV
-
Tasks API: JSON
-
Accounts API: .CSV
Half 1: Analytics API
Now, what could be performed with the Analytics API? This API can be utilized to drag studies on area analytics, aggressive analysis, key phrase analysis, backlinks, promoting analysis, and extra.
These are the traditional studies on Semrush used to check the search positions and on-line visibility of your opponents or business. If aggressive analysis is part of your workflow, utilizing API will speed up the method.
For gathering whole web site site visitors estimations (not simply site visitors from search), you’ll need to look into theDevelopments API. The Site visitors & Market Site visitors toolkit affords a breakdown of site visitors from search, social, direct, paid, and referral, along with whole month-to-month visits, time on web page, bounce fee, pages/session, and extra.
Utilizing a Script with Analytics API
Now, for those who had a script that would course of API calls right into a formatted desk, you can make queries in bulk and get super-fast outcomes. For instance, for those who had an inventory of ten domains like this:

You may use a script to investigate all the things listed within the spreadsheet. Pictured under is a bit of a script written to drag knowledge by the Semrush API and import the traces to a clear spreadsheet on the pc’s desktop.
Discover on the finish of the GIF the time it took to make this name was roughly 1.3 seconds. Now, the file could be discovered on the desktop.
These are the fundamentals of API. In fact, our instance solely confirmed the method with 10 domains, and it took one second. You need to use an identical course of to drag knowledge on tons of of hundreds of domains in solely minutes.
To familiarize yourselves with our API language and format a name, builders must learn our API documentation.
Half 2: Tasks API
The Tasks API permits customers to create, edit, and handle tasks utilizing the Website Audit and Place Monitoring instruments.
You’ll be able to pull studies from present tasks or create a brand new undertaking and configure it with an API name. As a result of the interface makes it straightforward to configure a Mission with particular settings, folks will generally create their Tasks within the interface after which use API to drag the info.
Please word: Tasks API shares API items with Analytics API. Nonetheless, Developments API is separate from Analytics and Tasks and doesn’t use API items.
Place Monitoring can observe you and your opponents’ key phrase rankings and uncover native opponents. Our Website Audit instrument will crawl a web site and give you an in depth checklist of points on the location that you could repair to enhance its search engine optimisation.
These two instruments are particularly nice for shopper reporting. They will present overview metrics like the final well being rating of a web site (Website Audit) and visibility throughout goal key phrases (Place Monitoring). For that reason, the Tasks API is a good resolution for automating client-facing or inner dashboards.
One other nice purpose to make use of Tasks API is for the velocity. In comparison with the interface, the API will be capable of export knowledge from massive Tasks at a extra environment friendly fee.
Under is an instance of how it could look utilizing a script to drag knowledge from an present Mission right into a easy spreadsheet.
Utilizing a Script for Tasks API
First, let’s say we’ve got a Place Monitoring marketing campaign on Semrush. The area is ebay.com, and it’s monitoring 81 key phrases and 20 opponents. The Mission ID (discovered within the URL) is 1565219.

Here’s a script that’s formatted to GET the info from the present Place Monitoring Mission.
Observe how the script solely took six seconds (Time—0:00:06.3727)to export hundreds of rows of knowledge. Under is the spreadsheet that the script created—the entire key phrases within the marketing campaign together with the competitor’s rating pages.
SERP Options Codes
In case you are pulling knowledge from a Place Monitoring marketing campaign, you will notice a column for the SERP Options that the tracked area ranks for. The SERP Options codes as they seem in API are as follows:
-
fsn: Featured snippet
-
geo: Native pack
-
rev: Critiques
-
stl: Website hyperlinks
-
vid: Video
-
vib: Featured video
-
new: High tales
-
rel: Folks additionally ask
-
img: Photos
-
twt: Twitter
-
knw: Immediate reply
-
kng: Data panel
-
shp: Buying advertisements
-
adt: AdWords high
-
adb: AdWords backside
Technical Particulars—Tasks API
Not like the Analytics API, all Mission API requests function by the next HTTP instructions:
POST: Ship a POST name to create one thing new, e.g., create a brand new undertaking, allow Place Monitoring/Website Audit instrument.
PUT: Ship a PUT name once you need to make some modifications to your present tasks, e.g., change the key phrases or opponents in Place Monitoring, change the crawled web page restrict.
GET: Ship a GET name to drag some studies of present tasks, e.g., every day natural place report, problems with a website audit marketing campaign.
DELETE: Ship a DELETE name to delete something present, e.g., delete an present undertaking, delete key phrases from an present undertaking.
Half 3: Developments API
The opposite API that’s separate from any Semrush subscription is the Developments API. It permits you to collect site visitors estimations for a web site. With the velocity of API, you possibly can analysis this knowledge extra effectively.
Developments API doesn’t come as part of the primary Semrush API. It needs to be bought individually from any Semrush subscription, or along with any subscription.
Please word that we provide two variations of this API:
- Primary API: Site visitors Overview dashboard
- Premium API: Site visitors Overview report, Site visitors Sources, Site visitors Locations, Geographic Distribution, and Subdomains
This API can combine seamlessly with software program like Google Sheets, Excel, Salesforce, Tableau, Energy BI, and extra.
Developments API Knowledge Use Circumstances
Some examples of how you can use this API embrace:
-
Qualifying new leads
-
Evaluating new markets
-
Enhancing an present SaaS providing with site visitors knowledge
-
Offering knowledge on prospects to your gross sales staff
-
Evaluating new enterprise companions and prospects
To qualify new leads, you can take your checklist of domains and pull all of their Site visitors Overview knowledge to see which leads have the very best web site engagement and which web sites present weak engagement from their guests. The leads with the worst engagement may very well be the most effective locations to begin in case you are pitching web site companies.
To consider a brand new market, you can collect an inventory of domains available in the market you need to study, after which make an API name to drag their site visitors knowledge. An Overview name would let you see the typical qualities of the market, equivalent to web site visits, cell vs. desktop site visitors, time on web page, pages per session, and extra.
In case you already provide a SaaS platform for folks to check web sites or companies, including Semrush Site visitors & Market knowledge to your providing would give highly effective insights into this enterprise’s on-line presence—excellent knowledge for aggressive evaluation.
The Developments API may additionally combine with a gross sales prospecting software program to provide your gross sales staff further data about every alternative. Which suggests they’ll all the time carry knowledge to their gross sales pitch.
If that you must consider new enterprise companions and prospects, this API may combine along with your present info and supply perception into their strengths and weaknesses on-line.
Utilizing Developments API with a Script
Once more, this API can simply combine right into a script. Let’s take the next ten domains from a spreadsheet:

Use a script to drag the info:
And the ensuing data on these domains populates into this spreadsheet:
Calculating API Models Utilization
As you intend your Analytics and Tasks API calls, you will want to estimate what number of API items you’ll be spending.
Consider: Developments API doesn’t use API items, and due to this fact you received’t must calculate items, and Accounts API calls are free. Calculating API Models is just related for Analytics and Tasks API calls.
Every Analytics and Tasks name has its personal value, and for historic knowledge, the value will go up. The API documentation will let you know the value in items per line of every name.

To estimate your price range, you will want to estimate just a few issues:
-
If the API is getting used internally or externally
-
What sort of knowledge is getting used (which studies you’ll use & if you’d like dwell or historic knowledge)
-
How a lot knowledge you will want (what number of calls you’ll be making each month)
To calculate the price of a name, you would wish to multiply the price per line by the variety of traces within the name.
What’s a line?
Effectively, for those who consider the response as a .csv file, every row of knowledge within the response is a line. Every line may characterize metrics for a specific key phrase, area, or URL relying in your report. Observe within the picture under how the decision has a display_limit parameter of 25 and due to this fact returns 25 traces.

One other instance can be if you wish to pull the highest 100 key phrases for a site utilizing dwell knowledge; you’ll use the “domain_organic” name, which prices 10 API items per line for dwell knowledge, or 50 API items per line for historic knowledge.

In fact, calculating API items utilization might be extra sophisticated than that as you employ API extra extensively, however the primary logic stays the identical. You may be charged API items for each line of knowledge that you just request.
To view your API items stability, go to your Semrush Profile—Subscription data—API items.
Integrating with Google Sheets
Utilizing API with Google Sheets is without doubt one of the easiest methods to combine API with one other platform.
Very similar to Microsoft Excel, Google Spreadsheets helps a wide selection of capabilities.
By utilizing capabilities like IMPORTDATA, TRANSPOSE, and SPLIT, you possibly can enter your API calls right into a cell and populate the spreadsheet with formatted knowledge.
For instance, a Area Overview report request instance utilizing IMPORTDATA would look much like the next:
(importdata(” https://api.semrush.com /kind=domain_rank&key=abcdefghijklm0pqrstuv123&export_columns=Dn,Rk,Or,Ot,Oc,Advert,At,Ac&area=seobook.com&database=us“)
The outcomes of the decision will populate into the cell that you just entered the components.

Now we have an article in our Data Base that reveals you use Developments API in Google Sheets.
Recap
If you wish to collect extra knowledge at a quicker tempo than the interface, Semrush API is your excellent resolution.
Including the usual API to your subscription is offered after subscribing to the Enterprise stage and can grant you entry to our Analytics API, Tasks API, and Accounts API. These APIs will allow you to pull analysis knowledge in your competitor’s search efficiency, key phrase analysis, and construct superior progress dashboards.
Request API entry right here.
Anybody should buy Semrush Developments API—with or with no Semrush subscription. This API is superb for evaluating markets and potential enterprise companions and investments.
Phrases of Use
Earlier than utilizing our API, that you must learn and comply with our phrases of use. In case you want to resell our knowledge by way of API, a separate settlement have to be made. Full phrases of use could be discovered right here.