Telephone
United States
+1 (800) 815 - 9959
10:00 AM - 5:00 PM (EST/EDT)
Monday - Friday
Need help?
Telephone
United States
+1 (800) 815 - 9959
10:00 AM - 5:00 PM (EST/EDT)
Monday - Friday
Your API key lets you send requests through the Semrush API.
To get your key:
Whenever you run an API request, you will be charged a certain amount of API units per request, response line, or keywords, depending on the target report*.
Make sure that you have a sufficient number of API units: within the Subscription info tab or via API request (Check API unit balance).
*Billing Traffic analytics API works differently, read more here.
Each report type provides an example of a request. This is a great starting point for your own requests.
1) Begin with the base URL. It depends on the product.
2) Enter the ?key
followed by your API key.
3) Enter the report type.
4) Enter request parameters.
5) Enter the domain name.
6) Enter the database.
Certain types of reports within Semrush API support the display_limit
parameter. Use it to limit the number of lines returned in a response to save on API units.
Example:
Adding &display_limit=10
will limit your request to the top 10 results.
When making API requests, parameter values containing special characters must be converted to URL-encoded strings. To simplify the process, you can use a URL encoder.
The characters typically used in Semrush API calls are:
Character | Encoded |
---|---|
# | %23 |
& | %26 |
* | %2A |
+ | %2B |
- | %2D |
: | %3A |
| | %7C |
% | %25 |
/ | %2F |
If you receive an error code saying there was a problem with your API request, refer to the Error page to view the description that will help you fix the problem.