How to use the Sistrix API

Jose Vicente

Written by Jose Vicente

Although Sistrix offers a good web interface with customized reports and dashboards with which to quickly analyze the behavior of a domain, sometimes we need to go further and display this data from other platforms to process or buy it with other data. The objective of this small tutorial is to take advantage of the API to automate the query of Sistrix indicators of our own domain and/or competitors.

Like any API (Application Programming Interface), the Sistrix API offers us programmatic access to certain functionalities and data that we usually obtain through its Web interface. This is very useful when we want to implement our own dashboards programmatically. Although the tool allows us to design our own dashboards, by consulting its API we can mix the information with that of other APIs from external tools.

The Sistrix API provides programmatic access to certain platform functionalities and data.

Access to the Sistrix API is via http and we can obtain the data from our queries in JSON or XML format, so we can integrate your data in any platform that is capable of performing this type of queries and manage your data in this format. For example, we could implement the Sistrix indicators that we want to monitor in the back end of our website and not have to access each time to its interface to check the visibility of our site or that of our competitors. Of course, this implementation comes at a cost and we must be sure that it will save us time in the daily analysis of our business.

API Access

In order to access the Sistrix API we need to have an account. Once logged in with our account, we must access the page https://www.sistrix.de/api/ to obtain our API access key.. The access key is a 32-character alphanumeric code that must be included in each API request.

The API page also provides information on available credits. This information can also be queried to the API itself with the request https://api.sistrix.com/credits?api_key=[API_KEY] where $key will be our API key and the response will have the following XML format by default.

<response>

<method>credits</method>

<answer>

<credits value=“43623“/>

</answer>

</response>

In this case we can see that we have 43,623 credits available.

The API page also has a log of the accesses made including:

  • Date of access
  • Requested function
  • Credits consumed
  • IP that made the request

Sistrix API LOG

Format of requests

As we have seen in the query of available credits, the request to the API is made with a URL that identifies the functionality we want to use and parameters that are required for each API function with the data we want to query. In the API documentation https://www.sistrix.de/api/ you can consult all this information and the list of available functions, with their mandatory and optional parameters, etc.

In addition to the API key, in most requests we must identify the database of the country we want to query. If we do not identify the country, by default the API will return data from Germany. Each country is identified by the corresponding 2-character ISO code.

If the programming with which we consult the API is not capable of handling XML or it is easier to manage the response in JSON, we can change the response format of the API request between XML -by default- or JSON. If in the example of the request for the number of credits remaining in our account we had added the format parameter with a json value, the response would have been as follows.

{“method”:[[“credits”]],”answer”:[{“credits”:[{“value”:“43623“}]}]}

How to query the Sistrix API from Google Drive

Although it would not be difficult to develop a simple Framework in php or any Web programming language to use the Sistrix API, we are going to see some examples of how to query data from a Google Drive spreadsheet or Spreadsheet to make it accessible to users who do not have programming skills.

Among other functions for importing data, Google Drive spreadsheets allow us to import data in XML through an http request with the IMPORTXML function. This is just the format that the Sistrix API handles by default, so we can use it to implement a dashboard that we can share with other users.

The IMPORTXML function https://support.google.com/docs/answer/3093342?hl=es has the following format:

IMPORTXML(url; query_xpath)

Where the URL will be the request to the Sistrix API and query_xpath the element we want to get from the XML. But let’s look at some examples to understand it better.

Before implementing the dashboard it is recommended to have a tab with the common configuration data for the API, in this case we are talking about data such as the API access key and the ISO code of the country of the database we want to query. In this way, if at any time we had to change the key or perform the analysis for a different country we would only have to change the data in these cells.

Drive Sistrix configuration

Domain visibility index

To obtain the visibility index of a domain with the Sistrix API we must use the following API request format.

https://api.sistrix.com/domain.sichtbarkeitsindex?api_key=$key&domain=$domain&country=$country

Optionally we can obtain the history or the data of a specific date, but if we do not specify anything we will obtain the latest available data. To import this data into a Google Drive spreadsheet we will have to make use of the IMPORTXML function as follows:

=IMPORTXML(“http://api.sistrix.net/domain.sichtbarkeitsindex?api_key=[CLAVE]&domain=[DOMINIO]&country=[PAIS],”//sichtbarkeitsindex/@value”)

As you can see in the example, the IMPORTXML function is passed as first parameter the request to the API with our key, the domain we want to query and the country we want to get the visibility. The API response for, for example, the domain bikestocks.es would be as follows:

Response visibility of the sistrix api

The data we are interested in displaying in our spreadsheet is the value inside the sichtbarkeitsindex node, so the second parameter of the IMPORTXML function will be //sichtbarkeitsindex/@value . The format of the parameter to identify the value to be extracted always consists of //NODE_NAME followed by /@[NOMBRE_PARAMETRO].

In the Domain section https://www.sistrix.de/api/domain of the Sistrix API documentation we can find the rest of the requests related to API data.

Social signals

Another data that can be useful to know is the data of the social signals related to a domain, we do this with a call to the function http://api.sistrix.net/domain.social.url that will return the total of social signals and a breakdown of Facebook, Twitter and Google Plus as we can see in the following screenshot.

Response to social signals from Sistrix api

In this case, to obtain the data for each of the social networks we will have to make the same request to the Sistrix API and vary the second parameter of IMPORTXML to obtain the data we want in each case.

  • //current/@total
  • //current/@facebook
  • //current/@twitter
  • //current/@googleplus

Keyword position queries

Finally, let’s see what an example of a query to the position API of a domain for a specific search would look like. Keyword-related functions can be found in the tool’s API documentation http://www.sistrix.de/service/api/keyword-methoden/.

To perform the query from our example in Google Drive we should execute the following command:

=IMPORTXML(“http://api.sistrix.net/keyword.seo?api_key=[CLAVE_API]&domain=[DOMINIO]&country=[PAIS]&kw=[KEYWORD]&date=now”,”//result/@position”)

By identifying the domain and the current date with date=now in addition to the keyword, we can obtain the current position of the domain for the specified search. As we can see in the following screenshot the response includes not only the position but also the URL that we could also query by identifying the data as //result/@url in the IMPORTXML function of Google Drive spreadsheets.

Sistrix dashboard in Google Drive

With some of the functions offered by the Sistrix API we can easily set up comparative dashboards like the following one. This type of table can be used to quickly consult the data of our competitors or to obtain indicators of strengths and weaknesses of competitors of a site that has requested a quote.

Querying the Sistrix API from Google Drive

As all the cells are referenced with their corresponding domain in the column header, we only have to change the domains and select relevant keywords to quickly compare visibility data, social networks or positioning of the domains to be analyzed. You can access this test Drive at this link, just add a Sistrix API key in the Settings tab to make it work.

We hope that this small tutorial will help you to make the most of the Sistrix tool and that it will make it easier for you to monitor the positioning of your business on the Internet or that of your competitors.

  •  | 
  • Last modified on
Jose Vicente
Jose Vicente
Head of the SEO department and consultant at Human Level. Graduated in Computer Engineering. Expert in SEO and web analytics with certification in Google Analytics. Professor of the Master of SEO-SEM Professional Kschool.

What do you think? Leave a comment

Just in case, your email will not be shown ;)

Related Posts

en