Skip to main content

Keyword Analysis API

developer
GET/v1/domain/keyword-analysis

Performs on-page keyword analysis including keyword extraction, density calculation, phrase analysis, and alignment checks between title, headings, meta description, and content.

What It Does

Extracts and analyzes keywords from page elements: title tag, meta description, H1/H2 headings, and body content. Calculates density for single words, two-word phrases, and three-word phrases. Checks keyword alignment across page elements (does the title contain the top keyword? does the H1?). Evaluates content focus as focused, moderate, or scattered.

Why It's Useful

Keyword optimization is foundational to SEO. This analysis reveals whether your content is focused on target keywords, whether key page elements are aligned, and identifies over-optimization or keyword stuffing risks.

Use Cases

Content Writer

Content Optimization

Analyze a published page to verify keyword usage and density align with target terms.

Optimize content for target keywords without over-optimization.

SEO Strategist

Competitive Keyword Analysis

Analyze competitor pages to understand which keywords they target and how they optimize.

Inform content strategy based on competitor keyword targeting.

SEO Manager

Content Audit

Bulk-analyze pages across a site to identify keyword cannibalization and content gaps.

Resolve keyword conflicts and find new content opportunities.

Parameters

NameLocationTypeRequiredDescription
domainquerystringRequiredDomain or full URL — accepts `example.com` or `https://example.com/path`.Example: https://example.com

Response Fields

Result fields below are inside the JSON data object. Any row named meta describes the sibling response metadata object. See response and error handling for status codes and error responses. Optional observations may be absent or null; inspect warnings and partial-failure fields before treating a missing result as a negative finding.

FieldTypeDescription
domainstringThe analyzed domain (bare hostname).
urlstringFull URL that was fetched, echoing the protocol used in the request.
targetKeywordsarrayInferred target keywords from title, H1, and meta description
titleKeywordsarrayKeywords found in the title tag
metaDescriptionKeywordsarrayKeywords found in the meta description
h1KeywordsarrayKeywords found in H1 headings
h2KeywordsarrayKeywords found in H2 headings
singleWordsarrayTop single keywords with count and density
twoWordPhrasesarrayTop two-word phrases with density
threeWordPhrasesarrayTop three-word phrases with density
keywordAlignmentobjectWhether top keywords appear in title, H1, URL, and meta
metaKeywordsobjectMeta keywords tag analysis with present flag, keywords array, and note
contentFocusobjectContent focus score and assessment (focused/moderate/scattered)
primaryKeywordobjectPosition-weighted primary keyword (title 10× / h1 5× / h2 3× / meta 3× / slug 5× / body 1×, body saturated at 8 occurrences). The actual topic the page is structured around — not just the most-repeated body word. Includes per-position sources breakdown and 0-100 confidence. Use this for real recommendations; the previous "topKeyword from body frequency" heuristic generated harmful advice like "force MCP into the page title" when the body happened to mention a technical term often.
secondaryKeywordsarrayNext 5 ranked keywords after the primary, same shape (score, confidence, per-position sources).
brandobjectBrand-name signal extracted from the hostname-first-label, surfaced separately so brand mentions don't dominate non-branded keyword analysis. { name, detected, totalOccurrences }.
declaredTargetKeywordsarrayPer-keyword coverage of the deprecated <meta name="keywords"> tag. Each entry: { keyword, presentInTitle, presentInH1, presentInBody, bodyOccurrences }. Surfaces drift between author-declared intent and shipped content.
topicAlignmentobjectTitle↔H1 alignment: titleWords, h1Words, sharedWords, missingFromH1, status ("aligned"/"partial"/"drift"). Drift flags when title and H1 don't reinforce each other — a top actionable SEO finding.
snippetReadinessobjectFeatured-snippet (position-zero) structural readiness: hasShortIntroParagraph, introParagraphWords, earlyListCount, hasComparisonTable, questionHeadings (What/How/Why...), and composite score 0-100. Restructuring a page using these signals is the highest-leverage SERP improvement available.
wordCountnumberTotal word count of page content
scorenumberKeyword optimization score (0-100)
gradestringLetter grade (A-F) based on score
recommendationsarrayKeyword optimization suggestions

Code Examples

Replace YOUR_API_KEY with your API key. This endpoint requires the developer plan or higher; see plans and usage limits.

cURL
curl --request GET 'https://api.edgedns.dev/v1/domain/keyword-analysis?domain=https%3A%2F%2Fexample.com' \
  --header "Authorization: Bearer YOUR_API_KEY"
JavaScript
const response = await fetch(
  "https://api.edgedns.dev/v1/domain/keyword-analysis?domain=https%3A%2F%2Fexample.com",
  {
    "method": "GET",
    "headers": {
      "Authorization": "Bearer YOUR_API_KEY"
    }
  }
);

if (!response.ok) {
  throw new Error(`EdgeDNS returned HTTP ${response.status}`);
}
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    'GET',
    "https://api.edgedns.dev/v1/domain/keyword-analysis?domain=https%3A%2F%2Fexample.com",
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    timeout=60,
)
response.raise_for_status()
data = response.json()
print(data)

Read the full Keyword Analysis guide

Learn the concepts, choose a practical workflow, and interpret the observations from Keyword Analysis before acting on them. Run supported checks via MCP or through REST.

Read the guide →

    Related Endpoints

    External References

    Learn more about the standards and protocols behind this endpoint.

    Try This Endpoint

    Test the Keyword Analysis endpoint live in the playground.

    Keyword Analysis API Reference | EdgeDNS