7359 26
SEO 13 min read

How To Automate And Speed Up Your SEO With The Serpstat API: A Step-By-Step Guide From Flatfy

How To Automate And Speed Up Your SEO Tasks With Serpstat API: A Step-By-Step Guide From Flatfy
Vlad Morgun
Vlad Morgun
SEO Team Lead at Flatfy
Every year we hear that SEO is dead, but search engine optimization experts are not discouraged. After all, it always ends up being more relevant than ever. To be a qualified SEO expert, you must keep up with new web technologies and gain skills in various related fields (analytics, design, marketing, etc.), as search engine algorithms never stop developing.

The area of responsibility and diversity of tasks of an SEO specialist keeps expanding while the time remains limited. In this article, I will show you how to use the Serpstat API using real estate projects as an example. I'll also try to prove that even with a little knowledge of development and the ability to use Google and StackOverflow, you can simplify your daily routine work and gain an advantage over competitors.

Meet Flatfy

My name is Vlad Morgun, and I'm the SEO Team Lead at Flatfy. Our platform helps millions of users from 30 countries find accommodations. The primary vector of development is secondary residential real estate in mega-cities. We are working on creating a fast search engine taking into account all the wishes of users to provide a relevant answer.

To work effectively on all of our projects, the team is continually testing various tools for digital marketing, especially those that have an API.

Serpstat now has a massive database of keywords and links, but most importantly - one of the most convenient APIs. This is necessary because working with a large number of sites requires a constant storing of a lot of data in one place and analyzing it.

What We Use Serpstat For

If several years ago you could solve all problems with Excel, now it's worth studying JS, Python, and gaining basic knowledge of HTML, CSS, HTTP, etc. In our work, we try to automate:
  • Keyword research and clustering/filtering.
  • Monitoring changes on the website, its backlink profile, SEO parameters, competitors.
  • Generating texts and template pages.
  • Work with the backlink profile, link-building strategy, outreach.
  • Other routine tasks.
Do you have similar tasks? Would you like to see which solutions Serpstat has to offer?
Sign up for a 7-day trial and test the tools free!
Serpstat Batch Analysis Add-on For Google Spreadsheets: Data Analysis In One Click

How To Use The Serpstat API In Google Spreadsheets Without Plugins

The SEO industry is constantly changing and evolving, so the faster you gain experience, the better. Therefore it's vital to automate as many processes as possible to free up time.

In this section, I will intentionally not mention anything that requires programming skills. All you need is the mastery of Google Search. I want to inspire beginners to learn and grow. So, let's start.
First, what is an API? Let's refer to Wikipedia.
API (application programming interface) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software.
From the definition, we can already gather that we will interact with Serpstat via another program without using its interface. It will allow us not to spend extra time logging into Serpstat, selecting the necessary reports and filters, exporting them, and only then working with them.

And what do SEOs love most? Right! Tables. In this article, we will use Google Spreadsheets.

To work with data in tables, we use functions. Since the "= serpstat (give me data)" function is missing, we will create our own.

If we google "google sheets custom function," we'll find a manual about App Script.
Google Apps Script is a scripting language based on JavaScript.
Next, we move on to the concept of endpoint API.
Endpoint is the server-side request receiving point (API).
In our case, this is just a link with get parameters. For example, api.serpstat.com/v3/domain_info?query=example.com&token=XXX&se=XXX, where:
  • query, se (search engine) — query parameters for this report.
Using this URL, you can get the necessary data in JSON format.
JSON (JavaScript Object Notation) is a text-based data exchange format based on JavaScript.
Let's take a ready-made script for working with JSON in Google Spreadsheet (more precisely, google "google spreadsheet JSON import"):

Code "Formula 1":
Or a simpler "Formula 2" code:
I'm using someone else's ready-made scripts to demonstrate that you can automate your SEO tasks even if you only have minimal programming knowledge. All you need to do is take advantage of other people's experience.

Now, let's put it to practice.
1
Create a new Google Spreadsheet.
2
Select Tools → Script Editor.
3
Delete the standard function and insert the JS code instead.
4
Save (File → Save) and go back to the Spreadsheet.
5
Now enter the formula = ImportJSON () in the cell.
Would you like to try automating your tasks with the Serpstat API?
Sign up for a 7-day trial and test the API and other useful features for free!

How To Create A Dashboard For Competitor Analysis

