YepAPI

Command Palette

Search for a command to run...

POST/v1/seo/competitors/keywords

Keyword Gap Analysis API

Keyword gap analysis between two domains — find keywords your competitor ranks for that you don't. Close content gaps from $0.04/call.

Compare two domains side-by-side to find shared keywords (intersection) or keywords only one domain ranks for (gap). The classic competitor keyword gap analysis for SEO.

Try it live

Fill in the fields and hit Run to see a real response.

POST/v1/seo/competitors/keywords

Your domain or the primary domain to analyze.

Competitor domain to compare against.

Number of keywords to return.

Response
Example response — hit "Send Request" to see a live result
{
  "ok": true,
  "data": {
    "domain1": "stripe.com",
    "domain2": "square.com",
    "intersections": true,
    "keywords": [
      {
        "keyword": "payment processing",
        "volume": 33100,
        "cpc": 15.2,
        "competition": 0.85,
        "difficulty": 72,
        "intent": "commercial",
        "domain1": {
          "position": 3,
          "url": "https://stripe.com/payments",
          "etv": 4500
        },
        "domain2": {
          "position": 7,
          "url": "https://square.com/payments",
          "etv": 1200
        }
      },
      {
        "keyword": "online payments",
        "volume": 22200,
        "cpc": 12.8,
        "competition": 0.78,
        "difficulty": 65,
        "intent": "commercial",
        "domain1": {
          "position": 5,
          "url": "https://stripe.com",
          "etv": 2100
        },
        "domain2": {
          "position": 2,
          "url": "https://square.com/online-payments",
          "etv": 5800
        }
      }
    ]
  }
}

Features

Shared keywords with both domains' positions

In shared mode each keyword returns both domain1 and domain2 objects with their position, ranking url, and etv, so you see exactly where you and a competitor each rank for a term.

Gap mode: keywords only domain1 ranks for

Set the intersections field to false to flip into gap mode and return the keywords a competitor ranks for that you do not — the fastest list of new-traffic opportunities.

Volume, CPC, difficulty, and intent per keyword

Every keyword carries volume, cpc, difficulty, and an intent label (e.g. "commercial"), so you can prioritize gaps by value and buyer intent, not just by count.

Estimated traffic for each domain per keyword

Each domain's etv per keyword shows how much traffic that term drives for each site, revealing which shared keywords are worth fighting to win.

Configurable result limit up to 1000

Set limit up to 1000 per call (default 100); with $0.02 per 100 results on top of the $0.02 call, a full thousand-keyword gap analysis costs about $0.22.

Use cases

Keyword Gap Analysis

Find high-value keywords your competitor ranks for that you don't — the fastest path to new organic traffic.

Content Strategy Planning

Identify shared keywords where your competitor outranks you to prioritize content improvements.

SEO Benchmarking

Compare your keyword portfolio against a competitor to measure competitive positioning across shared terms.

Quick start

Copy this snippet and start making calls.

const res = await fetch('https://api.yepapi.com/v1/seo/competitors/keywords', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "domain1": "stripe.com",
    "domain2": "square.com",
    "intersections": true,
    "limit": 100,
    "location_code": 2840,
    "language": "en"
  }),
});
const data = await res.json();
console.log(data);

The keyword gap API for developers — find keywords a competitor ranks for that you don't

The Keyword Gap Analysis API compares two domains and returns either the keywords they both rank for (intersection) or the ones only your competitor ranks for (gap). Each keyword comes with volume, CPC, difficulty, intent, and both domains' positions and traffic — the classic competitor gap analysis, automated.

It is the term-level drill-down in YepAPI's competitor suite. Use the SERP Competitor endpoint to find who to compare against, then this endpoint to extract the exact keywords to target — and SERP Overlap for the page level, all under one key.

What is a keyword gap API?

A keyword gap API compares two domains' organic keyword footprints to find overlaps and gaps. In shared mode you get the keywords both rank for, with each side's position, url, and etv. In gap mode (intersections set to false) you get the keywords your competitor ranks for but you don't — the openings for new traffic. Each keyword carries volume, cpc, difficulty, and intent. YepAPI serves it at /v1/seo/competitors/keywords: post your domain, a competitor, a mode, and location/language, and receive the keyword list with full per-domain detail as JSON.

Build your own keyword gap tool

Build a competitive-research feature where a user enters their domain and a rival and gets two views: shared keywords where the competitor outranks them (improvement targets, sorted by the position gap) and gap keywords they don't rank for at all (expansion targets). Use intent and difficulty to surface commercial, winnable terms first. The per-domain etv shows the traffic at stake on each keyword. Pair with the SERP Competitor API to pick which rivals are worth this deeper, term-by-term comparison.

Keyword gap API pricing — $0.02 + $0.02 per 100 results

Each comparison is $0.02 plus $0.02 per 100 keywords returned, so a default 100-keyword gap analysis is about $0.04 and a full 1000-keyword pull lands near $0.22. The same gap analysis is a headline feature of $999/mo Ahrefs plans and enterprise Semrush tiers at $0.15–$0.25 per call; here you run it per request for cents and can compare against every relevant competitor without a subscription.

Find your fastest new-traffic opportunities

Run gap mode against your strongest competitor and sort the results by volume filtered to low difficulty and commercial intent — that is a ranked to-do list of keywords your rival already monetizes and you've ignored. Because each keyword shows the competitor's position and etv, you can estimate the traffic you'd capture by matching them. Repeating this across several competitors and merging the gaps reveals the terms missing from your strategy that the whole market is winning without you.

Try the keyword gap API free

Start with $5 of free credit, no credit card — enough for many gap analyses, including deep 1000-keyword pulls. Compare your domain against a known competitor, confirm the shared and gap modes return sensible keywords with correct positions, and wire the term lists into your content plan before you spend.

Start making API calls in 30 seconds

$5 free credit on signup. No credit card required. Pay per call.

What developers say

Switched from SerpAPI and cut our SERP costs by 80%. Same data quality, way simpler billing.

Marcus T.

SEO Platform Founder

One API key for AI models, SERP data, and web scraping. Saved us from managing 4 separate providers.

Priya S.

Full-Stack Developer

The $5 free credit let us prototype our entire rank tracking feature before committing. No other API does that.

Jake R.

Indie Hacker

Frequently asked questions

Compare two domains side-by-side to find shared keywords (intersection) or keywords only one domain ranks for (gap). The classic competitor keyword gap analysis for SEO.

Each API call costs $0.02 (+$0.02 per 100 results). No monthly minimums or subscriptions — you only pay for what you use.

Sign up for a free API key, then send a POST request to /v1/seo/competitors/keywords. Check the code example above for a ready-to-use snippet in JavaScript, cURL, or Python.

YepAPI bundles SEO, AI, and web scraping APIs under one key with no monthly minimums. You get lower per-call pricing, a unified dashboard, and one billing account instead of managing multiple providers.

Ready to integrate?

Get your API key and start making calls in 30 seconds. $5 free credit on signup — no credit card required.

More seo apis endpoints