
-
The request's format
The GET request for data should be sent with in the following format:
http://www.semrush.com/search.php?q=%request%&key=%API_KEY%&limit=%limit%&offset=%offset%&db=%db%&uip=%END_USER_IP%
Where:- %API_KEY% - user identification key, you can find it in your profile on the site.
- %request% - your request
- %limit% - number of results returned
- %offset% - says to skip that many results before beginning to return results to you
- %db% - the language of the requested database. Valid values: "ru" - for Google.ru, "us" - for Google.com, "de" for Google.de, "fr" for Google.fr.
- %END_USER_IP% - In case if one of users of a partner overloads the server, we'd like to have an opportunity to disconnect the exact user without blocking the partner's access to SEMRush's API. For this purposes it is necessary for us to know the IP of the end-consumer.
-
Request samples
- seobook.com - Main report
http://www.semrush.com/search.php?q=seobook.com&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&db=us&uip=38.107.191.99&limit=10 - seobook.com+(by+organic) - Organic Keywords report
http://www.semrush.com/search.php?q=seobook.com+(by+organic)&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&db=us&uip=38.107.191.99&limit=10 - seobook.com+(by+adwords) - AdWords keywords report
http://www.semrush.com/search.php?q=seobook.com+(by+adwords)&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&db=us&uip=38.107.191.99&limit=10 - seobook.com+(by+organic_organic) - Competitors in organic search report
http://www.semrush.com/search.php?q=seobook.com+(by+organic_organic)&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&db=us&uip=38.107.191.99&limit=10 - seobook.com+(by+adwords_adwords) - Competitors in AdWords search report
http://www.semrush.com/search.php?q=seobook.com+(by+adwords_adwords)&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&db=us&uip=38.107.191.99&limit=10 - seobook.com+(by+organic_adwords) - Potential ad/traffic buyers report
http://www.semrush.com/search.php?q=seobook.com+(by+organic_adwords)&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&db=us&uip=38.107.191.99&limit=10 - seobook.com+(by+adwords_organic) - Potential ad/traffic seller report
http://www.semrush.com/search.php?q=seobook.com+(by+adwords_organic)&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&db=us&uip=38.107.191.99&limit=10 - search+engine+optimization - Main keyword report
http://www.semrush.com/search.php?q=search+engine+optimization&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&db=us&uip=38.107.191.99&limit=10 - search+engine+optimization+(related) - Related keyword report
http://www.semrush.com/search.php?q=search+engine+optimization+(related)&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&db=us&uip=38.107.191.99&limit=10 - http://tools.seobook.com/ - URL report
http://www.semrush.com/search.php?q=http://tools.seobook.com/&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&db=us&uip=38.107.191.99&limit=10
- seobook.com - Main report
-
Error Messages
- ERROR 10 :: API ACCESS DISABLED
- ERROR 20 :: BAD API KEY
- ERROR 30 :: BAD QUERY
- ERROR 40 :: BAD QUERY
- ERROR 50 :: NOTHING FOUND
- API format is similar to CSV export
-
Columns order
- Column names never change
- Order of columns may be changed
- Number of columns may be increased
- Old columns may be removed only after notification
-
Intergation scripts examples
Below are three simple scripts showing you how you can intergate SEMRush API data into your web project. Examples are written in PERL, PHP and JavaScript (using YQL). All you have to do is download a script, which suits you most, unzip it, set some parameters (explaned in detail in comments, in a script body) and upload it to your web server.
Attention!!! Use JavaScript example with caution as your API key in that script gets disclosed and can be viewed by anyone!!!
- PERL SEMRush API intergation example script - perl_example.zip
- PHP SEMRush API intergation example script - php_example.zip
- JavaScript SEMRush API intergation example script - js_example.zip - Using this method your API key will be disclosed and can be viewed by anyone!!!
-
Terms of use
Publication of data provided by the service is only possible with reference to the data source, another type of publication is prohibited.
Prohibited is the use of information provided by a service for posting it on commercial and other third-party services in the form in which it was obtained directly from the service without the express written consent of SEMRush.com.

