Semrush API: SEO Data as JSON
To get Semrush SEO data as JSON, call GET /v1/semrush/domain-overview?domain=…: the recorded call returned authority_score, organic_keywords, organic_traffic, backlinks_count, referring_domains_count and monthly visit history for one domain, for 1 credit. Nine more endpoints cover competitors, website traffic, trending domains by country and category, keyword suggestions and ranking-change data. All ten are restricted endpoints. This guide shows the requests, the parameters, recorded responses, a Python domain tracker and the cost.
What does the Semrush API on Perceptlayer cover?
The Semrush API on Perceptlayer has ten endpoints that return domain-level and keyword-level SEO data as JSON. Three take a domain and describe it: an overview, its competitors and its traffic. Four return market-level data: trending domains and three ranking-change endpoints keyed by database, category and date. The rest are a keyword suggester, a facets list of allowed values, and a review-link generator for a business listing.
| Method | Path | Returns | Credits | Required | Optional |
|---|---|---|---|---|---|
GET |
/v1/semrush/domain-overview |
SEO and traffic metrics for a domain | 1 | domain |
none |
GET |
/v1/semrush/domain-competitors |
A domain's competitors | 1 | domain |
none |
GET |
/v1/semrush/website-traffic |
Traffic metrics for a domain | 1 | domain |
none |
GET |
/v1/semrush/trending |
Trending domains | 1 | none | country, category |
GET |
/v1/semrush/sensor-ranks |
A value per date | 1 | none | db, category, date |
GET |
/v1/semrush/sensor-movers |
Domains that moved on a date | 1 | db, category, date |
none |
GET |
/v1/semrush/sensor-serp-features |
Search-feature rows | 1 | db, category, date |
none |
GET |
/v1/semrush/suggest |
Keyword suggestions | 1 | q |
none |
GET |
/v1/semrush/facets |
Allowed parameter values | 1 | none | none |
POST |
/v1/semrush/local-review-qr |
A review link for a business | 1 | business_name, place_id |
none |
These are Perceptlayer endpoints, collected from publicly available sources and returned as found at the time of the call. This guide makes no claims about Semrush's own API or plans; compare those yourself. The Semrush API page has a playground for each endpoint.
Which terms apply to the Semrush endpoints?
All ten Semrush endpoints are restricted. They work after you accept the restricted-endpoint terms in your dashboard; until then, a call returns restricted_endpoint (403) and costs nothing. The terms don't permit collecting personal data without a lawful basis, or using data from these endpoints to contact people. Keep your use aggregate: domains, keywords, categories and markets.
In practice this data is about websites and search terms, and that's how this guide uses it: comparing domains, watching a market category and finding keyword ideas. Don't join it with data about the people behind a site, and don't build contact lists from it. The local-review-qr endpoint returns a review link for a business you name; use it for your own or a client's business listing.
Which parameters do the Semrush endpoints take?
The parameters are short and mostly enumerated. The domain endpoints take a string of up to 253 characters. The three sensor endpoints share db, category and date; sensor-ranks makes all three optional, while sensor-movers and sensor-serp-features require them. trending takes a lowercase country code (or global) and a category slug (or all). Nothing else is documented, such as defaults.
| Parameter | Endpoints | Type | Documented values |
|---|---|---|---|
domain |
domain-overview, domain-competitors, website-traffic |
string | Up to 253 characters |
db |
sensor endpoints | string | AU, CN, DE, ES, FR, IT, JP, UK, US, and MOBILE- versions of all but CN |
category |
sensor endpoints | integer | 1 to 25 |
date |
sensor endpoints | string | The facets response gives date_format as YYYY-MM-DD |
country |
trending |
string | Two-letter lowercase codes such as us, gb, de, plus global |
category |
trending |
string | Slugs such as advertising-and-marketing, retail, travel-and-tourism, plus all |
q |
suggest |
string | Up to 255 characters |
business_name, place_id |
local-review-qr |
string | Up to 255 characters each |
The sensor category integers have no documented names, and the recorded facets response lists them only as numbers, so keep your own note of which category you query. Call GET /v1/semrush/facets (no parameters) to read the current allowed dbs, categories, countries and trending categories at runtime.
What does a domain overview return?
GET /v1/semrush/domain-overview returns one domain's SEO metrics at the top level and a website object with traffic, rankings, backlinks and history. Unlike many Perceptlayer APIs, the Semrush responses have no data wrapper: fields sit at the top level next to a search_parameters echo of the request. The recorded request sends the bare domain, with no scheme:
curl "https://api.perceptlayer.com/v1/semrush/domain-overview?domain=semrush.com" \
-H "X-API-Key: $API_KEY"
{
…
"domain": "semrush.com",
"covered": true,
"coverage": {
"domain_metrics": true,
"backlink_counts": true,
"website_traffic": true
},
"semrush_rank": 845,
"organic_keywords": 451415,
"organic_traffic": 2823377,
"organic_traffic_cost": 7522712,
"authority_score": 88,
"backlinks_count": 35114474,
"referring_domains_count": 197945,
"organic_search_traffic": 17365677,
…
"website": {
…
"actual_date": "2026-10-15",
…
"visits": 48357533,
"engagement": {
"pages_per_visit": 3.79,
"avg_visit_duration_seconds": 441,
"bounce_rate": 0.5608
},
"visits_history": [
{
"date": "2026-10-01",
"visits": 48357533
},
…
],
…
"top_keywords": [
…
{
"keyword": "keyword research",
"position": 1,
"search_volume": 1000000,
"cpc": 7.36,
"traffic_share": 0.0288,
"intents": "2"
}
],
"traffic_by_country": [
{
"country": "US",
"country_name": "United States",
"traffic": 10729671,
"traffic_share": 0.2219,
…
},
…
],
…
}
}
| Field | What a domain tracker does with it |
|---|---|
covered, coverage |
Whether the domain has data, and which parts |
authority_score |
A single score to compare domains |
organic_keywords, organic_traffic |
Search footprint over time |
backlinks_count, referring_domains_count |
Link profile size |
website.visits, website.visits_history |
Monthly visits, with history |
website.top_keywords |
Keywords, positions and search volume |
website.traffic_by_country |
Where traffic comes from |
Check covered before reading the metrics, and treat each field as optional. website-traffic returns the same traffic block on its own (in the recording, visits 48,357,533 matches), so call it instead when you only need traffic.
How do you find a domain's competitors?
GET /v1/semrush/domain-competitors takes the same domain parameter and returns a summary of that domain and a competitors array. Each competitor carries domain, global_rank, country_rank, authority_score, visits, pages_per_visit, avg_visit_duration_seconds and bounce_rate; some also carry a brand_name and description. Trimmed to one competitor:
{
…
"covered": true,
"domain": "semrush.com",
"summary": {
"domain": "semrush.com",
…
"authority_score": 88,
"visits": 47186546,
…
},
"competitors": [
…
{
"domain": "atlaq.com",
"global_rank": 7399,
…
"authority_score": 58,
"visits": 7982148,
"pages_per_visit": 1.2409,
"avg_visit_duration_seconds": 170,
"bounce_rate": 0.8413
}
]
}
The summary.visits here, 47,186,546, differs from the overview's 48,357,533, and matches the overview's September device_history entry, so the two endpoints can report different months. Record the endpoint and call time with every figure. A competitor's domain has the same shape as the domain parameter, so you can pass it to domain-overview, though the recordings don't show that chain.
Which endpoints show market-level trends?
Four endpoints describe a market rather than one domain. trending lists domains for a country and category with total_traffic, a desktop and mobile split, mom, yoy and top_source, plus a traffic_series for the whole set. The recorded country=global&category=all call starts with google.com at total_traffic 108,899,227,055. The API doesn't document the units of mom and yoy, so compare them only with each other.
curl "https://api.perceptlayer.com/v1/semrush/trending?country=global&category=all" \
-H "X-API-Key: $API_KEY"
The three sensor endpoints are keyed by db, category and date. In the recordings, sensor-ranks for db=US&category=1 returned row_count 30 with a rank per date (1.8 on 2026-10-14, 0.9 on 2026-10-15). sensor-movers for 2026-07-28 returned domains with diff, keywords, new_keywords and lost_keywords, and per-category avg_drop and avg_raise. sensor-serp-features for the same date returned row_count 0, so an empty result is a valid response. None of these values have documented units.
How do keyword suggestions work?
GET /v1/semrush/suggest takes a phrase in q and returns a suggestions array of strings. The recorded call for q=best seo returned one suggestion, "best seo company". At 1 credit a call, it suits a keyword list you build once and grow slowly, not a bulk keyword expansion.
How do you track domains in Python?
A domain tracker calls domain-overview for a fixed list of domains on a schedule and appends one row per domain with the headline metrics. Weekly runs give you a history of each domain's search footprint and links. The script below uses requests and csv and reads only fields that appear in the recorded response.
import csv
import datetime
import os
import time
import requests
API_KEY = os.environ["API_KEY"]
URL = "https://api.perceptlayer.com/v1/semrush/domain-overview"
DOMAINS = ["semrush.com", "example.com"]
def overview(domain, attempts=3):
for _ in range(attempts):
r = requests.get(URL, params={"domain": domain}, headers={"X-API-Key": API_KEY}, timeout=60)
if r.status_code in (429, 503):
time.sleep(int(r.headers.get("Retry-After", "5")))
continue
r.raise_for_status()
return r.json()
raise RuntimeError(f"gave up on {domain}")
now = datetime.datetime.now(datetime.timezone.utc).isoformat()
with open("domains.csv", "a", newline="") as f:
out = csv.writer(f)
for domain in DOMAINS:
d = overview(domain)
if not d.get("covered"):
out.writerow([now, domain, "not covered"])
continue
site = d.get("website") or {}
out.writerow([
now, domain, d.get("authority_score"), d.get("organic_keywords"),
d.get("organic_traffic"), d.get("backlinks_count"),
d.get("referring_domains_count"), site.get("visits"),
site.get("actual_date"),
])
time.sleep(1)
The one-second pause keeps a free account within its 1 request a second. Store actual_date with each row: it's the date the recorded website data refers to, and it differs from your call time.
What should the job do with errors?
Every error returns an HTTP status and a JSON body with code, message and request_id, and costs nothing. A restricted_endpoint (403) means the terms aren't accepted yet. Retry rate_limited (429) and temporarily_unavailable (503) after the Retry-After seconds, and fix invalid_parameters (422) in your input. Requests have no idempotency key, so a client timeout may hide a billed call. The errors docs list every code.
What does Semrush data cost?
Every successful call to any of the ten endpoints costs 1 credit, and a failed call costs nothing and returns X-Credits-Used: 0. The cost of a job is the number of calls, so count domains, endpoints and runs.
| Plan | Arithmetic | Credits a month |
|---|---|---|
| 20 domains weekly, overview and competitors | 20 × 2 × 4 weeks × 1 credit | 160 |
| 50 domains weekly, overview | 50 × 4 weeks × 1 credit | 200 |
10 sensor categories daily, one db |
10 × 30 days × 1 credit | 300 |
| 300 domains daily, overview | 300 × 30 days × 1 credit | 9,000 |
All four fit the Starter pack's 10,000 credits. The 100 free credits on signup cover 100 calls, enough to run the 50-domain weekly plan for two weeks. Purchased credits last 12 months. See pricing for what credits cost and the credits docs for how calls are debited.
To try it, accept the restricted-endpoint terms, then run domain=semrush.com in the playground on the domain overview page. Get a free API key to run your own domain list. Other SEO sources are on the web and SEO APIs page, and more guides are in API guides.
APIs in this post
Frequently asked questions
Is this Semrush's official API?
No. These are Perceptlayer endpoints that return Semrush data collected from publicly available sources, returned as found at the time of the call. This guide makes no claims about Semrush's own API, plans or terms, so compare them yourself. All ten endpoints are restricted and need the restricted-endpoint terms accepted before they work.
Do I need to accept terms to use the Semrush endpoints?
Yes. All ten are restricted endpoints. Accept the restricted-endpoint terms in your dashboard first; until then, calls return restricted_endpoint (403) and cost nothing. The terms don't permit collecting personal data without a lawful basis or using the data to contact people, so keep to domains, keywords, categories and markets.
What does one Semrush call cost?
Each successful call to any of the ten endpoints costs 1 credit, and failed calls cost nothing. A weekly check of 50 domains with domain-overview is 50 × 4 weeks × 1 credit = 200 credits a month. The 100 free credits on signup cover 100 calls to try it.
Which country databases do the sensor endpoints support?
The db parameter accepts AU, CN, DE, ES, FR, IT, JP, UK and US, plus MOBILE- versions of all of them except CN. The category parameter accepts integers from 1 to 25, without documented names. Call the facets endpoint to read the allowed values at runtime.
What happens if a domain has no data?
The domain endpoints return a covered field, true in every recording, and domain-overview adds a coverage object with domain_metrics, backlink_counts and website_traffic flags. Check covered before reading metrics, and treat every field as optional. No recording shows an uncovered domain, so test one in the playground.