# Semrush Alternative: Competitor Keywords, Gap and Rankings (`alexmorain/seo-competitor-keywords`) Actor

Domain overview, organic competitors, keyword gap and ranked keywords for any domain and country, from the DataForSEO Labs index. Watch mode lists keywords gained and lost since the last run and can call a webhook. Pay per row, no subscription.

- **URL**: https://apify.com/alexmorain/seo-competitor-keywords.md
- **Developed by:** [Alexis Morain](https://apify.com/alexmorain) (community)
- **Categories:** SEO tools, Marketing
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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 does SEO Competitor Keywords do?

SEO Competitor Keywords gives you the organic picture of up to 1,000 domains in one run, for the Google country you choose: keywords and estimated traffic, keywords by position, the organic competitors, the keyword gap against them, the full list of ranked keywords, and a watch of keywords gained and lost since the last check. The data comes from the [DataForSEO](https://dataforseo.com) Labs API. No browser, no login, no subscription: you pay per row.

> Read this first. The figures come from DataForSEO's own Google index and traffic model. They are not Semrush's numbers and will not match them figure for figure. This Actor is an independent project, not affiliated with, endorsed by or sponsored by Semrush. The name is only used to say what kind of tool this is an alternative to.

### Why use it instead of a subscription?

- Pay for what you read. One domain overview costs $0.027. 1,000 ranked keywords cost $2.05, or $1.05 on the Gold plan. No monthly seat, no export quota.
- Real competitors, not the giants. Ask DataForSEO for the competitors of apify.com in the US and the list starts with apify.com itself, then youtube.com, reddit.com, facebook.com, google.com, quora.com (measured on 9 November 2026). Those sites rank for everything and tell you nothing. The Actor skips them by default and removes the domain itself, including its `www.` and other subdomains, so the first row is github.com and the second stackoverflow.com.
- Always one country. A Labs query without a country mixes every market and gives figures several times larger. The Actor always sends one, `us` by default, and writes it in every row.
- A keyword gap you can act on. For each competitor, the keywords where it ranks and your domain does not, biggest volume first. PhantomBuster against Apify in the US: 3,913 keywords, starting with "social selling index" (368,000 searches a month, PhantomBuster in position 19).
- A watch that does not repeat itself. Schedule it and get only the keywords gained and lost since the previous check, each change delivered and charged once.
- On the Apify platform: schedule it, call it by API, send the result to Google Sheets, Make, Zapier, n8n or a webhook.

Use it to size a market before writing content, find the keywords a competitor takes from you, audit a prospect before a sales call, or alert a client when their site loses rankings.

### What data does it return?

Five row types in one dataset, told apart by `rowType`, with one view per type in the Output tab. Every field is always present, `null` when it does not apply.

#### Overview rows (`rowType: overview`, always)

| Field | Example (apify.com, US) | Description |
|---|---|---|
| `input`, `domain`, `targetMode` | `www.apify.com`, `apify.com`, `domain` | What you pasted, what was analysed, and the mode |
| `country` | `us` | Country of the Google results |
| `organicKeywords` | `36584` | Keywords in Google's top 100 |
| `organicTraffic`, `organicTrafficValue` | `66263`, `305559` | Estimated monthly visits, and what they would cost as ads (USD) |
| `top1`, `top2to3`, `top4to10`, `top11to20`, `top21to50`, `top51to100` | `673`, ... | Keywords per position bracket |
| `newKeywords`, `upKeywords`, `downKeywords`, `lostKeywords` | `25135`, ... | Movement counters from the provider (cumulative, see the FAQ) |
| `paidKeywords`, `paidTraffic`, `paidTrafficValue` | `0` | Google Ads side |
| `hasData`, `note` | `true` | `false` when the provider knows nothing about the domain |
| `status`, `error` | `ok` | `ok`, `error` or `invalid_input`. Only `ok` rows are charged |

#### Competitor rows (`rowType: competitor`, option)

`domain`, `competitorRank` (1 = closest), `competitor`, `commonKeywords`, `avgPosition`, `competitorKeywords`, `competitorTraffic`, `competitorTrafficValue`, `commonKeywordsTraffic`.

#### Keyword gap rows (`rowType: keyword_gap`, option)

`domain`, `competitor`, `keyword`, `searchVolume`, `cpc`, `competition`, `keywordDifficulty`, `intent`, `monthlySearches`, `competitorPosition`, `competitorUrl`, `competitorEstimatedTraffic`. Biggest volume first.

#### Ranked keyword rows (`rowType: ranked_keyword`, option)

`domain`, `keyword`, `position`, `url`, `searchVolume`, `cpc`, `competition`, `keywordDifficulty`, `intent`, `estimatedTraffic`, `monthlySearches`. Biggest volume first.

#### Keyword change rows (`rowType: keyword_change`, watch)

`domain`, `change` (`gained` or `lost`), `keyword`, `position` (for a lost keyword, its last position), `url`, `searchVolume`, `keywordDifficulty`, `lastSeen`, `monitorSince`. Newest first.

### How to find a competitor's keywords

1. Click Try for free.
2. Paste your domains, one per line. `www.` and full URLs are fine: they are reduced to the whole site.
3. Pick the country.
4. Tick Organic competitors, Keyword gap, Ranked keywords or the watch, and set the maximum rows for each: it is also your cost cap.
5. Press Start, then download the dataset as JSON, CSV or Excel.

To compare against competitors you already know, list them in Competitor domains (up to 10). Otherwise the gap uses the first competitors found.

### How much does it cost?

You pay a start fee of $0.002, then per event. Row prices fall with your Apify plan: Free and Bronze pay the first price, Silver the middle one, Gold and above the last one.

| Event | Free / Bronze | Silver | Gold+ | When |
|---|---|---|---|---|
| Domain overview | $0.025 | same | same | One per valid domain, even when the provider has no data on it |
| List page | $0.02 | same | same | Each list read: competitors, each gap pair, each page of 1,000 ranked keywords, each watch page |
| Row | $0.002 | $0.0015 | $0.001 | Each competitor, gap, ranked keyword or change row |

Invalid lines, rows from failed calls and changes you already received are never charged.

Examples on Free or Bronze, Gold in brackets, start fee included:

- 1 domain, overview only: $0.027.
- 1 domain with 10 competitors: $0.002 + $0.025 + $0.02 + 10 × $0.002 = $0.067 ($0.057).
- 1 domain, 1,000 ranked keywords: $0.002 + $0.025 + $0.02 + 1,000 × $0.002 = $2.047 ($1.047).
- 1 domain, 10 competitors and the gap against the first 3, 100 keywords each: $0.067 + 3 × ($0.02 + 100 × $0.002) = $0.727 ($0.417).
- A weekly watch on 1 domain with nothing new: overview + 2 empty watch pages = $0.067 per run.

The spending limit you set on a run is never exceeded: the Actor checks that a call and its rows fit before sending it, and stops cleanly when they do not.

DataForSEO's Labs API only has live calls (no cheaper queued mode), so there is no slower and cheaper option to offer here.

Free Apify plan: up to 0.15 USD of DataForSEO data per day; paid plans unlimited.

### Input

See the Input tab for every option. The main ones:

| Field | What it does |
|---|---|
| `domains` | Domains or URLs, one per line, up to 1,000 distinct targets |
| `targetMode` | `domain` (default): the whole site. `exact`: the host as written, for one subdomain |
| `country` | One of 20 countries, `us` by default, never empty |
| `includeCompetitors`, `maxCompetitors`, `excludeTopDomains` | Organic competitors, up to 100, giants skipped by default |
| `includeKeywordGap`, `competitorDomains`, `gapCompetitors`, `maxGapKeywords` | The gap, against your competitors or the first ones found |
| `includeRankedKeywords`, `maxRankedKeywords` | Ranked keywords, up to 10,000 per domain |
| `monitor`, `maxChangesPerDomain`, `monitorLookbackDays`, `monitorName` | The gained and lost watch |
| `webhookUrl` | Receives a JSON summary when the run ends |
| `cacheMaxAgeHours` | Reuse identical requests for this many hours, 168 by default, `0` for always fresh |

### Output

```json
{
  "rowType": "keyword_gap",
  "domain": "apify.com",
  "country": "us",
  "competitor": "phantombuster.com",
  "keyword": "social selling index",
  "searchVolume": 368000,
  "competitorPosition": 19,
  "competitorUrl": "https://phantombuster.com/blog/social-selling/linkedin-ssi-score/",
  "status": "ok",
  "dataSource": "DataForSEO"
}
```

A SUMMARY record in the key-value store gives the rows by type, the events charged and, in watch mode, the changes per domain.

#### Run it from your code

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("alexmorain/seo-competitor-keywords").call(run_input={
    "domains": ["apify.com"],
    "country": "us",
    "includeKeywordGap": True,
    "competitorDomains": ["phantombuster.com"],
    "maxGapKeywords": 200,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    if row["rowType"] == "keyword_gap":
        print(row["keyword"], row["searchVolume"], row["competitorPosition"])
```

cURL:

```bash
curl -X POST "https://api.apify.com/v2/acts/alexmorain~seo-competitor-keywords/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"domains": ["apify.com"], "country": "gb", "includeCompetitors": true}'
```

### Watch gained and lost keywords

Turn on Watch gained and lost keywords and schedule the Actor, weekly is a good pace. The first run looks back `monitorLookbackDays` days (30 by default). Each later run starts from the newest ranking date the previous check read, so nothing is read twice in bulk and nothing in between is skipped.

Gained keywords are those that entered the top 100 in the window, lost ones those that left it, newest first. A change is delivered and charged once. A keyword lost and then gained again is reported again, because it is a new change. The memory lives in a named key-value store, `competitor-keywords-monitor`, in your account, keyed by country and target mode: a different country starts a fresh watch, and adding a domain to the list does not reset the others.

If more changes happened than Max changes per domain, you get the most recent ones and the next check starts after them. If a run stops on an error or on your spending limit, the next one first reads what is new, then picks up the rest of the list exactly where the stopped run left it. Changes you already received are skipped at the source: they are not sent again and not charged again.

The provider's rankings lag about a week behind: a call on 9 November 2026 returned changes up to 3 November. A daily schedule will often find nothing new and still pay for the empty watch pages.

### Rerun without waiting

The keyword database is updated once a month, so a request identical to one already made from your account in the last 7 days is answered from a cache kept in your account (named key-value store `competitor-keywords-cache`), instantly and with the same data. The cache is yours: nothing is shared between accounts. It is not used when the watch is on. Set **Reuse identical requests for (hours)** to `0` to always fetch fresh data.

### FAQ

#### Is this the same data as Semrush?

No. It is DataForSEO's index and traffic model. Volumes and traffic differ from Semrush, sometimes a lot. They are consistent across domains and over time, which is what you need to compare and track. If you need Semrush's exact figures, use Semrush.

#### Why are newKeywords and lostKeywords so large in the overview?

They are the provider's cumulative counters, not "this week". apify.com shows 25,135 new keywords while only 27 entered between 25 October and 3 November. For real recent changes, use the watch.

#### Why is the domain not in its own competitor list?

The provider puts the domain first in its own list. The Actor removes it, with its `www.` and subdomains, and never charges for it.

#### What happens with a domain the provider does not know?

The overview row comes back with `hasData: false` and empty figures, and is charged, because the call is billed to us. A line that is not a domain comes back as `invalid_input` and is free.

#### Something is missing or broken

Open an issue on the Issues tab with the run link.

### Guide and use cases

Use cases for outbound and automation, the output fields, pricing and common questions are on the [SEO Competitor Keywords page](https://alexis.morain.fr/en/scrapers/seo-competitor-keywords/) of my site. The [SEO and search engines family page](https://alexis.morain.fr/en/scrapers/families/seo/) puts it side by side with the other scrapers of the same family.

# Actor input Schema

## `domains` (type: `array`):

One domain or URL per line, up to 1,000 distinct targets. In the default target mode <code>www.apify.com</code> and <code>https://apify.com/store</code> are both read as <code>apify.com</code>, so every row covers the whole site. Duplicates are removed. A line that is not a valid domain comes back as an <code>invalid_input</code> row and is not charged.

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

<b>Registered domain</b> (default): the whole site, subdomains included, whatever form you paste. <b>Exact host</b>: the host as written, so <code>blog.example.com</code> stays a subdomain. In both modes a path is removed and the row says so.

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

Country of the Google results. Always set: a search without a country mixes every country and gives numbers several times larger. The choice is written in every row.

## `includeCompetitors` (type: `boolean`):

Adds the domains that rank for the same keywords: shared keywords, average position, their own keywords and traffic. Charged per list and per row.

## `maxCompetitors` (type: `integer`):

Upper limit of competitor rows for each domain. The domain itself is never one of them.

## `excludeTopDomains` (type: `boolean`):

Leave out YouTube, Reddit, Facebook, Google, Quora and similar sites that rank for almost everything. <b>Keep it on</b> unless you want them: without it the list starts with these sites, not with real competitors.

## `includeKeywordGap` (type: `boolean`):

Keywords where a competitor ranks and your domain does not, sorted by search volume: volume, CPC, difficulty, intent, the competitor's position and page. One list per competitor.<br><br>Without competitor domains below, the gap uses the first competitors found, so <b>the competitor list is read, delivered and charged too</b>, even if the option above is off.

## `competitorDomains` (type: `array`):

Optional, up to 10 domains, written like the domains above. Each one is compared to every domain of the run (a domain is never compared to itself). Leave empty to use the competitors found.

## `gapCompetitors` (type: `integer`):

Used when no competitor domain is given: the gap is read for this many of the first competitors found. It cannot exceed the maximum number of competitors.

## `maxGapKeywords` (type: `integer`):

Upper limit of keyword rows for each domain and competitor pair.

## `includeRankedKeywords` (type: `boolean`):

Adds one row per keyword the domain ranks for, by search volume: position, page, volume, CPC, difficulty, intent, estimated traffic.

## `maxRankedKeywords` (type: `integer`):

Upper limit of ranked keyword rows for each domain. Read in pages of 1,000.

## `monitor` (type: `boolean`):

Delivers the keywords a domain gained and lost since the last check, newest first, and <b>never delivers the same change twice</b>: schedule the Actor and only pay for what changed. A keyword reported as lost and later gained again is reported again. The memory is kept in a named store, <code>competitor-keywords-monitor</code>, in your account.<br><br><b>Billing:</b> each page read bills one list page, even an empty one. The data provider's rankings lag about a week behind, so a short schedule often finds nothing new.

## `maxChangesPerDomain` (type: `integer`):

Maximum number of rows for each domain, in the gained list and in the lost list separately. The Actor delivers the most recent changes first. If more changed since the last check, the older ones are left out on purpose and the next check starts after the newest one delivered: you get the N most recent changes per domain since the last check.

## `monitorLookbackDays` (type: `integer`):

How far back the very first check of a watch looks. Later checks start from the newest ranking date read by the previous complete check.

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

Name of the memory. Leave empty and the memory depends only on the country and the target mode: adding or removing a domain keeps what the other domains already delivered. A name lets you keep several separate watches. Even with a name, a different country or target mode starts a separate memory.

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

Optional. The run summary and the number of gained and lost keywords per domain are sent there by POST when the run ends (Slack, Discord, Zapier...). The URL is never written to a log.

## `cacheMaxAgeHours` (type: `integer`):

The keyword database is updated once a month. A request identical to one already made <b>from your account</b> within this many hours is answered from a cache stored in your account (named key-value store <code>competitor-keywords-cache</code>), with the same data. Not used when the watch is on. Set to <code>0</code> to always fetch fresh data.

## Actor input object example

```json
{
  "domains": [
    "apify.com"
  ],
  "targetMode": "domain",
  "country": "us",
  "includeCompetitors": false,
  "maxCompetitors": 10,
  "excludeTopDomains": true,
  "includeKeywordGap": false,
  "gapCompetitors": 3,
  "maxGapKeywords": 100,
  "includeRankedKeywords": false,
  "maxRankedKeywords": 100,
  "monitor": false,
  "maxChangesPerDomain": 100,
  "monitorLookbackDays": 30,
  "monitorName": "",
  "cacheMaxAgeHours": 168
}
```

# Actor output Schema

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

All rows in the default dataset.

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

Domains received, valid, invalid; rows by type; events charged; list errors; watch counters per domain.

# 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 = {
    "domains": [
        "apify.com"
    ],
    "includeCompetitors": false,
    "includeKeywordGap": false,
    "includeRankedKeywords": false,
    "monitor": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("alexmorain/seo-competitor-keywords").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 = {
    "domains": ["apify.com"],
    "includeCompetitors": False,
    "includeKeywordGap": False,
    "includeRankedKeywords": False,
    "monitor": False,
}

# Run the Actor and wait for it to finish
run = client.actor("alexmorain/seo-competitor-keywords").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 '{
  "domains": [
    "apify.com"
  ],
  "includeCompetitors": false,
  "includeKeywordGap": false,
  "includeRankedKeywords": false,
  "monitor": false
}' |
apify call alexmorain/seo-competitor-keywords --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alexmorain/seo-competitor-keywords"
        }
    }
}
```

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/CZKIWwY5Zg7zWxbJS/builds/2UdoXy06uX4n842O5/openapi.json
