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
When you purchase an API unit package in addition to your Business subscription, you'll have a limited number of API units to make calls. If you run out of API units, you can buy more on the Subscription info page or contact our sales representatives. To learn more, refer to How to get API.
Make sure your API unit balance is sufficient before making requests. You can check your remaining units in two ways:
This request returns the number of remaining API units to help you manage usage.
Name | Value/Type | Description |
---|---|---|
key* | YOUR_API_KEY | Identification key assigned to each user after subscribing to Semrush. You'll find it in Subscription info > API units. |
* Fields marked by an asterisk (*) are required
Endpoint (GET)
Request example
http://www.semrush.com/users/countapiunits.html?key=YOUR_API_KEY
Response example
1,000
This request returns your monthly, daily, and hourly API unit usage. This helps you monitor and optimize your API consumption.
Name | Value/Type | Description |
---|---|---|
key* | API_KEY | Identification key assigned to each user after subscribing to Semrush. You'll find it in Subscription info > API units. |
* Fields marked by an asterisk (*) are required
Endpoint (GET)
Request example
http://api.semrush.com/analytics/ta/limits/key/API_KEY
Each request to the Semrush API consumes a specific number of units, depending on the type of report and the amount of data requested.
To effectively manage API usage, it is crucial to understand how units are consumed and how to optimize requests.
Requests to the methods of Listing Management and Map Rank Tracker don't use up API units.
Different API reports have varying unit costs:
You can check how many units are consumed for each report or request in the API documentation under the respective report or request name.
The total request price is calculated based on the number of lines in the report or particular request.
Besides regular data, most analytical data also contains historical data which costs more than regular data requests. For details, refer to Historical data.
display_limit
parameter. Use it to limit the number of lines returned in a response to save on API units. For example, adding &display_limit=10
will limit your request to the top 10 results.Suppose you need to analyze organic keyword rankings for a list of 50 domains using the Domain Organic Search Keywords report.
You need 500 keywords per domain with the following conditions:
It means that:
The total number of API units required is 1,500,000.
Depending on the report and API version, you'll get either an error or a partial number of lines.
If you don't have enough API units for the requested number of lines or requests:
ERROR 132
.403
error.In API version 3, for reports that cost per line, you will get the number of lines for which you have enough API units.
Therefore, it's important to check the API unit balance so you don't lose data.
Response example (API v4)
{ "error": { "code": 403, "message": "????", "description": "????" } }