Skip to content

About

Domain Research API: the organic keywords any domain ranks for, its SEO competitors, top pages, subdomains, keyword gap vs a competitor, traffic estimates and monthly history, as JSON in 94 markets. Python, Node.js, Go, PHP and cURL examples.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Domain Research API

Semust Domain Research API: organic keywords, competitors and traffic for any domain

Get API key Documentation MCP server License: MIT

The Semust Domain Research API shows what any domain ranks for on Google: its organic keywords with positions and ranking URLs, its organic competitors, its top pages and subdomains, the keyword gap against a competitor, estimated traffic for up to 1,000 domains at once, and up to five years of monthly history. Send a domain and a market, and get clean JSON back. No crawling, scraping or spreadsheets on your side.

It is built for SEO teams, agencies and developers who need competitor research, keyword gap analysis, content planning, prospecting and market sizing. The API is part of the Semust SEO platform.

How it works

Your code sends POST /v1/domain-research to Semust and receives the domain's SEO data as JSON. Long requests return 202 and are collected from /v1/tasks.

1. Get your API credentials

Create an API user on the Semust API access page. You get a username and a password. Every request sends them as two headers:

Header Value
SEMUST-API-USER Your API username
SEMUST-API-PASSWORD Your API password

The examples in this repository read them from environment variables, so they never end up in your code:

export SEMUST_API_USER="your_username"
export SEMUST_API_PASSWORD="your_password"

Tip

There is no subscription. You top up a prepaid balance and pay only for successful requests; failed requests are refunded automatically. Prices are on the Domain Research API page.

2. Send a request

import os, time, requests

HEADERS = {
    "SEMUST-API-USER": os.environ["SEMUST_API_USER"],
    "SEMUST-API-PASSWORD": os.environ["SEMUST_API_PASSWORD"],
}

resp = requests.post(
    "https://data.semust.com/v1/domain-research",
    params={"wait": 60},
    headers=HEADERS,
    json={"type": "keywords", "domain": "nytimes.com", "country": "US", "language": "en", "limit": 10},
    timeout=90,
)
while resp.status_code == 202:  # still running: poll the task
    time.sleep(int(resp.headers.get("Retry-After", 5)))
    resp = requests.get(resp.json()["poll_url"], headers=HEADERS, timeout=30)

for row in resp.json().get("items", []):
    print(row["position"], row["keyword"], row["volume"], row["url"])

3. Run the examples

Language File Run
Python examples/python/domain_research.py python domain_research.py nytimes.com overview
Python, keyword gap to CSV examples/python/keyword_gap.py python keyword_gap.py yourdomain.com competitor.com --country US
Node.js 18+ examples/node/domain_research.mjs node domain_research.mjs nytimes.com overview
Go examples/go/main.go go run . nytimes.com overview
PHP examples/php/domain_research.php php domain_research.php nytimes.com overview
cURL examples/curl/domain_research.sh ./domain_research.sh

Request parameters

POST https://data.semust.com/v1/domain-research with a JSON body. One endpoint serves eight reports, chosen with type.

Parameter Type Default Description
type string overview The report to run. See the next table.
domain (required) string – The domain to research, e.g. example.com. A scheme, www., a path, a port or an sc-domain: prefix is removed for you; internationalised domains are converted to punycode. Not used by traffic_estimate.
country string TR Market, ISO 3166-1 alpha-2 (US, GB, DE, TR, …). 94 markets are supported.
language string the market's main language A language the market is indexed in, e.g. en or es for US.
idempotency_key string – Up to 128 characters. Same effect as the Idempotency-Key header.

Report types

type Returns Extra parameters sort values (first is the default)
overview One summary: organic keywords, estimated traffic and its value, keywords in the top 3 / 10 / 20 / 100, new, lost, improved and declined keywords, and the paid search totals. – –
keywords The keywords the domain ranks for, with volume, CPC, difficulty, intent, position, ranking URL and estimated traffic. paging, min_volume, max_position, intent, contains traffic, volume, position, difficulty, cpc
competitors Domains that rank for the same keywords, with the overlap and their own size. paging common_keywords, avg_position
top_pages The domain's pages ranked by the organic traffic they earn. paging traffic
keyword_gap Keywords compared with a competitor: the ones it ranks for and you do not (default), the ones you share, or the ones only you rank for. paging, competitor (required), mode, min_volume, intent, contains volume, difficulty, cpc
subdomains The domain's subdomains ranked by organic traffic. paging traffic, keywords
traffic_estimate Organic and paid keywords and traffic for a list of domains in one call. domains (required), replaces domain –
history The overview numbers month by month, oldest first. months –

