# Domain Analysis | SE Ranking SEO & AI Search API (`se_ranking/domain-analysis`) Actor

This collection of endpoints allows you to perform in-depth competitive analysis on any domain. Use these requests to uncover keyword strategies, traffic trends, and competitor performance in both organic and paid search.

- **URL**: https://apify.com/se_ranking/domain-analysis.md
- **Developed by:** [SE Ranking](https://apify.com/se_ranking) (community)
- **Categories:** SEO tools, AI, Developer tools
- **Stats:** 5 total users, 1 monthly users, 4.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What is SE Ranking Domain Analysis API Actor?

**SE Ranking Domain Analysis** gives you search-performance data for any domain or URL straight from [SE Ranking's Data API](https://seranking.com/api/data/domain-analysis/): organic and paid keywords, traffic estimates, position changes, top pages, subdomains, competitors, keyword gaps and paid ads. Pick an endpoint, enter a domain, press **Start**, and get the result as a dataset you can download as JSON, CSV or Excel or pull through the Apify API.

The data is refreshed monthly and covers 188+ regional databases, so you can compare a domain's visibility in the US, the UK, Germany or any other market.

#### What can this Actor do?

- 🔎 **Domain overview** for one regional database or worldwide (organic and paid keywords, traffic, traffic value, top-position distribution)
- 📈 **History** - monthly trends of keywords and traffic for a domain
- 🔑 **Keyword rankings** with positions, volume, CPC, difficulty, intent, SERP features, and 25+ filters
- 📄 **Top pages** and 🌐 **subdomains** with traffic and keyword counts
- 🥊 **Competitors** and **keyword gap / overlap** between two domains
- 📢 **Paid ads** - which ads a domain runs, or who advertises on a keyword
- ⏱️ Runs on the Apify platform: schedule it, call it through the API, connect it to Make, n8n, Zapier or Google Sheets, and get notified when a run fails

#### What data can you extract?

| Endpoint (choose in the *Endpoint* field) | What you get |
|---|---|
| Get domain overview by region (`overview/db`) | Organic + paid keyword counts, traffic, traffic value, position changes for one country database |
| Get worldwide domain overview (`overview/worldwide`) | The same metrics aggregated worldwide, optionally split by country |
| Get worldwide URL overview (`overview/worldwide/url`) | Worldwide keywords, traffic and traffic value for a single URL |
| Get domain traffic & keyword history (`overview/history`) | One row per month: keywords, traffic, traffic value, top-position buckets |
| Get domain keyword rankings (`keywords`) | One row per keyword: position, previous position, volume, CPC, competition, difficulty, intents, SERP features |
| Get domain pages (`pages`) | One row per ranking page: keywords, traffic, traffic share, intent split |
| Get domain subdomains (`subdomains`) | One row per subdomain with keywords, traffic and traffic value |
| Get paid ads (`ads`) | Keywords a domain advertises on, or domains advertising on a keyword, with ad copy and landing pages |
| Get domain competitors (`competitors`) | Competing domains with common keywords, relevance and traffic |
| Analyze keyword overlap and gaps (`keywords/comparison`) | Keywords two domains share, or that one ranks for and the other does not |

### How to use SE Ranking Domain Analysis

1. Open the Actor and go to the **Input** tab.
2. Choose an **Endpoint**.
3. Fill in the **Base parameters** section: `domain` (or `url`) and `source`, the regional database code such as `us`, `de` or `uk`.
4. Open the section that matches your endpoint (for example *keywords parameters*) and set the options you need. Everything else is ignored for that endpoint.
5. Click **Start** and wait a few seconds.
6. Open the **Output** tab and export the dataset as JSON, CSV or Excel, or read it through the API.

#### Which fields does each endpoint use?

| Endpoint | Required fields | Notes |
|---|---|---|
| `overview/db` | `source`, `domain` or `url` | |
| `overview/worldwide` | `domain` or `url` | No `source` - it is worldwide |
| `overview/worldwide/url` | `url` | |
| `overview/history` | `source`, `domain` or `url` | `type`: organic or paid |
| `keywords` | `source`, `domain` or `url` | If both are set, `url` wins. `year` and `month` must be set together for a historical snapshot |
| `pages`, `subdomains` | `target`, `scope`, `source` | `scope`: `base_domain` or `domain` (`url` only for `pages`) |
| `ads` | `source` + `domain` **or** `keyword` | Fill `keyword` to see who advertises on it; otherwise `domain` is used |
| `competitors` | `source`, `domain` | |
| `keywords/comparison` | `source`, `domain` or `url`, `compare` | `diff`: `0` = common keywords, `1` = keyword gap |

Field names match the SE Ranking API parameter names, so the [API reference](https://seranking.com/api/data/domain-analysis/) applies one to one. The description under every field says which endpoints use it and which values are valid.

#### Filtering tips

- **Keyword text:** type it in lowercase. `filter[keyword]` and `filter[multi_keyword_included]` match case-sensitively against lowercase keywords; the Actor lowercases plain text for you.
- **Plain text is enough** for `filter[keyword]`, `filter[domain_url]`, `filter[url]` and `filter[multi_keyword_*]` - the Actor builds the JSON the API expects. For AND/OR logic in `filter[multi_keyword_included]` paste raw JSON, for example `[[{"type":"contains","value":"seo tools"},{"type":"begins","value":"free"}]]` (inner array = AND, outer array = OR; types: `contains`, `begins`, `ends`, `exact`).
- **Sorting** keeps each endpoint's own default when `order_field` and `order_type` are empty.

### How much does it cost to use SE Ranking Domain Analysis?

Each run makes one request to SE Ranking's Domain Analysis API and returns one page of results (up to the 10).

### Input and output examples

#### Input example

```json
{
  "endpoint": "keywords",
  "source": "us",
  "domain": "seranking.com",
  "type": "organic",
  "limit": 5,
  "order_field": "volume",
  "filter[difficulty][to]": 30
}
```

#### Output example (`keywords`)

Each keyword is one dataset item. Sample values:

```json
{
  "keyword": "ranking",
  "position": 4,
  "prev_pos": 4,
  "volume": 22400,
  "cpc": 0,
  "competition": 0,
  "difficulty": 59,
  "url": "https://seranking.com/",
  "traffic": 836,
  "traffic_percent": 2.09,
  "price": 0,
  "serp_features": ["sitelinks", "video", "sge", "related_searches"],
  "intents": ["I", "N"]
}
```

Overview endpoints return a single item with `organic` and `adv` blocks; list endpoints (`keywords`, `pages`, `subdomains`, `ads`, `competitors`, `keywords/comparison`, `overview/history`) return one item per row.

#### Use it through the Apify API

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('se_ranking/domain-analysis').call({
    endpoint: 'keywords/comparison',
    source: 'us',
    domain: 'seranking.com',
    compare: 'semrush.com',
    diff: '1',
    limit: 100,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### FAQ

#### How often is the data updated?

Domain Analysis data is refreshed monthly. Use `overview/history` for month-by-month trends or the `year` and `month` fields of `keywords` for a past snapshot.

#### Why is my result empty?

The usual causes:

- A filter is too narrow, or a keyword filter was typed with capital letters (see *Filtering tips*).
- `year` and `month` were not set together, or the month is outside the retention window.
- The `source` code is wrong. Use `uk` for the United Kingdom, not `gb`.
- `domain` and `url` were both set for `keywords`: `url` takes precedence and only that exact URL is analyzed.

#### How do I find keywords my competitor ranks for and I don't?

Use `keywords/comparison`, put the competitor in `domain`, yourself in `compare`, and set `diff` to `1`. Swapping the two flips the direction of the gap.

#### Are historical keyword rows different from current ones?

Yes. Historical snapshots use `previous_position` instead of `prev_pos`, return `volume` and `traffic` as strings, use long intent names such as `INFORMATIONAL`, and omit `total_sites` and `block_type`.

#### Can I schedule runs and send the data elsewhere?

Yes. Use Apify schedules for recurring runs, webhooks or integrations (Make, n8n, Zapier, Google Sheets) to move the data, and the API example above for custom code.

#### Are there usage limits?

Yes. To keep the service available for everyone, each Apify account has a fair-use limit on the number of runs (one run = one request to SE Ranking's API). When the limit is reached, the run stops with a message that tells you when the counter resets (00:00 UTC).

#### Where can I get help?

https://help.seranking.com/hc/en-us

# Actor input Schema

## `endpoint` (type: `string`):

Which Domain Analysis endpoint to call. This field is NOT sent to the API — the Actor uses it to pick the base URL and to decide which of the fields below are relevant.

## `source` (type: `string`):

API param: source. Country code of the regional keyword database, e.g. us, uk, de. Required for: overview/db, overview/history, keywords, pages, subdomains, ads, competitors, keywords/comparison. Not used by: overview/worldwide, overview/worldwide/url (those are worldwide-aggregated).

## `domain` (type: `string`):

API param: domain. Domain to analyze, e.g. seranking.com. Required for: overview/db, overview/worldwide, overview/history, competitors. Optional (mutually exclusive with url) for: keywords, keywords/comparison. For ads: provide domain here for the 'ads run BY this domain' query — leave empty and use keyword instead for the 'who advertises ON this keyword' query. Not used by: overview/worldwide/url, pages, subdomains (they use target instead).

## `url` (type: `string`):

API param: url. Specific URL to analyze instead of a root domain. Required for: overview/worldwide/url. Optional alternative to domain for: overview/db, overview/history, keywords, keywords/comparison — when both are sent for keywords, url wins and domain is silently dropped.

## `with_subdomains` (type: `string`):

API param: with_subdomains. Whether to include subdomain data. Used by: overview/db, overview/worldwide, overview/history, keywords (ignored there if url is supplied instead of domain). Not used by: pages, subdomains (they use scope instead), overview/worldwide/url, ads, competitors, keywords/comparison.

## `type` (type: `string`):

API param: type. organic vs paid search traffic. Used by: overview/history, keywords, pages, subdomains, competitors, keywords/comparison (default organic everywhere it appears). Not used by: overview/db, overview/worldwide, overview/worldwide/url, ads.

## `target` (type: `string`):

API param: target. Root domain to analyze, e.g. example.com. Required for: pages, subdomains. Not used by any other endpoint (those use domain/url instead). For pages specifically, if you set scope=url below, put the full URL here instead of a bare domain. Schema default: seranking.com (so the Actor works out of the box for pages/subdomains).

## `scope` (type: `string`):

API param: scope. Required for: pages, subdomains — but the SET OF VALID VALUES DIFFERS between them, so this is a free-text field rather than a dropdown. For pages, valid values are: base_domain (all subdomains under the registrable domain), domain (this exact host only), url (a single specific URL — put it in target above). For subdomains, valid values are only: base_domain or domain (no url option there). Schema default: base_domain (valid for both pages and subdomains).

## `currency` (type: `string`):

API param: currency. ISO 4217 currency code for monetary values in the response, e.g. USD, EUR, GBP. Used only by: overview/worldwide. Default: USD.

## `fields` (type: `string`):

API param: fields. Comma-separated list of data categories to include. VALID VALUES DIFFER BY ENDPOINT: for overview/worldwide — price, traffic, keywords, positions_diff, positions_tops (default if omitted: price,traffic,keywords). For overview/worldwide/url — only keywords, traffic, price (no default; omit to get none/varies — check response). Not used by any other endpoint. Schema default: price,traffic,keywords (valid for both endpoints that use it).

## `show_zones_list` (type: `string`):

API param: show_zones_list. Whether to include a per-country breakdown alongside the worldwide aggregate. Used only by: overview/worldwide.

## `year` (type: `integer`):

API param: year. Year of the historical keyword snapshot. Used only by: keywords. Must be supplied together with month, or both are ignored and the current snapshot returns instead. Historical responses use a different response schema than current ones.

## `month` (type: `integer`):

API param: month. Month (1-12) of the historical keyword snapshot. Used only by: keywords. Must be supplied together with year.

## `page` (type: `integer`):

API param: page. Page number for paginated results. Used by: keywords, ads, keywords/comparison. Default 1 everywhere it's used.

## `limit` (type: `integer`):

API param: limit. Page size. VALID RANGE DIFFERS BY ENDPOINT: keywords — 1 to 1000, default 100 (values above 1000 silently capped). keywords/comparison — 1 to 1000, default 100. ads — 1 to 100, default 100. pages / subdomains — no stated upper bound in docs, default 1000. Schema default: 10 — a small, safe value valid for every endpoint (handy for testing). Raise it for real runs.

## `offset` (type: `integer`):

API param: offset. Starting position for the paginated list. Used by: pages, subdomains. Schema default: 0.

## `order_field` (type: `string`):

API param: order_field. Sort key. VALID VALUES DIFFER BY ENDPOINT: keywords — traffic, volume, position, cpc, competition, kei, difficulty, traffic_percent, price (default: traffic). pages / subdomains — keywords_count, traffic_sum, traffic_percent, price_sum (default: keywords_count). keywords/comparison — keyword, volume, cpc, competition, difficulty, position (default: keyword).

## `order_type` (type: `string`):

API param: order_type. Sort direction. Used by: keywords, pages, subdomains (API default: desc) and keywords/comparison (API default: asc). Deliberately no schema default, so every endpoint keeps its own API default when this is left empty.

## `cols` (type: `string`):

API param: cols. Comma-separated list of response fields to return; invalid names are silently dropped; leave empty for the default set. Used by: keywords, keywords/comparison. VALID VALUES DIFFER BY ENDPOINT. keywords — keyword, position, prev_pos, volume, cpc, competition, difficulty, url, total_sites, traffic, traffic_percent, price, intents, serp_features, block_type, block_position (default: all 16; paid-only when type=adv: block, snippet_num, snippets_count, snippet_title, snippet_description, snippet_display_url; 'kei' is a valid order_field but not a column). keywords/comparison — keyword, volume, cpc, competition, difficulty, total_sites, position, url, price, traffic, compare_position, compare_url, compare_price, compare_traffic, intents, serp_features.

## `pos_change` (type: `string`):

API param: pos_change. Selects keywords by how their position changed vs. the previous snapshot. Used only by: keywords.

## `filter[volume][from]` (type: `integer`):

API param: filter\[volume]\[from]. Minimum monthly search volume. Used by: keywords, keywords/comparison.

## `filter[volume][to]` (type: `integer`):

API param: filter\[volume]\[to]. Maximum monthly search volume. Used by: keywords, keywords/comparison.

## `filter[traffic][from]` (type: `integer`):

API param: filter\[traffic]\[from]. Minimum estimated monthly traffic to the ranking URL. Used only by: keywords.

## `filter[traffic][to]` (type: `integer`):

API param: filter\[traffic]\[to]. Maximum estimated monthly traffic to the ranking URL. Used only by: keywords.

## `filter[traffic_percent][from]` (type: `number`):

API param: filter\[traffic_percent]\[from]. Minimum share (%) of the keyword's total traffic captured by the domain. Used only by: keywords.

## `filter[traffic_percent][to]` (type: `number`):

API param: filter\[traffic_percent]\[to]. Maximum share (%) of the keyword's total traffic captured by the domain. Used only by: keywords.

## `filter[position][from]` (type: `integer`):

API param: filter\[position]\[from]. Minimum ranking position. Used only by: keywords.

## `filter[position][to]` (type: `integer`):

API param: filter\[position]\[to]. Maximum ranking position. Used only by: keywords.

## `filter[keyword_count][from]` (type: `integer`):

API param: filter\[keyword_count]\[from]. Minimum number of words in the keyword phrase. Used only by: keywords.

## `filter[keyword_count][to]` (type: `integer`):

API param: filter\[keyword_count]\[to]. Maximum number of words in the keyword phrase. Used only by: keywords.

## `filter[characters_count][from]` (type: `integer`):

API param: filter\[characters_count]\[from]. Minimum character length of the keyword phrase. Used only by: keywords.

## `filter[characters_count][to]` (type: `integer`):

API param: filter\[characters_count]\[to]. Maximum character length of the keyword phrase. Used only by: keywords.

## `filter[cpc][from]` (type: `number`):

API param: filter\[cpc]\[from]. Minimum cost per click, USD. Used by: keywords, keywords/comparison.

## `filter[cpc][to]` (type: `number`):

API param: filter\[cpc]\[to]. Maximum cost per click, USD. Used by: keywords, keywords/comparison.

## `filter[price][from]` (type: `number`):

API param: filter\[price]\[from]. Minimum estimated traffic value (PPC-equivalent), USD. Used only by: keywords.

## `filter[price][to]` (type: `number`):

API param: filter\[price]\[to]. Maximum estimated traffic value (PPC-equivalent), USD. Used only by: keywords.

## `filter[competition][from]` (type: `number`):

API param: filter\[competition]\[from]. Minimum competition score, 0.00-1.00. Used by: keywords, keywords/comparison.

## `filter[competition][to]` (type: `number`):

API param: filter\[competition]\[to]. Maximum competition score, 0.00-1.00. Used by: keywords, keywords/comparison.

## `filter[difficulty][from]` (type: `integer`):

API param: filter\[difficulty]\[from]. Minimum keyword difficulty, 0-100. Used by: keywords, keywords/comparison.

## `filter[difficulty][to]` (type: `integer`):

API param: filter\[difficulty]\[to]. Maximum keyword difficulty, 0-100. Used by: keywords, keywords/comparison.

## `filter[keyword]` (type: `string`):

API param: filter\[keyword]. Plain substring match on the keyword text, e.g. vegas — send plain text, NOT JSON (JSON formats return no rows). The docs say 'case-insensitive', but the API matches case-sensitively against lowercase keywords ('SEO' and 'Ranking' returned no rows, 'seo' worked), so the Actor lowercases the value automatically. Verified on keywords/comparison; the keywords endpoint uses the same plain-text format. For advanced logic (AND/OR, begins/ends/exact) use filter\[multi_keyword_included]. Used by: keywords, keywords/comparison.

## `filter[multi_keyword_included]` (type: `string`):

API param: filter\[multi_keyword_included]. Keyword must contain these tokens. Used by: keywords, keywords/comparison. Matching is case-sensitive against lowercase keywords ('Ranking' returned no rows), so plain text you type is lowercased and wrapped automatically into a single 'contains' condition. For advanced logic paste raw JSON (sent untouched — use lowercase values), e.g. \[\[{"type":"contains","value":"seo tools"},{"type":"begins","value":"free"}]] — inner array = AND, outer array = OR. Supported types: contains, begins, ends, exact.

## `filter[multi_keyword_excluded]` (type: `string`):

API param: filter\[multi_keyword_excluded]. Same structure and automatic lowercasing/wrapping of plain text as multi_keyword_included, but keywords matching the condition are excluded. Raw JSON is sent untouched (use lowercase values). Used by: keywords, keywords/comparison.

## `filter[url]` (type: `string`):

API param: filter\[url]. Filter by ranking URL (substring), single condition only — no OR logic (unlike multi_keyword filters). Plain text such as /blog is wrapped automatically into \[\[{"type":"contains","value":"/blog"}]]; raw JSON starting with \[ is sent untouched. Used only by: keywords. For an exact single-URL match use the top-level url field in Base parameters instead.

## `filter[intents]` (type: `string`):

API param: filter\[intents]. Comma-separated intent codes: I (informational), N (navigational), T (transactional), C (commercial), L (local). Keyword passes if ANY listed intent matches. Used by: keywords, keywords/comparison.

## `filter[serp_features]` (type: `string`):

API param: filter\[serp_features]. Comma-separated SERP feature codes (e.g. sitelinks, video, sge, reviews, people_also_ask). Matches when the SERP shows this feature at all, regardless of whether the analyzed domain appears inside it. Used by: keywords, keywords/comparison. For 'domain is cited inside the feature', use filter\[serp_features_2]\[mode]/\[value] instead.

## `filter[serp_features_2][mode]` (type: `string`):

API param: filter\[serp_features_2]\[mode]. Whether the analyzed domain must be cited inside the SERP feature(s), or must be absent (citation-gap opportunities). Used only by: keywords, together with filter\[serp_features_2]\[value].

## `filter[serp_features_2][value]` (type: `string`):

API param: filter\[serp_features_2]\[value]. Comma-separated SERP feature codes to check citation for, e.g. sge,reviews. Used only by: keywords, together with filter\[serp_features_2]\[mode].

## `filter[domain_url]` (type: `string`):

API param: filter\[domain_url]. URL/host text that must be included — send plain text, e.g. /blog, NOT JSON (verified on pages: /blog and blog both work; the JSON format the docs describe returns no rows). Sent exactly as typed. Used by: pages, subdomains (subdomains uses the same parameter but is not separately tested).

## `filter[domain_traffic_percent][from]` (type: `number`):

API param: filter\[domain_traffic_percent]\[from]. Minimum % of total domain traffic contributed by the page/subdomain. Used by: pages, subdomains.

## `filter[domain_traffic_percent][to]` (type: `number`):

API param: filter\[domain_traffic_percent]\[to]. Maximum % of total domain traffic contributed by the page/subdomain. Used by: pages, subdomains.

## `filter[keywords_count][from]` (type: `integer`):

API param: filter\[keywords_count]\[from]. Minimum number of ranking keywords for the page/subdomain. Used by: pages, subdomains. (Not to be confused with filter\[keyword_count] under keywords, which counts words in a keyword phrase.)

## `filter[keywords_count][to]` (type: `integer`):

API param: filter\[keywords_count]\[to]. Maximum number of ranking keywords for the page/subdomain. Used by: pages, subdomains.

## `filter[traffic_sum][from]` (type: `integer`):

API param: filter\[traffic_sum]\[from]. Minimum estimated monthly traffic for the page/subdomain. Used by: pages, subdomains.

## `filter[traffic_sum][to]` (type: `integer`):

API param: filter\[traffic_sum]\[to]. Maximum estimated monthly traffic for the page/subdomain. Used by: pages, subdomains.

## `filter[price_sum][from]` (type: `number`):

API param: filter\[price_sum]\[from]. Minimum estimated traffic value (PPC equivalent) for the page/subdomain. Used by: pages, subdomains.

## `filter[price_sum][to]` (type: `number`):

API param: filter\[price_sum]\[to]. Maximum estimated traffic value (PPC equivalent) for the page/subdomain. Used by: pages, subdomains.

## `keyword` (type: `string`):

API param: keyword. Keyword to look up advertisers for. Used only by: ads — provide this (leave domain empty) to run the 'who advertises ON this keyword' query. If you provide domain instead, the Actor runs the 'ads run BY this domain' query.

## `from` (type: `string`):

API param: from. Start of the data retrieval period, format YYYY-MM, e.g. 2023-01. Used only by: ads. Leave empty for all available data.

## `to` (type: `string`):

API param: to. End of the data retrieval period, format YYYY-MM, e.g. 2023-12. Used only by: ads. Leave empty for all available data.

## `compare` (type: `string`):

API param: compare. Competitor domain or full URL to compare against your primary domain/url (Base parameters). Used only by: keywords/comparison. Must match the type of your primary parameter — domain vs domain, or URL vs URL. Schema default: semrush.com (only sent to keywords/comparison).

## `diff` (type: `string`):

API param: diff. Comparison mode. Used only by: keywords/comparison. 0 = common keywords (both compare and the primary domain rank: A ∩ B). 1 = keyword gap (the primary domain ranks, the compare domain does not: A − B). To get the competitor's unique keywords (B − A), swap domain and compare and keep diff=1.

## Actor input object example

```json
{
  "endpoint": "overview/db",
  "source": "us",
  "domain": "seranking.com",
  "with_subdomains": "1",
  "type": "organic",
  "target": "seranking.com",
  "scope": "base_domain",
  "currency": "USD",
  "fields": "price,traffic,keywords",
  "show_zones_list": "0",
  "page": 1,
  "limit": 10,
  "offset": 0,
  "compare": "semrush.com",
  "diff": "0"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "endpoint": "overview/db",
    "source": "us",
    "domain": "seranking.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("se_ranking/domain-analysis").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "endpoint": "overview/db",
    "source": "us",
    "domain": "seranking.com",
}

# Run the Actor and wait for it to finish
run = client.actor("se_ranking/domain-analysis").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "endpoint": "overview/db",
  "source": "us",
  "domain": "seranking.com"
}' |
apify call se_ranking/domain-analysis --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,se_ranking/domain-analysis"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/rnx3hpGNddoCr0PSQ/builds/uyn9F8FCt6eqcFBMu/openapi.json
