Thanks to visit codestin.com
Credit goes to developer.semrush.com

contacts

Telephone

United States

dropdown button

United States

Canada

United Kingdom

Spain

France

Italy

Germany

Australia

+1 (800) 815 - 9959

12:00 PM - 5:00 PM (EST/EDT)

Monday - Friday

mobile-menu

API unit balance

Basic docs divider Last updated: August 29, 2025

Check API unit balance

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:

API unit balance

Standard API

Price: free

This request returns the number of remaining API units to help you manage usage.

Request parameters
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)

http://www.semrush.com/users/countapiunits.html

Request example

http://www.semrush.com/users/countapiunits.html?key=YOUR_API_KEY

Response example

1,000

Trends API

Price: free

This request returns your monthly, daily, and hourly API unit usage. This helps you monitor and optimize your API consumption.

Request parameters
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)

http://api.semrush.com/analytics/ta/limits/key/

Request example

http://api.semrush.com/analytics/ta/limits/key/API_KEY

Limits consumption

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.

How API units are consumed

Different API reports have varying unit costs:

Check API request price

You can check how many units are consumed for each report or request in the API documentation under the respective report or request name.

price

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.

Optimize unit consumption

  1. Use the display_limit parameter. 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. For example, adding &display_limit=10 will limit your request to the top 10 results.
  2. Estimate API unit usage. Before making an API request, calculate the potential unit cost to prevent excessive usage.

Cost calculation example

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:

  • Regular data for the last month (current rankings)
  • Historical data from 12 months ago for comparison

It means that:

  • For regular data, you will spend 500 keywords × 10 units per keyword × 50 domains = 250,000 units.
  • For historical data, you will spend 500 keywords × 50 units per keyword × 50 domains = 1,250,000 units.

The total number of API units required is 1,500,000.

Not enough units

Depending on the report and API version, you'll get either an error or a partial number of lines.

Errors

If you don't have enough API units for the requested number of lines or requests:

  • In API version 3, you'll get ERROR 132.
  • In API version 4, you'll get the 403 error.

Partial number of lines

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": "????"
  }
}

API Query log

View your Semrush API query log

Semrush provides a dedicated report where you can review your recent API requests and track how your API units are used. To find this information in the Semrush UI, go to My Profile → Query log → API Queries.

API Queries only has logs for the Standard Semrush API v3. Logs for Trends API and Semrush API v4 aren't listed. If you need to review your Trends API request log, contact Semrush Customer Support.

The API Queries report shows a detailed log of your v3 API activity, including:

  • Query: What was the domain, subdomain, subfolder, URL, or keyword queried (when applicable).
  • Time: When the request was sent.
  • User IP address: IP that initiated the request.
  • DB: Database selected for the query (when applicable).
  • Report type: Specific API report requested.
  • Historical: Whether the request retrieved historical data (when applicable).
  • Requested rows: Number of rows queried.
  • Offset: Based on display_offset, what the data offset was that the request started from (when applicable).
  • Report cost: Number of API units spent for the data returned.
  • API units: Standard API unit balance remaining after that specific request.

This information helps you monitor API usage, troubleshoot unexpected unit consumption, and analyze request history.

Export your API request log data

You can export your v3 API request log in CSV directly from the API queries report. Use the Export button in the top-right corner of the table. You can choose to export:

  • All available records (up to 50,000).
  • Only the first N rows, selecting a limit such as 100, 500, 1,000, 10,000, 30,000, or 50,000.
If your API Queries log has more than 50,000 entries, request an export via Semrush Customer Support.

You can use the exported file for internal reports, sharing with your team, or analyzing in Excel or Google Sheets.