Paging, filters and report options

Parameter Type Default Description
limit integer 100 Rows per page, 1–1000. Every row returned is billed.
page integer 1 Page number. page × limit can be at most 10,000.
sort string see the table above Sort field for the report.
direction string desc (asc for position and avg_position) asc or desc.
min_volume integer – Only keywords with at least this monthly search volume.
max_position integer – Only keywords where the domain ranks at this position or better, 1–100. keywords only.
intent string – informational, navigational, commercial or transactional.
contains string – Only keywords that contain this text, 1–80 characters, case-insensitive (% and _ are not allowed).
competitor string – The domain to compare with, for keyword_gap. Must differ from domain.
mode string missing For keyword_gap: missing (competitor ranks, you do not), shared (both rank) or unique (only you rank).
domains array – For traffic_estimate: 1–1000 domains. Duplicates are removed after clean-up; rows come back in the order sent.
months integer 12 For history: months back from the current one, 1–60.

A parameter that a report does not take is refused with PARAMETER_NOT_ALLOWED rather than silently ignored, and a misspelt one gets a "did you mean" hint.

Query parameter Default Description
wait 60 Seconds to hold the connection before answering 202, 0–80. 0 answers 202 at once (fire and collect).
Header Description
Idempotency-Key Optional, up to 128 characters. Repeating a request with the same key returns the same task and is charged once.
Accept-Language Optional. Send tr to receive error messages in Turkish.

Markets. GET https://data.semust.com/v1/domain-research/markets (same headers, free) lists every supported country with its languages: {"success": true, "default_country": "TR", "markets": [{"country": "US", "name": "United States", "languages": ["en", "es"]}, …]}.

Output sample

Domain overview for nytimes.com in the US returned by the Semust Domain Research API

The response for {"type": "overview", "domain": "nytimes.com", "country": "US", "language": "en"}. The same file, with the per-call request_id removed, is in output-domain-research-api.json.

{
  "success": true,
  "type": "overview",
  "domain": "nytimes.com",
  "country": "US",
  "language": "en",
  "data": {
    "organic": {
      "keywords": 9424831,
      "traffic": 54631535,
      "traffic_value_usd": 103626106.62,
      "top3": 329233,
      "top10": 1636538
    },
    "paid": {
      "keywords": 13,
      "traffic": 17256,
      "traffic_value_usd": 75122.16
    }
  },
  "cost": 0.013332,
  "cached": false
}

List reports (keywords, competitors, top_pages, keyword_gap, subdomains, traffic_estimate, history) answer with items instead of data, plus total and count. The shape of a keywords response, values elided:

{
  "success": true,
  "type": "keywords",
  "domain": "…",
  "country": "US",
  "language": "en",
  "total": "…",
  "count": "…",
  "page": 1,
  "limit": 100,
  "sort": "traffic",
  "direction": "desc",
  "items": [
    {
      "keyword": "…",
      "volume": "…",
      "cpc": "…",
      "difficulty": "…",
      "intent": "…",
      "position": "…",
      "url": "…",
      "traffic": "…"
    }
  ],
  "cost": "…",
  "cached": false,
  "request_id": "…"
}

JSON output structure

Top-level fields

Field Type Description
success boolean true when the request succeeded.
type, domain, country, language string What was actually queried, after clean-up and defaults. traffic_estimate has no domain; each row names its own.
competitor, mode string The comparison applied (keyword_gap).
months integer The months asked for (history).
data object The summary (overview only).
items array The rows (every other report).
total integer Rows that exist for the query (list reports).
count integer Rows in this response; this is what you are billed for.
page, limit, sort, direction The paging and order applied (paged reports).
cost number What this request cost, in USD.
cached boolean true when the answer was served from a recent identical request. The ranking index refreshes monthly.
request_id string The task id. GET /v1/tasks/{request_id} returns the same response for 72 hours.

overview data (data.organic; data.paid has keywords, traffic and traffic_value_usd)

Field Type Description
keywords integer Keywords the domain ranks for in the top 100.
traffic integer Estimated monthly organic visits.
traffic_value_usd number What that traffic would cost as paid search, in USD.
top3, top10, top20, top100 integer Keywords ranking at or above that position. Cumulative: top10 includes top3.
new, lost integer Keywords that entered or left the rankings since the previous update.
improved, declined integer Keywords whose position went up or down.

