API Documentation

Keyword Difficulty (KD) API

Query keyword difficulty and normalized SERP results by keyword.

Test API

See the Keyword Difficulty API product page for competition research use cases and an interactive test. This reference covers request inputs, result fields and billing.

Keyword Difficulty API product page →

Endpoint

GET https://api.goanyapi.com/api/v1/keyword-difficulty

With the current configuration, each successful request costs 3 credits.

Authentication

Authorization: Bearer YOUR_API_KEY

Request Parameters

ParameterTypeRequiredDescription
keywordstringYesTarget keyword, up to 200 characters, e.g. ai
countrystringNoTwo-letter country code. Defaults to us

Example

GET /api/v1/keyword-difficulty?keyword=ai&country=us
Authorization: Bearer YOUR_API_KEY

Response Example

{
  "code": "ok",
  "message": "ok",
  "data": {
    "endpoint": "keyword-difficulty",
    "remainingCredits": 97,
    "query": {
      "keyword": "ai",
      "country": "us"
    },
    "keyword": "ai",
    "country": "us",
    "difficulty": 95,
    "shortage": 1391,
    "lastUpdate": "2026-08-09 05:00:20",
    "serp": {
      "results": [
        {
          "type": "organic",
          "position": 1,
          "positionWithMetrics": 1,
          "title": "Artificial intelligence",
          "url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
          "displayUrl": "https://en.wikipedia.org  wiki  Artificial_intelligence",
          "metrics": {
            "rank": 15,
            "domainRating": 97,
            "urlRating": 37,
            "traffic": 583603,
            "keywords": 946,
            "topKeyword": "artificial intelligence",
            "topVolume": 740000,
            "httpCode": 200
          },
          "siteLinks": []
        },
        {
          "type": "questions",
          "position": 3,
          "questions": [
            {
              "title": "Which AI is free to use?"
            }
          ]
        }
      ]
    }
  }
}

Response Fields

FieldDescription
data.endpointFixed value: keyword-difficulty
data.costCreditsCredits consumed under the current API configuration
data.remainingCreditsRemaining credits after deduction
data.keywordNormalized queried keyword
data.countrySearch country included in the result
data.difficultyKeyword Difficulty (KD) score
data.shortageShortage value included in the result
data.lastUpdateData update time
data.serp.resultsNormalized SERP entries
data.serp.results[].typeorganic, ai_overview, questions, or another result type

Organic entries may include position, title, URL, display URL, site links, and SEO metrics. AI Overview entries may include description and cited links. Question entries contain normalized question titles and optional links.

Billing

The current request cost follows the API configuration shown on this page.

  • Credits are deducted only after a successful non-empty result
  • Failed requests do not consume credits