> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Serp Competitors

> Find which domains rank for a set of keywords in Google according to DataForSEO Labs, with how many of the keywords each ranks for, its average and median position, visibility and estimated traffic

Find which domains rank for a set of keywords in Google according to DataForSEO Labs, with how many of the keywords each ranks for, its average and median position, visibility and estimated traffic. Useful to size a niche or pick competitors.

|                      |                                   |
| -------------------- | --------------------------------- |
| **App**              | DataForSEO                        |
| **Operation ID**     | `dataforseo_get_serp_competitors` |
| **Type**             | Action                            |
| **Connection**       | `dataforseo` (required)           |
| **Credits per run**  | Free                              |
| **Agent / MCP tool** | Yes                               |

## Inputs

| Field                | Type                       | Required | Default | Description                                                                                                                                                                                                                                                   |
| -------------------- | -------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `keywords`           | array of string or string  | Yes      | -       | Keywords whose SERPs to analyse, as a list or newline/comma-separated text. Up to 200 per request.                                                                                                                                                            |
| `location`           | string or SelectableOption | No       | `2840`  | Country or location: a two-letter country code (us, gb, de...), a DataForSEO location code (2840 = United States), or a full location name such as 'London,England,United Kingdom'. Defaults to the United States.                                            |
| `language`           | string or SelectableOption | No       | `en`    | Language code of the search results, e.g. en, de, es, fr, nl. Defaults to en.                                                                                                                                                                                 |
| `include_subdomains` | boolean                    | No       | `True`  | Count subdomains together with their root domain.                                                                                                                                                                                                             |
| `item_types`         | string or array of string  | No       | -       | SERP element types to count: organic, paid, featured\_snippet, local\_pack, ai\_overview\_reference. Defaults to organic and paid.                                                                                                                            |
| `filters`            | array of FilterItem        | No       | -       | Up to 8 filters on dotted result fields, e.g. keywords\_count GREATER\_THAN 3, avg\_position LESS\_THAN 10, etv GREATER\_THAN 100, domain NOT\_CONTAINS 'wikipedia'.                                                                                          |
| `orders`             | array of OrderItem         | No       | -       | Sort by up to 3 dotted result fields, e.g. keyword\_info.search\_volume DESC.                                                                                                                                                                                 |
| `limit`              | integer                    | No       | `100`   | Maximum number of rows to return (1 to 1000). Defaults to 100. Each row is billed by DataForSEO, so keep this as small as the task needs.                                                                                                                     |
| `offset`             | integer                    | No       | -       | Number of rows to skip, for paging.                                                                                                                                                                                                                           |
| `fields`             | string or array of string  | No       | -       | Dotted result fields to keep, e.g. domain, avg\_position, median\_position, rating, etv, keywords\_count, visibility, relevant\_serp\_items, keywords\_positions. Leave empty for the default set listed in the output description. Does not change the cost. |

### FilterItem

| Field      | Type                       | Required | Default | Description                                                                                                                                                                                                                                                                                 |
| ---------- | -------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `field`    | string or SelectableOption | Yes      | -       | The field to filter on, must be one of the current selected metrics or dimensions.                                                                                                                                                                                                          |
| `operator` | string                     | Yes      | -       | The operator to use for filtering. Must be one of the supported values. Use REGEXP\_MATCH to search/filter by multiple OR values like '.*(summer\|holiday).*'                                                                                                                               |
| `value`    | string                     | Yes      | -       | The value to filter by, always as a string: text, a number, or a regex. For IN\_LIST and NOT\_IN\_LIST, pass the values as one comma-separated string such as 'a,b,c', not as an array. For regex values, escape backslashes once in the JSON string: write \b for a word boundary, not \b. |

### OrderItem

| Field       | Type                       | Required | Default | Description                                                                      |
| ----------- | -------------------------- | -------- | ------- | -------------------------------------------------------------------------------- |
| `field`     | string or SelectableOption | Yes      | -       | The field to sort by. must be one of the current selected metrics or dimensions. |
| `direction` | string                     | Yes      | -       | The order to sort by, must be one of 'ASC', 'DESC'                               |

### SelectableOption

| Field   | Type   | Required | Default | Description |
| ------- | ------ | -------- | ------- | ----------- |
| `value` | string | Yes      | -       |             |
| `label` | string | Yes      | -       |             |

## Output

**Type**: `List[Dict]`

Returns one row per domain: domain, avg\_position, median\_position, rating, etv, keywords\_count, visibility, relevant\_serp\_items, keywords\_positions (keyword to list of positions).

**Fields**: `domain`, `avg_position`, `median_position`, `rating`, `etv`, `keywords_count`, `visibility`

**Example**:

```json theme={"dark"}
[
  {
    "domain": "ahrefs.com",
    "avg_position": 2.5,
    "median_position": 2,
    "rating": 148,
    "etv": 44210.4,
    "keywords_count": 4
  }
]
```