keywords row

Field Type Description
keyword string The search query.
volume integer | null Average monthly searches.
cpc number | null Average cost per click, USD.
difficulty integer | null Ranking difficulty, 0–100.
intent string | null informational, navigational, commercial or transactional.
position integer | null The domain's position.
url string | null The page that ranks.
traffic integer | null Estimated monthly visits from this keyword.

Other rows

Report Fields
competitors domain, common_keywords (keywords both rank for), avg_position (the competitor's average position on those), keywords and traffic (the competitor's whole domain)
top_pages url, keywords, traffic, top3, top10
keyword_gap keyword, volume, cpc, difficulty, intent, position and url (yours, null in mode: missing), competitor_position and competitor_url (null in mode: unique)
subdomains subdomain, keywords, traffic, top3, top10
traffic_estimate domain, keywords, traffic, paid_keywords, paid_traffic (zeros for a domain with no data)
history month (YYYY-MM), organic and paid with the same fields as overview

Every documented field is on every row. A value the index does not have is null, never a missing key.

Long-running requests (202 and polling)

Most requests finish in a few seconds and return 200 with the result. If a request is still running after wait seconds (60 by default, maximum 80), the API returns 202 Accepted with a task_id instead. Nothing is lost and you are not charged twice:

  1. Read task_id from the body (also in the X-Task-Id header).
  2. Wait Retry-After seconds.
  3. Call GET https://data.semust.com/v1/tasks/{task_id} with the same headers until the status is no longer 202. The final answer is exactly what the original request would have returned.

Every example in examples/ already handles this. Results stay available for 72 hours, and fetching them again is free. Set your HTTP client's read timeout above wait (for example wait + 30 seconds). Send an Idempotency-Key header to retry a request safely without paying twice. Details: Tasks & long-running requests.

Errors

Errors return JSON with a readable error, a stable code and retryable; where it helps also field, hint and allowed (the valid values). Failed requests are not charged.

HTTP code Meaning
400 INVALID_JSON, UNKNOWN_PARAMETER, INVALID_PARAMETER The body is not a JSON object, a parameter is unknown (hint suggests the closest one), or a value is out of range (field names it).
400 INVALID_TYPE, PARAMETER_NOT_ALLOWED Unknown type, or a parameter this type does not take.
400 DOMAIN_REQUIRED, COMPETITOR_REQUIRED, INVALID_DOMAIN domain or competitor is missing, or a value is not a domain (an IP address, localhost, no TLD).
400 UNSUPPORTED_MARKET, PAGE_OUT_OF_RANGE Country or language not covered (see /v1/domain-research/markets), or page × limit over 10,000.
401 MISSING_CREDENTIALS, INVALID_CREDENTIALS, CREDENTIALS_EXPIRED Check the two auth headers.
402 INSUFFICIENT_CREDITS Your balance does not cover the request; required and balance say by how much.
403 IP_NOT_WHITELISTED, SERVICE_NOT_ENABLED Your API user only accepts listed IP addresses, or Domain Research is not enabled for it.
409 REQUEST_IN_PROGRESS A request with the same idempotency key is still running.
413 REQUEST_TOO_LARGE The body is over 128 KB.
429 RATE_LIMIT_EXCEEDED, TOO_MANY_CONCURRENT_REQUESTS, TOO_MANY_PENDING_TASKS Per-minute or per-day limit reached, or too many requests running at once. Wait Retry-After seconds.
500 INTERNAL_ERROR Something went wrong on our side. Quote request_id to support.
503 REQUEST_FAILED, SERVICE_BUSY, SERVICE_UNAVAILABLE, TIMEOUT Temporary failure. Retry when retryable is true, with the same Idempotency-Key.

Pricing

$0.0132 per request plus $0.132 per 1,000 rows returned. overview is one row ($0.013332); a keywords page of 100 rows costs $0.0264 and 1,000 rows $0.1452. traffic_estimate is billed one row per domain sent. history has its own price: $0.132 per request plus $0.00132 per month returned (12 months: $0.14784). The full worst case is reserved before the request runs and the unused part is returned at once, so limit is the most you can pay for. Failed requests are refunded automatically. Current prices are on the Domain Research API page.

