# Semrush Alternative — SEO Keyword & SERP Data (`khadinakbar/semrush-api-scraper`) Actor

Run bounded DataForSEO reports for domain organic keywords, Google SERPs, and keyword difficulty with your own provider credentials.

- **URL**: https://apify.com/khadinakbar/semrush-api-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** SEO tools, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 normalized seo records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Semrush Alternative — SEO Keyword and SERP Scraper

This private Actor uses DataForSEO as the backend for bounded SEO research workflows. It returns one normalized dataset record per domain organic keyword, Google organic SERP result, or keyword-overview row, with the submitted query, DataForSEO location and language codes, source, provider task identifier, and collection time.

### Best fit and focused standalone workflow

Choose this Actor when you need a DataForSEO-backed alternative for domain keyword research, Google SERP collection, or keyword-difficulty analysis in an Apify workflow. It works as a focused standalone workflow for teams that export source-backed SEO rows into a dashboard, content brief, or monitoring system.

After selecting keywords, continue with a dedicated rank-tracking workflow for recurring target-domain measurements. This Actor focuses on research snapshots and preserves the source and provider context needed before downstream analysis.

### Workflow: from domain research to a content decision

An agency starts with `domain_organic_keywords` for a client domain, DataForSEO location code `2840`, and language code `en`. The run returns keyword, ranking position, volume, CPC, ranking URL, estimated traffic metrics, and keyword difficulty where the provider returns them. Next, the strategist exports the rows, prioritizes terms by position and volume, and feeds the focused list into a content brief or scheduled rank-monitoring workflow.

### Quick start and input

Provide the secret `dataforSeoLogin` and `dataforSeoPassword` fields from the DataForSEO API access page. They are used only in the provider authorization header and never appear in the dataset, `OUTPUT`, `RUN_SUMMARY`, or status messages. DataForSEO usage is billed on the credential owner's provider account.

```json
{
  "dataforSeoLogin": "YOUR_DATAFORSEO_LOGIN",
  "dataforSeoPassword": "YOUR_DATAFORSEO_PASSWORD",
  "mode": "domain_organic_keywords",
  "domains": ["example.com"],
  "locationCode": 2840,
  "languageCode": "en",
  "maxResults": 10
}
```

`keyword_serp` accepts `keywords` and returns Google organic result rows. `keyword_difficulty` accepts `keywords` and returns the available DataForSEO keyword overview metrics, including difficulty where provided. The Actor processes at most 20 unique inputs and writes at most 20 billable records per run.

### Output

Each dataset item is a stable record. Fields that a selected DataForSEO report does not provide are `null`.

| Field | Meaning |
|---|---|
| `recordType` | Selected research report. |
| `query` | Submitted domain or keyword. |
| `keyword` | Keyword returned by DataForSEO. |
| `position` / `url` | Observed ranking position and URL when the report provides them. |
| `searchVolume` / `keywordDifficulty` | DataForSEO keyword metrics when available. |
| `locationCode` / `languageCode` | Provider market context. |
| `providerTaskId` / `requestedAt` | Provider provenance and collection time. |

```json
{
  "recordType": "domain_organic_keywords",
  "query": "example.com",
  "locationCode": 2840,
  "languageCode": "en",
  "keyword": "technical seo",
  "position": 3,
  "searchVolume": 1200,
  "cpc": 2.5,
  "url": "https://example.com/seo",
  "keywordDifficulty": 67,
  "source": "DataForSEO",
  "providerTaskId": "01234567-89ab-cdef-0123-456789abcdef",
  "requestedAt": "2026-08-10T12:00:00.000Z"
}
```

Every run writes `OUTPUT` and `RUN_SUMMARY`. They expose the terminal outcome, row counts, provider-safe diagnostics, source provenance, and event counts without exposing credentials.

```json
{
  "outcome": "COMPLETE",
  "message": "Returned 10 DataForSEO record(s); Apify events: 10 ($0.50), plus DataForSEO and platform usage.",
  "itemsPushed": 10,
  "itemsFailed": 0,
  "invalidRecords": 0,
  "chargedEventCounts": { "seo-record": 10 },
  "warnings": []
}
```

### Pricing and provider usage

Pricing uses Pay per event: $0.00005 for an Actor start and $0.05 for each validated DataForSEO record persisted to the dataset. Platform usage is additional; use the live Pricing tab as the current Apify source. DataForSEO request usage remains on the provider credentials supplied for the run.

For example, ten persisted records have $0.50005 in Apify event charges before platform usage, alongside the DataForSEO cost reported by the provider account.

### Run through the Apify API

```bash
curl -X POST "https://api.apify.com/v2/acts/khadinakbar~semrush-api-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "dataforSeoLogin": "YOUR_DATAFORSEO_LOGIN",
    "dataforSeoPassword": "YOUR_DATAFORSEO_PASSWORD",
    "mode": "keyword_difficulty",
    "keywords": ["technical seo"],
    "locationCode": 2840,
    "languageCode": "en",
    "maxResults": 10
  }'
```

### AI-agent prompt

> Use the SEO Keyword and SERP Scraper to collect up to 10 US DataForSEO domain organic-keyword rows for `example.com`, then read the dataset and `OUTPUT`. Preserve the source, providerTaskId, and requestedAt fields, keep the $0.05-per-record cost boundary, and report the terminal outcome clearly.

For an AI agent workflow, read the default dataset after the run and use `OUTPUT.outcome` before downstream work. `COMPLETE`, `PARTIAL`, `VALID_EMPTY`, and `INVALID_INPUT` distinguish the available report state; `RUN_SUMMARY` supplies query-level provider provenance and safe diagnostics.

### Best-results guidance

Start with one domain or a small keyword list and a specific DataForSEO location and language pair. Confirm the rows are useful in the returned dataset, then schedule the same bounded input for recurring analysis. This keeps the source, provider task, collection time, request scope, and event cost clear for each export.

### Builder's note

I designed this revision around DataForSEO's live report contracts so the Actor can return stable automation-ready records without collecting a Semrush account session. My goal is a clear provider boundary: a complete validated row is persisted before its `seo-record` event is counted.

### Responsible use

Use DataForSEO credentials and data that your organization is authorized to access, and apply provider terms of service and applicable laws to downstream processing. This independent Actor is designed for responsible provider-backed collection and is not affiliated with Semrush or DataForSEO.

# Actor input Schema

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

Your DataForSEO API login, usually the email shown on the API access page. It is sent only in the request authorization header and is never returned or logged. This is not your Apify email.

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

Your DataForSEO API password from API access, not your dashboard password. It is sent only in the request authorization header and is never returned or logged. Pair it with dataforSeoLogin from the same provider account.

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

Select the DataForSEO report to run. Domain organic keywords accepts domains; Google organic SERP and keyword difficulty accept keywords. Each mode returns a distinct source-backed record type.

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

Domains for the domain organic-keywords mode, for example \["example.com"]. URLs are normalized to domains and duplicates are removed. Ignored by keyword modes; maximum 20 unique domains.

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

Keywords for Google organic SERP or keyword difficulty, for example \["technical seo"]. Each keyword is processed independently and duplicates are removed. Ignored by domain organic-keywords mode; maximum 20 unique keywords.

## `locationCode` (type: `integer`):

DataForSEO location code for the Google market, for example 2840 for the United States. The code applies to every query in the run. This is not a country-code string.

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

DataForSEO language code for the report, for example en. It is paired with the location code and applies to every query. This is not a browser interface language selector.

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

Maximum DataForSEO rows requested for each input, from 1 to 20. The run also has a hard cap of 20 billable persisted rows across all inputs. DataForSEO request usage depends on your provider plan and report.

## Actor input object example

```json
{
  "mode": "domain_organic_keywords",
  "domains": [
    "example.com"
  ],
  "keywords": [
    "technical seo"
  ],
  "locationCode": 2840,
  "languageCode": "en",
  "maxResults": 10
}
```

# Actor output Schema

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

Normalized DataForSEO rows from the selected report.

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

Terminal outcome, counts, charges, and warnings.

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

Detailed safe diagnostics and each upstream request result.

# 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": [
        "example.com"
    ],
    "keywords": [
        "technical seo"
    ],
    "locationCode": 2840,
    "languageCode": "en",
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/semrush-api-scraper").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": ["example.com"],
    "keywords": ["technical seo"],
    "locationCode": 2840,
    "languageCode": "en",
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/semrush-api-scraper").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": [
    "example.com"
  ],
  "keywords": [
    "technical seo"
  ],
  "locationCode": 2840,
  "languageCode": "en",
  "maxResults": 10
}' |
apify call khadinakbar/semrush-api-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/semrush-api-scraper"
        }
    }
}

```

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/b01aVlN9b3zbWlEb8/builds/tWq8vvczSFH2Gk8oo/openapi.json
