Semrush is an SEO tool with features such as a keyword research tool, keyword position tracking, SEO audit, backlink analysis, and more. We can use the Semrush API to import data from Semrush into Google Sheets. In this tutorial, we’ll show you how to connect the Semrush REST API to Google Sheets in 5 steps:
Apipheny is an API connector for Google Sheets. You can use Apipheny to connect your Google Sheets to unlimited API data sources, make unlimited API requests, and more. There is a 30 day free trial included.
1.) Install Apipheny by opening the following link on desktop and then clicking the Install button in the Google Marketplace: https://apipheny.io/install
2.) After you’ve installed Apipheny, open a Google Sheet and then click on the Extensions dropdown in the menu at the top.
In the dropdown list you should see Apipheny. Click Apipheny then click Import API to open the Apipheny sidebar in your Google Sheet.
Tip: you can open a new Google Sheet by entering this URL in your browser: sheet.new
In your Semrush account, go to your profile icon, then choose Subscription info from the drop-down menu:
Then go to the API Units tab:
In the API Units tab, click the blue Generate API key button:
In the Terms of Use window check the Terms of Use checkbox and then click the green Accept button:
Your API key will be generated:
Copy your API key to a safe location, because you’ll need it later.
In this section, we’ll show you how to browse the Semrush API documentation to find an API endpoint URL that retrieves the information you need from your Semrush account.
If you already know your Semrush API URL, or you want to use the same example URL/endpoint as us, just skip to Step 4.
To browse a list of available Semrush API endpoints, first open the Semrush API documentation page: https://developer.semrush.com/api/
The menu on the left contains basic info about the Semrsuh API and a list of categories for its endpoints:
For example, if we choose the URL reports category, a list of its available endpoints will be displayed:
An example endpoint is the URL organic search keywords, which returns a list of keywords that bring users to a URL via Google’s top 100 organic search results. The API URL for this endpoint is:
https://api.semrush.com/?type=url_organic&key=YOUR_API_KEY
The documentation for each endpoint contains a paragraph describing the endpoint’s purpose, the full URL, a request example and a list of accepted query parameters for the endpoint:
All API calls to Semrush API should be made to the https://api.semrush.com/
base domain.
The Keyword Overview (All databases) endpoint, which provides a summary of a keyword, including its volume, CPC, competition, and the number of results in all regional databases:
Method: GET API URL Path: https://api.semrush.com/?type=phrase_all&key=YOUR_API_KEY&phrase=seo&export_columns=Dt,Db,Ph,Nq,Cp,Co,Nr
Make sure to replace YOUR_API_KEY with the key you previously obtained.
The Organic Results endpoint, which lists domains that are ranking in Google’s top 100 organic search results with a requested keyword:
Method: GET API URL Path: https://api.semrush.com/?type=phrase_organic&key=YOUR_API_KEY&phrase=seo&export_columns=Dn,Ur,Fk,Fp&database=us&display_limit=10
Make sure to replace YOUR_API_KEY with the key you previously obtained.
The Keyword Ads History endpoint, which shows domains that have bid on a requested keyword in the last 12 months and their positions in paid search results:
Method: GET API URL Path: https://api.semrush.com/?type=phrase_adwords_historical&key=YOUR_API_KEY&display_limit=1&export_columns=Dn,Dt,Po,Ur,Tt,Ds,Vu&phrase=movie&database=us
Make sure to replace YOUR_API_KEY with the key you previously obtained.
The Phrase questions endpoint, which provides a list of phrase questions relevant to a queried term in a chosen database:
Method: GET API URL Path: https://api.semrush.com/?type=phrase_questions&key=YOUR_API_KEY&phrase=seo&export_columns=Ph,Nq,Cp,Co,Nr,Td&database=us&display_limit=10&display_sort=nq_desc&display_filter=%2B|Nq|Lt|1000
Make sure to replace YOUR_API_KEY with the key you previously obtained.
The Keyword Difficulty endpoint, which provides keyword difficulty, an index that helps to estimate how difficult it would be to seize competitors’ positions in organic search within the Google’s top 100 with an indicated search term:
Method: GET API URL Path: https://api.semrush.com/?type=phrase_kdi&key=YOUR_API_KEY&export_columns=Ph,Kd&phrase=ebay;seo&database=us
Make sure to replace YOUR_API_KEY with the key you previously obtained.
Now, to get your Semrush data in your Google Sheet, go back to your Google Sheet and make sure that you’ve installed the Apipheny add-on and you have it opened to the Import tab.
With the Import Tab open, enter the following details into the Apipheny add-on:
Method: At the top of the Apipheny add-on, select the HTTP method (eg. GET or POST) required by your Semrush API endpoint. For this example, we are using the GET method.
API URL: In Step 3, we explained how you can find the Semrush API endpoint that you need. Now copy your complete Semrush API URL into the Apipheny add-on, in the field that says API URL Path, followed by any GET parameters required for your query (if applicable).
For this example, we are using the Check API units balance endpoint, which returns the number of API units that the user has in the account. This is what the URL looks like:
https://www.semrush.com/users/countapiunits.html?key=YOUR_API_KEY
Make sure to replace YOUR_API_KEY with your actual API key, at the end of the URL.
Here’s what your Semrush API request should look like when entered into the Apipheny add-on:
The last step is to click the Run button at the bottom of the Apipheny add-on and then your Semrush data will be imported into your Google Sheets, like so:
Crypto API Tutorials: