---
title: "Keyword gap between two domains"
method: POST
path: "/v1/data/seo/keyword-gap"
tags: ["SEO: Competitors", "SEO: Keywords"]
---

# Keyword gap between two domains

`POST /v1/data/seo/keyword-gap`

## Request

- Base URL: `https://api.superagnt.com`
- URL: `https://api.superagnt.com/v1/data/seo/keyword-gap`
- Auth: API key in header `Authorization`

Compares two domains' organic rankings keyword by keyword. Each row carries keyword_data plus first_domain_serp_element (target1's ranking) and second_domain_serp_element (target2's) with rank_absolute, rank_group and the ranked URL. The classic gap query is: competitor ranks well, you don't — filters: [["first_domain_serp_element.rank_absolute",">",20],"and",["second_domain_serp_element.rank_absolute","<=",10]] with target1 = you, target2 = the competitor (a missing element means that domain does not rank at all). Cost scales with rows; the default 100 is enough for most gap analyses.

## Request body

- object
  - `target1` string, required: First domain (e.g. your domain), no protocol.
  - `target2` string, required: Second domain (e.g. a competitor), no protocol.
  - `location_code` integer: Geo target as a location code. Default 2840 (United States).
  - `language_code` string: Two-letter language code. Default 'en'.
  - `limit` integer: Max intersecting keywords to return. Default 100.
  - `offset` integer: Pagination offset.
  - `filters` unknown[]: Optional filter expression as [field, operator, value] triples joined by 'and'/'or'. Operators: =, <>, <, <=, >, >=, in, not_in, like, not_like. Recipe (their wins, your gaps): [["first_domain_serp_element.rank_absolute",">",20],"and",["second_domain_serp_element.rank_absolute","<=",10]].
    - unknown
  - `order_by` string[]: Sort rules.

## Response `200`

Keywords both domains rank for, with each domain's position, in `result[0].items`.

- object

## Other responses

- `400`: Bad request or upstream task error.
- `401`: Unauthorized.
- `429`: Too many requests.
- `5XX`: Upstream error.

---

[API](https://skmtc.dev/superagnt/apis/superagnt-api.md) · [All operations](https://skmtc.dev/superagnt/apis/superagnt-api/llms.txt) · [OpenAPI document](https://skmtc.dev/superagnt/apis/superagnt-api/revisions/b2d8de30ccf0?raw)