Use cases

  1. Competitor research. List who competes with a site in organic search, how much they overlap and how big they are, then pull each competitor's top pages.
  2. Keyword gap analysis. Find the keywords a competitor ranks for and you do not, sorted by search volume. Start from keyword_gap.py, which writes them to a CSV.
  3. Content planning. Filter a domain's keywords by intent, min_volume and contains to build topic clusters and content briefs from what already earns traffic.
  4. Prospecting and market sizing. Estimate organic traffic for up to 1,000 domains in one traffic_estimate call to qualify leads, size a niche or rank a list of publishers.
  5. SEO reporting and AI agents. Track a domain's keywords, traffic and top-10 count month by month with history, or give an AI agent structured domain data instead of guesses.

Why Semust

  • Pay as you go. No monthly plan or minimum commitment for the API. Top up once, pay per successful request, and get failed requests refunded automatically.
  • One account, every SEO dataset. SERP, keyword data, backlinks, domain research, YouTube, Google Trends, Lighthouse and Google Business data use the same credentials, the same error format and the same task system.
  • Any country, any language. Localised results for every Google market, including strong coverage of Türkiye and Turkish-language queries.
  • Built for AI workflows. Plug the same data into Claude, Cursor or ChatGPT with the open-source Semust MCP server.

FAQ

Which countries and languages are supported?

94 markets, each with the languages it is indexed in. GET /v1/domain-research/markets returns the full list for free. Note that country defaults to TR, so send it explicitly for any other market.

How fresh is the data?

The ranking index is refreshed monthly. new, lost, improved and declined compare with the previous update, and history gives one row per month. An identical request made shortly after another may be answered from the stored result, marked cached: true.

How do I get more than 1,000 keywords?

Page through them with page and limit. Up to 10,000 rows are reachable per query; to go deeper, narrow the query with min_volume, max_position, intent or contains and run it again.

What is the difference between overview and traffic_estimate?

overview is the full summary for one domain, including position buckets and keyword movement. traffic_estimate returns only keywords and traffic, organic and paid, for up to 1,000 domains in one request, billed one row per domain.

Can I control how much a request costs?

Yes. The price depends on the rows returned, so limit caps it. The worst case is reserved before the request runs, and a query that matches fewer rows is charged only for what it returns.

Can I use it from Claude, ChatGPT or Cursor?

Yes. The Semust MCP server connects your Semust account to AI assistants, and the SEO MCP gives them Search Console, rank tracking and competitor tools.

Learn more

Related repositories

SEO data APIs

Repository What it does Product page
google-serp-scraper Organic results, People Also Ask, AI Overviews, ads and more as JSON Google SERP API
google-images-scraper Google Images results with titles, source pages and image URLs Google Images API
youtube-scraper YouTube search, video details, transcripts and comments YouTube API
google-trends-scraper Interest over time, regions, related queries and demographics Google Trends API
google-business-scraper Google Business profiles, local search and reviews Google Business Data API
keyword-research-api Search volume, CPC, competition, intent and related keywords Keyword Research API
backlinks-api Backlinks, referring domains, anchors and link history Backlinks API
technical-seo-api 27 technical SEO checks for any URL in one call Technical SEO API
lighthouse-on-page-api Lighthouse scores, on-page audits and page content extraction Lighthouse & On-Page API

MCP servers for AI assistants

Repository What it does Product page
semust-mcp One MCP server for Search Console, GA4, Google Ads, rank tracking and social posting Semust MCP Server
seo-mcp Search Console, rank tracking, indexing and competitor tools for AI assistants SEO MCP
google-search-console-mcp Ask your AI assistant about clicks, queries and pages Google Search Console MCP
google-analytics-mcp GA4 traffic, channels and conversions in your AI assistant Google Analytics MCP
google-ads-mcp Campaigns, search terms and spend in your AI assistant Google Ads MCP
rank-tracker-mcp Keyword rankings and AI-search visibility for AI assistants Rank Tracker MCP
web-analytics-mcp Privacy-friendly first-party analytics in your AI assistant Web Analytics MCP
bing-webmaster-mcp Bing queries, pages, links and crawl issues Bing Webmaster MCP
yandex-metrica-mcp Yandex Metrica traffic and search phrases Yandex Metrica MCP
social-media-mcp Draft and schedule LinkedIn, Facebook and Instagram posts Social Media MCP

Support

Found a problem with an example? Open an issue.

License

The code examples in this repository are released under the MIT License. Use of the Semust API is subject to the Semust Terms of Service.

About

Domain Research API: the organic keywords any domain ranks for, its SEO competitors, top pages, subdomains, keyword gap vs a competitor, traffic estimates and monthly history, as JSON in 94 markets. Python, Node.js, Go, PHP and cURL examples.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors