# SEO Keyword Research API - Serpstat Domain, SERP, Backlinks (`nabeelbaghoor/seo-keyword-domain-research-api`) Actor

SEO keyword research and domain analysis with the Serpstat API: search volume, CPC, keyword difficulty, intent, related keywords, suggestions, domain organic keywords, traffic, competitors, Google top 100 SERP, backlinks and referring domains. Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/seo-keyword-domain-research-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** SEO tools, Marketing, Developer tools
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 domain overview or backlink summary returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## SEO Keyword Research API - Serpstat Domain, SERP, Backlinks

Pull SEO keyword research, domain analysis, Google SERP and backlink data from the Serpstat API with your own API token, and get search volume, CPC, keyword difficulty, intent, organic rankings, competitors and referring domains as clean dataset rows.

Works with the Serpstat Public API v4 (api.serpstat.com/v4, JSON-RPC 2.0), the API behind Serpstat's Domain Analysis, Keyword Research and Backlink Analysis tools. The actor turns a list of domains or keywords into deduplicated rows you can download as JSON, CSV or Excel, schedule, or feed into SEO dashboards, content planning, PPC research, rank reporting, Google Sheets, Looker Studio and AI agents. Bring your own API key.

BYOK, not live-tested: every method, parameter, filter and enum comes from Serpstat's published OpenAPI reference at api-docs.serpstat.com, but the actor has not been run against a live Serpstat account.

### What it does

- **Domain SEO overview**: for a list of domains, the number of organic keywords, estimated organic traffic, AI-estimated traffic, new, lost, improved and declined keywords, PPC keywords and ads, and AI Overview keyword and citation counts, per Google country database.
- **Domain organic keywords**: every keyword a domain ranks for in the Google top 100, with position, ranking URL, search volume, CPC, competition, keyword difficulty, traffic, intent and SERP features. Filter by volume, CPC, difficulty, position, intent, ranking URL and words the keyword must contain or exclude.
- **Domain organic competitors**: the sites competing with a domain in the Google top 20, with common keywords, total keywords, visibility, missing keywords and relevance.
- **Keyword research (phrase match)**: every keyword that contains your seed phrase, with volume, CPC, competition, difficulty, intent and SERP features.
- **Related keywords**: semantically related queries for a seed keyword, with connection strength (weight), volume, CPC and difficulty.
- **Keyword suggestions**: full-text search suggestions for a seed keyword, with place names found in them.
- **Keyword metrics**: search volume, broad match volume, CPC, competition, difficulty, intent, results count and SERP features for up to 1000 keywords per call. Keywords Serpstat has no data for come back as free rows that say so.
- **Keyword SERP top 100**: the Google organic results for a keyword, with position, URL, domain and the snippet types each result shows.
- **Backlink profile summary**: Serpstat Domain Rank, backlinks, referring domains, IP addresses and subnets, dofollow and nofollow links, link types and their changes.
- **Referring domains**: the domains linking to a site, with the number of linking pages and their Serpstat Domain Rank, sorted by first seen date, rank, links or name.
- **API credit balance**: how many Serpstat API credits you have used and have left this billing period, free.
- **Pay only for results**: refused and empty lookups are recorded as a free row that says why, never charged.

### How to get an API key

Serpstat API access comes with Serpstat's middle and top tier subscription plans, and with dedicated API plans; Serpstat also offers it during a trial. Copy your API token from your Serpstat profile page (serpstat.com/users/profile) and paste it into the API token field, or set the `DATA_API_KEY` environment secret. Each Serpstat user has one token; Serpstat suggests adding a team member with a small credit allowance and using their token for testing. This actor never ships a shared key.

#### What a run costs in Serpstat credits

Serpstat spends API credits from your plan for every call: 1 credit per row returned for keyword, ranking, competitor, suggestion, SERP and referring domain rows; 5 credits per domain in the domain overview; 5 credits per backlink summary; and, since June 2025, 1 credit even when a lookup returns no data. The credit balance mode is free. `maxResults` caps both the rows and the credits a run uses, so the default is a modest 100.

### Input