Every SEO should always be aware of what their competitors are up to and how the industry is developing. The sooner you notice changes in the tops of SERPs and on competitors' websites, the better.

The easiest way to use the API is to create various reports. Let's create a simple Dashboard using the "Formula 2" code to analyze competitors with the following parameters:
  • the number of keywords for which they rank;
  • website traffic;
  • the number of ads in Google Ads.
Even such simple indicators can show us where we stand compared to the competitors, as well as track the dynamics on a monthly basis if we do it regularly.

This is what the mini-report looks like with the number of keywords, traffic, and ads in contextual advertising for competitors in real estate.
Tip: Save the variables in separate cells, and then use them through the formula = CONCATENATE () - merge the cells into one.
For instance, the variables would be sites (column A), API key Serpstat (cell G2), and search engine database (cell H2).
Next, we collect the URLs in column F, which we will use with the formula = CONCATENATE ("http://api.serpstat.com/v3/domain_info?query=",A2,"&token=",G$2,"& se=", $2). The $ sign in front of the cell number means "don't change the number".

Now we need to make requests to one of the attributes from the JSON array. JSON has a nesting (tree structure), which we will share with slashes.

For example, you need to get the number of keywords on a site. To do this, we will use the formula = IMPORTJSON (F2, "result/keywords") (cell B1). If we want to get traffic, then change our request to = IMPORTJSON (F2, "result/traff").
You can find more ways to automate your tasks in the Serpstat help.

How To Collect Data Quickly

Let's say you need to get data quickly without using the interface. For instance, collect the top search results for certain keywords or determine the search volume of specific keywords.

Let's use the "formula 1" code.

It has several features that we can use. You can see all these features in the pop-up when entering the formula. A crucial feature for us is the ability to get several JSON keys at once and receive data on them.

So, let's say we would like to collect the top 100 search results for several search queries.
I personally do this very often for a quick check of the keyword clustering. There is a search query, and I don't know for which page it will work best. I gather the top of search results for several queries and compare their intersection directly in the spreadsheet. Thus, you don't need to run KeyAssort to cluster multiple requests, and you don't need to spend time opening numerous tabs with Google to compare the tops of SERPs.

Go to http://api.serpstat.com/v3/keyword_top and type in = ImportJSON (F2,"/result/top/position,/result/top/url") - note that we used two keys separated by commas: /result/top/position and /result/top/url.

Thus, we get two columns with data: positions from the top 100 and the URLs.
Perhaps you would like to quickly check the search volume of keywords. Everything is similar here, we need to use the following request https://api.serpstat.com/v3/keyword_info and the formula = ImportJSON(F2,"/result/region_queries_count","noHeaders").

In this example, there's another detail — additional parameters. noHeaders allows us to remove the extra headers and get just the data. In column A, we need to insert the keywords of interest, and then "stretch" the formula further in column B.

Conclusion

Thus, with the help of Google, minimal knowledge of programming, and excellent support from Serpstat, you can get any data very quickly.

Flatfy has a rule — if there's a repeating task and it can be automated, we automate it. Many companies buy new equipment for employees to increase their productivity, but few people think about how much time an employee can spend collecting data instead of analyzing it, and switching between tabs instead of having all the data in one place.

By automating data collection, we improve our performance and free up more time for high-priority tasks, and project development.

Using Serpstat API saves hours of work time. Using such simple automation, you can save at least one working hour per day for an SEO specialist.
To keep up with all the news from the Serpstat blog, subscribe to our newsletter. Also, follows us on LinkedIn, Facebook, and Twitter ;)

Speed up your search marketing growth with Serpstat!

Keyword and backlink opportunities, competitors' online strategy, daily rankings and SEO-related issues.

A pack of tools for reducing your time on SEO tasks.

Get free 7-day trial

Rate the article on a five-point scale

The article has already been rated by 3 people on average 5 out of 5
Found an error? Select it and press Ctrl + Enter to tell us

Share this article with your friends

Are you sure?

Introducing Serpstat

Find out about the main features of the service in a convenient way for you!

Please send a request, and our specialist will offer you education options: a personal demonstration, a trial period, or materials for self-study and increasing expertise — everything for a comfortable start to work with Serpstat.

Name

Email

Phone

We are glad of your comment
I agree to Serpstat`s Privacy Policy.

Thank you, we have saved your new mailing settings.

Report a bug

Cancel
Open support chat
mail pocket flipboard Messenger telegramm