How to use the SEMrush API with Excel… the easiest method (with examples)

SEMrush API example

update: SEMrush has provided a 14 day free trial affiliate link for MT readers.
It won’t be the API level plan, but you can get a feel for the available data.

Do you want to be able to automatically pull all kinds of SEO and PPC data and avoid hours of data entry?

Of course, everyone would love to make this happen… but maybe you thought it required a developer?

While it never hurts to know a developer, there IS a spreadsheet-based way of working with the SEMrush API. Even if you’re not a coder, you can be automatically pulling marketing data at scale. Learn more from your competitors, publish industry research reports, analyze prospects on your email list, the possibilities are endless.

No coding with PHP or Python.
No hassling with Google Sheets.

I’ll try to keep this simple. If I find ways to explain it or illustrate it more simply, I’ll update this post. Feel free to contact me with any questions.

note – it’s generally not super cheap to work with SEO APIs, and this is no exception. (More on that below.) But for agencies and businesses, the costs associated with APIs can be far less than the labor and opportunity costs of manual methods.

also note – this post uses affiliate links whenever possible. It’s hard to see how this would change anything, since the content is straightforward documentation. If you do sign up for anything, it will fund our continued research and documentation.

What You Need

The first two items are specific to this method. The last two are needed to do anything with the SEMrush API.

  1. Microsoft Excel — hopefully you already have it
  2. SEOToolsForExcel — €99 per machine per year
  3. SEMrush Business plan —  $399.95 per month
    (see also: the value of SEMrush’s pricing)
  4. SEMrush API credits — $1 per 20,000 units

Step 1: Get SEOToolsForExcel (Excel Add-In)

SEOToolsForExcel is one of the hidden gems of SEO tools. Besides SEMrush, it has over 100 connectors, including some with free data sources. You’ll likely keep finding uses for it.

  1. Download
  2. Purchase
  3. Install
  4. Make sure the SEMrush connector is loaded. Click “Manage” on the SEOTOOLS menu to get thsi popup. Click “SEO” on the left side, then click “Load More” in the list in the middle to see the SEMrush connector. Click the “Update” button on the far right if needed for the latest version. (You can click the version dropdown to see how often the connector is updated.

Step 2: Get SEMrush Account & API Credits

This is where things get a little more expensive. Hopefully this guide will help you minimize downtime and make the most of each month.

  1. Purchase (or upgrade to) SEMrush’s Business Plan.
  2. Go to My Profile > Subscription Info > API Units.
  3. Buy API units and get your API key. Keep the API number handy, you will need it soon.

Don’t worry if you don’t know exactly how many API units you need. You can always buy more later. I started with 2 million API units for $100, and it goes a long way… at least when pulling overview data for a lot of domains.

Step 3: Comply with SEMrush Terms-of-Use

When SEOToolsForExcel is installed, you will see a menu like this under the “SEOTOOLS” tab.

SEOToolsForTools menu

Before we get to the SEMrush connector, we want to adjust some top-level settings to comply with SEMrush’s Terms of Use.

“User agrees to the following technical limits: (a) not more than ten (10) Calls per second, and (b) not more than two (2) Calls simultaneously.”

With that in mind, we head over to the Global HTTP Settings and adjust the delay between requests. I had a random delay between 1000 ms and 2000 ms (1 and 2 seconds) from another project, but you can adjust this as needed.

SEOToolsForExcel settings

Step 4: Configuring The SEMrush Connector

The screenshot below illustrates a few of the steps at the same time (so don’t be worried if your screen doesn’t look like this at the beginning):

How to select the SEMrush API:

  1. Click the “SEO” tab illustrated above (not the one on the far left).
  2. Hover over “SEMrush” to get a sub-menu with options.
  3. In this case, I clicked the “Domain Overview” option. Doing so pops up the configuration panel on the left side.

SEOToolsForExcel SEMrush menu

How to configure the connector for the SEMrush API:

  1. On the left side menu, click the blue “Settings” link to enter your unique SEMrush API key. None of the sweet, sweet SEMrush data can be pulled without the API key.
  2. Enter a domain to query, along with any changes you want to make to the database, date or fields.
    1. Database – if you only deal with the US, change the database to google.com instead of all. Specifying only the data you need is easier to work with and saves API credits.
    2. Display Date – if this is too current, no data will display. For example, Domain Overview for the last few days. For consistency, I use the first day of each month.
    3. Select “Formula” instead of “Values”. This will give you something to work with, modifying and copy & pasting it as needed.

Step 5: How To Use The SEMrush API

After you select the connector settings in the last screenshot and click the “Insert” button, you’ll have a formula that you can work with to get more data.

Below is an example of a formula and its output:

=Dump(Connector(“SEMrush.DomainOverview”,”semrush.com”,”us”,”2019-01-01″,”Db,Dn,Rk,Or,Ot,Oc,Ad,At,Ac”,TRUE))

Example of SEMrush API in Excel

In the screenshot below, we’ll make the formula more dynamic, pointing the domain parameter to another cell.

Example above has “semrush.com” after the first comma.
Example below has A3 after the first comma, referencing the cell with spyfu.com.

=Dump(Connector(“SEMrush.DomainOverview”,A3,”us”,”2019-01-01″,”Db,Dn,Rk,Or,Ot,Oc,Ad,At,Ac”,TRUE))

SEMrush API example of formula & data

To pull the Domain Overview for many sites, simply paste your list of sites into Column A.

Then take a dynamic formula like the one above in B3 and copy it down. The cell references should adapt to the correct row number, and the SEMrush API data will start to pull.

You can work dynamically like this for any parameter, i.e. the same site over many months, or the same site with different databases.

Just copy & paste a handful of rows first to make sure everything works as expected, before using a bunch of API credits.