| Field | Used by | What it does |
| --- | --- | --- |
| `mode` | all | `domainsInfo`, `domainKeywords`, `domainCompetitors`, `keywords`, `relatedKeywords`, `keywordSuggestions`, `keywordsInfo`, `keywordSerp`, `backlinksSummary`, `referringDomains` or `creditBalance` |
| `domains` | domain and backlink modes | Domains, one per line, such as nike.com |
| `keywords` | keyword modes | Keywords, one per line, such as running shoes |
| `searchEngine` | domain and keyword modes | Serpstat database: `g_us` (default), `g_uk`, `g_de` or any other of 230 Google country databases, or `bing_us` |
| `withSubdomains` | domain organic keywords | Include subdomains (default true) |
| `withIntents`, `intents` | keyword-shaped modes | Add search intent, and keep only these intents |
| `minusKeywords`, `keywordContains` | domain keywords, keyword research | Words to exclude, words a keyword must contain |
| `urlContains` | domain organic keywords | Ranking URL contains |
| `volumeFrom`, `volumeTo`, `cpcFrom`, `cpcTo` | keyword-shaped modes | Search volume and CPC ranges |
| `difficultyFrom`, `difficultyTo` | domain keywords, keyword research, related keywords | Keyword difficulty range, 0 to 100 |
| `positionFrom`, `positionTo` | domain organic keywords, keyword SERP | Google position range, 1 to 100 |
| `serpDepth` | keyword SERP | How many top results to read (default 100) |
| `sortBy`, `competitorSort`, `refDomainSort`, `sortOrder` | list modes | Sort field and order |
| `backlinkScope` | backlink modes | Domain with subdomains (default), domain only, exact URL or URL prefix |
| `maxResults` | all | Row ceiling for the run (default 100) |
| `requestsPerMinute` | all | Pacing (default 60; most Serpstat plans allow 1 request a second) |
| `apiKey` | all | Your Serpstat API token, stored as a secret |

A method only receives the parameters its documentation lists; an input that belongs to another mode is left off with a warning.

Example input, the commercial keywords nike.com ranks for on page one in the US:

```json
{
    "mode": "domainKeywords",
    "domains": ["nike.com"],
    "searchEngine": "g_us",
    "withIntents": true,
    "intents": ["commercial", "transactional"],
    "positionTo": 10,
    "volumeFrom": 1000,
    "sortBy": "region_queries_count",
    "sortOrder": "desc",
    "maxResults": 100
}
```

### Example output

A domain organic keyword row. The common columns come first; every field Serpstat returns follows unchanged.

```json
{
    "mode": "domainKeywords",
    "modeLabel": "Domain organic keywords",
    "recordType": "domainKeyword",
    "identifier": "nike.com",
    "found": true,
    "searchEngine": "g_us",
    "domain": "nike.com",
    "keyword": "soccer cleats nike store",
    "url": "https://www.nike.com/soccer",
    "position": 2,
    "searchVolume": 110000,
    "cpc": 0.2,
    "difficulty": 55,
    "competition": 100,
    "traffic": 15997,
    "keywordsCount": null,
    "domainRank": null,
    "intents": ["commercial"],
    "serpFeatures": ["local_pack", "related_search", "pic", "snip_breadcrumbs", "snip_image_thumbnail"],
    "retrievedAt": "2026-10-13T09:00:00.000Z",
    "note": null,
    "subdomain": "www.nike.com",
    "keyword_length": 4,
    "found_results": 196,
    "region_queries_count": 110000,
    "region_queries_count_wide": 0,
    "geo_names": [],
    "traff": 15997,
    "dynamic": 0
}
```

Domain overview rows carry `keywordsCount` and `traffic` plus `traffic_ai`, `new_keywords`, `out_keywords`, `ad_keywords`, `aio_keywords` and `aio_citations`; competitor rows carry `all`, `common`, `visibility`, `missing` and `relevance` (the analysed domain itself is listed with relevance 100); SERP rows carry `position`, `url`, `domain`, `subdomain` and `serpFeatures`; backlink summaries carry `domainRank` plus every backlink and referring domain count with its change; referring domain rows carry `domain`, `ref_pages` and `domainRank`.

### FAQ

#### What is the Serpstat API?

Serpstat is an all-in-one SEO platform with its own Google keyword and ranking database covering 230 country databases, plus a backlink index. Its Public API v4 is a JSON-RPC 2.0 API at api.serpstat.com/v4 that serves the same data as the Serpstat Domain Analysis, Keyword Research, SERP and Backlink Analysis reports.

#### Do I need my own Serpstat API token?

