Overview
The Semrush SEO API provides backlink, keyword, and domain analytics data. Use it to analyze organic and paid search performance, track rankings, research competitors, and add SEO data to reports, dashboards, applications, or AI workflows.
Jump to Available dataAvailable data
The Version 4 SEO API includes Backlinks, Keyword reports, and Domain Analytics methods.
Jump to BacklinksBacklinks
Jump to Keyword reportsKeyword reports
Jump to Domain AnalyticsDomain Analytics
Jump to Get accessGet access
You need access to the SEO API and a Version 4 API key, which is assigned to each user after subscribing to Semrush. For help setting up API access, refer to API access.
Requests use API units. For the price of a method, refer to its reference.
Jump to AuthorizationAuthorization
You’ll find your API key in the API keys section of your Semrush profile.
Include your API key in the Authorization header of every request:
curl -H 'Authorization: Apikey YOUR_API_KEY' \
'https://api.semrush.com/apis/v4/domain-analytics/v1/domain-summaries/monthly?url=example.com&scope=ROOT_DOMAIN&country=US&device_type=DESKTOP'Jump to Response formatResponse format
All SEO API methods return JSON by default. Backlinks and Keyword reports methods also return CSV: set format=csv where the method supports the format parameter.
Successful JSON responses contain:
meta: Request details, includingrequest_id,status_code, andsuccess.data: Results. List methods return an array, and summary methods return an object.
The method reference lists the response fields and includes response examples.
Jump to Request parametersRequest parameters
The parameters depend on the method:
- Target: Most methods use
urlandscope.scopesupportsROOT_DOMAIN,SUBDOMAIN,SUBFOLDER, andPAGE, though some methods support fewer values. Competitor and subdomain methods usedomain, and keyword methods usekeyword. Comparison methods take several targets, for example,urlsortarget_urlandcompetitor_url. - Database: Domain Analytics and Keyword reports methods use
country. Domain Analytics methods also usedevice_type. To check whichcountryanddevice_typepairs are supported, use Get Supported Countries. - Time period: Monthly methods use
monthin theYYYY-MMformat. Trend and history methods usedate_fromanddate_to, and organic search change methods usebase_monthandcomparison_month, in the same format. - Fields, sorting, and pagination: Where supported, use
fieldsto select response fields,order_byanddirectionto sort results, andlimitandoffsetto page through them. For field names, refer to Columns. - Filtering: Many methods support the
filterparameter. The syntax is shared, but the available fields, operators, and value formats depend on the section and method. For the syntax and the differences between sections, refer to Advanced filtering.
Jump to Advanced filteringAdvanced filtering
Most API endpoints provide standard query parameters for filtering and sorting results.
Use the filter parameter when standard parameters are insufficient, for example, when you need comparison operators such as >, pattern matching such as LIKE, or logical disjunction such as OR.
The filter syntax is the same in all sections, but the available fields, operators, and value formats depend on the section and method. For example, cpc is in USD cents in Keyword reports and in USD in Domain Analytics. For the fields you can filter by, refer to the filter parameter in the method reference.
Jump to SyntaxSyntax
The filter parameter uses the following format: Field Operator Value. Combine conditions with AND and OR, and use parentheses for grouping.
source_url LIKE "https://blog.%" AND page_score > 50search_volume > 100 AND keyword_difficulty <= 49volume > 1000 AND keyword CONTAINS "buy"Jump to Supported operatorsSupported operators
LIKE, and NOT LIKE. With LIKE and NOT LIKE, use % as a wildcard.=, !=, >, >=, <, <=. The keyword field: =, !=, CONTAINS, WORD_MATCH. The intents and serp_features arrays: HAS.=, !=, >, >=, <, <=. CONTAINS for text fields. STARTS_WITH, ENDS_WITH, and IN in Monthly Ranked Pages. HAS_ANY for SERP feature fields.Jump to Data typesData types
- Strings: Wrap in double quotes. Backlinks methods also accept single quotes.
- Numbers: Keyword reports accept non-negative integers, and
cpcis in USD cents. Domain Analytics accepts integers and decimals, andcpcis in USD, filtered by its numeric value without the currency, for example,cpc > 2.50. - Booleans:
trueorfalse, case-insensitive. - Lists or arrays: Use parentheses and separate items with commas, for example,
keyword_serp_features HAS_ANY ("REVIEWS", "AI_OVERVIEW").
Jump to ColumnsColumns
These columns apply to Backlinks and Keyword reports methods. Domain Analytics field names, such as volume, competition_density, and results, are listed in each method’s reference. In Domain Analytics, cpc is in USD.
For v4 methods that support the fields query parameter, you can use these field names to include only the data relevant to your analysis. Keyword reports methods have no fields parameter. In List Related and List Broad Match, you can use these names in filter and order_by.
backlinks_countbacklinks_countscompetitive_densitycpcdomains_countfirst_seen_atkeyword_difficultylast_seen_atnumber_of_resultsscoresearch_volumeserp_featurestrendsJump to Error handlingError handling
When a request fails, the API returns a structured error response. Check the HTTP status and the error object. If the response includes error.retryable, don’t retry requests marked false.
{
"meta": {
"success": false,
"status_code": 403,
"request_id": "a29952029c10a47e5876d86256e59455"
},
"error": {
"code": 403,
"message": "Forbidden",
"retryable": false,
"details": {}
}
}Jump to Response fieldsResponse fields
meta.successmeta.status_codemeta.request_iderror.codeerror.messageerror.retryableerror.detailsJump to HTTP status codesHTTP status codes
400 Bad Request401 Unauthorized403 Forbidden404 Not Found409 Conflict429 Too Many Requests499 Client Closed Request500 Internal Server Error501 Not Implemented503 Service Unavailable504 Gateway TimeoutWhen contacting Support, include the request, response, and meta.request_id. For more help, refer to Troubleshooting.
Jump to FAQFAQ
Jump to What data can I retrieve with the SEO API?What data can I retrieve with the SEO API?
The Version 4 SEO API provides backlink, keyword, and domain analytics data through the Backlinks, Keyword reports, and Domain Analytics methods. For an overview by data type, refer to Available data.
Jump to What can I build with the SEO API?What can I build with the SEO API?
You can build SEO dashboards, reporting tools, internal applications, AI-powered workflows, and custom integrations using Semrush SEO data. To make your first request, refer to the Quick start guide.
Jump to Why should I use Version 4 Semrush API?Why should I use Version 4 Semrush API?
Version 4 Semrush API is the recommended version for new integrations. It uses modern authorization and provides JSON responses. To compare what each version covers, refer to API versions.
Last updated: November 13, 2026