Yes. The actor calls Serpstat with your own token and spends credits from your own Serpstat plan. A run without a token ends straight away with a message that says where to find it, and nothing is charged.

#### How do I find the keywords a website ranks for?

Use the domain organic keywords mode, put the domain in `domains`, pick the country database, and add filters such as `positionTo: 10` for page one or `volumeFrom` for a minimum search volume. Each row is one keyword with its position, ranking URL, search volume, CPC, difficulty and traffic.

#### How do I get search volume, CPC and keyword difficulty for a keyword list?

Use the keyword metrics mode and paste up to 1000 keywords per call into `keywords`. Each found keyword becomes one row with search volume, CPC, competition, difficulty and SERP features; keywords Serpstat has no data for become free rows.

#### How do I find related keywords and long-tail ideas?

Use keyword research (phrase match) for every keyword containing your seed phrase, related keywords for semantically related queries, and keyword suggestions for full-text search suggestions. All three page through up to 60,000 rows per seed, the most Serpstat serves for one list.

#### Can I see who ranks in Google for a keyword?

Yes. The keyword SERP top 100 mode returns the Google organic results for each keyword with position, URL, domain and the snippet types each result shows, for any of the country databases.

#### Can I check a site's backlinks and referring domains?

Yes. The backlink summary gives the Serpstat Domain Rank and the counts of backlinks, referring domains, IPs and subnets with their changes; the referring domains mode lists each linking domain with its pages and rank.

#### What do I pay?

Pay per result: 0.01 USD per domain overview or backlink summary and 0.005 USD per keyword, ranking, competitor, suggestion, SERP result or referring domain row. Refused and empty lookups are never charged, and the credit balance is free. Your Serpstat subscription and its API credits are billed separately by Serpstat.

#### What happens if my token is wrong or my credits run out?

Serpstat answers every error inside a JSON-RPC error object. A rejected token ("Invalid token"), used up credits ("Credits exceeded") or a method or database your plan does not include ends the run cleanly with a status message that explains what to change. Rate limits ("Query frequency exceeded") are waited out and retried. A domain or keyword Serpstat refuses becomes a free row with the API's own words, and the run moves on.

### Pricing

| Event | Price | Charged for |
| --- | --- | --- |
| `domain-report` | 0.01 USD | Each domain SEO overview or backlink profile summary |
| `seo-row` | 0.005 USD | Each keyword, ranking, competitor, suggestion, SERP result or referring domain |

### Keyword map

SEO API, keyword research API, Serpstat API, search volume API, keyword difficulty, CPC data, related keywords, keyword suggestions, long-tail keywords, domain analysis API, organic keywords, competitor analysis, website traffic estimate, SERP API, Google top 100, rank checker, backlink checker API, referring domains, domain rank, search intent, Semrush alternative, Ahrefs alternative.

### Terms and data use

Use of Serpstat is governed by Serpstat's license agreement (serpstat.com/users/license-agreement). It grants a limited, non-exclusive licence, forbids reselling, sublicensing or redistributing Serpstat materials, forbids using Serpstat to provide similar services to third parties, and forbids using Serpstat or its content on a platform or website Serpstat has not provided and approved. Run this actor with your own token, for your own SEO work, keep the results for your own use, and ask Serpstat (data.serpstat.com) if you plan to republish or resell the data. This actor is not affiliated with or endorsed by Serpstat.

# Actor input Schema

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

Domain modes take domains: the SEO overview (keywords, traffic, visibility changes), the organic keywords a domain ranks for in Google top 100, its organic competitors, its backlink summary and its referring domains. Keyword modes take keywords: phrase-match keyword research, semantically related keywords, search suggestions, volume and CPC metrics for a keyword list, and the Google top 100 results. API credit balance reads how many Serpstat API credits you have left and costs nothing.

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

Domain modes only. Domains to analyse, one per line, such as nike.com. A scheme, www. and any path are removed, except for the URL backlink scopes, which keep the path.

## `keywords` (type: `array`):

Keyword modes only. Search phrases, one per line, such as running shoes. Keyword metrics sends up to 1000 keywords per call; the other keyword modes make one lookup per keyword.

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

The Serpstat database (se) to read: Google for one country, or Bing US. Not used by the backlink modes or the credit balance.

## `withSubdomains` (type: `boolean`):

Domain organic keywords only. Include keywords that the domain's subdomains rank for.

## `withIntents` (type: `boolean`):

Domain organic keywords, Keyword research, Related keywords and Keyword metrics. Adds the search intent of each keyword (informational, navigational, commercial, transactional). Serpstat documents intents for the g_us and g_ua databases.

## `intents` (type: `array`):

Domain organic keywords, Keyword research, Related keywords and Keyword metrics. Only keywords with at least one of these intents. Leave empty for all.

## `minusKeywords` (type: `array`):

Domain organic keywords, Keyword research and Keyword suggestions. Keywords to leave out of the results, one per line.

## `keywordContains` (type: `array`):

Domain organic keywords, Keyword research and Related keywords. Only keywords that contain all of these words (exact word match), up to 100.

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

Domain organic keywords only. Only keywords whose ranking page URL contains this text, such as /running/.

## `volumeFrom` (type: `integer`):

Domain organic keywords, Keyword research, Related keywords and Keyword metrics. Only keywords with at least this monthly search volume in the chosen database.

## `volumeTo` (type: `integer`):

Domain organic keywords, Keyword research, Related keywords and Keyword metrics. Only keywords with at most this monthly search volume.

## `cpcFrom` (type: `number`):

Domain organic keywords, Keyword research, Related keywords and Keyword metrics. Only keywords with a cost per click of at least this, in US dollars.

## `cpcTo` (type: `number`):

Domain organic keywords, Keyword research, Related keywords and Keyword metrics. Only keywords with a cost per click of at most this, in US dollars.

## `difficultyFrom` (type: `integer`):

Domain organic keywords, Keyword research and Related keywords. Only keywords with a difficulty of at least this (0 to 100).

## `difficultyTo` (type: `integer`):

Domain organic keywords, Keyword research and Related keywords. Only keywords with a difficulty of at most this (0 to 100).

## `positionFrom` (type: `integer`):

Domain organic keywords and Keyword SERP. Only rankings at this Google position or lower down (1 to 100).

## `positionTo` (type: `integer`):

Domain organic keywords and Keyword SERP. Only rankings at this Google position or higher up (1 to 100), such as 10 for page one.

## `serpDepth` (type: `integer`):

Keyword SERP only. How many of the top Google results to read for each keyword (1 to 100). Each result costs 1 Serpstat API credit.

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

Domain organic keywords, Keyword research, Related keywords and Keyword metrics. The sort field. Domain organic keywords cannot sort by difficulty; traffic and position exist for domain organic keywords only.

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

Domain organic competitors only. Serpstat applies this sort within each page.

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

Referring domains only.

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

Applies to whichever sort the mode uses.

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

Backlink modes only. What part of the site to analyse. The summary works on domains only.

## `maxResults` (type: `integer`):

The most rows this run returns and charges for. Serpstat also spends about 1 of your API credits per row (5 per domain overview or backlink summary), so keep this modest. Serpstat serves at most 60,000 rows of any one list.

## `requestsPerMinute` (type: `integer`):

Pacing. Most Serpstat plans allow 1 request a second (60 a minute) and top plans 10 a second; a rate limit answer is waited out and retried.

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

Your own Serpstat API token, from your Serpstat profile (serpstat.com/users/profile). Stored as a secret and sent only as the token parameter to api.serpstat.com; it is never logged. You can instead set the DATA_API_KEY environment secret.

## Actor input object example

```json
{
  "mode": "domainKeywords",
  "domains": [
    "nike.com"
  ],
  "searchEngine": "g_us",
  "withSubdomains": true,
  "withIntents": false,
  "serpDepth": 100,
  "sortBy": "default",
  "competitorSort": "default",
  "refDomainSort": "check",
  "sortOrder": "desc",
  "backlinkScope": "domain_with_subdomains",
  "maxResults": 100,
  "requestsPerMinute": 60
}
```

# Actor output Schema

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

One row per keyword, domain, competitor, SERP result, backlink summary or referring 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": [
        "nike.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/seo-keyword-domain-research-api").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": ["nike.com"] }

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/seo-keyword-domain-research-api").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": [
    "nike.com"
  ]
}' |
apify call nabeelbaghoor/seo-keyword-domain-research-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/seo-keyword-domain-research-api"
        }
    }
}
```

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/BDeGkrfB0mpVmcswi/builds/XfZ55WNinVvggdaY5/openapi.json
