SOKE
API ReferenceResearch

Keyword Research

Discover high-opportunity keywords with competition scores, trend data, and long-tail phrases.

POST /api/v1/research/keywords

Research keywords for a given topic. Returns trending terms, competition scores, trend directions, long-tail phrases, and top competing videos. When no topic is provided, Soke automatically uses keywords extracted from your connected YouTube channel.

Credits: 2 per request

Authentication

X-Soke-Key: sk_live_your_api_key
Authorization: Bearer your_jwt_token

Request Body

FieldTypeRequiredDefaultDescription
topicstringNoThe topic or keyword to research. Omit to use your connected channel's keywords.
platformstringNo"youtube"Target platform
nichestringNoContent niche for additional context
regionstringNo"US"Region code for localized results
maxResultsintegerNo20Maximum keywords to return (1–50)
recencyDaysintegerNo365Only analyse content published within this many days. Range: 1–3650.

When topic is omitted or empty, Soke automatically extracts keywords from your connected YouTube channel's top-performing videos (tags and titles). Channel keywords are cached for 6 hours for fast responses. If no channel is connected and no topic is provided, the endpoint returns a TOPIC_REQUIRED error.

Results are filtered to the last 12 months by default to ensure you see current competition data. Pass recencyDays to widen or narrow the window (e.g., 30 for the last month, 730 for the last two years).

Example Requests

With a topic

curl -X POST https://api.usesoke.ai/api/v1/research/keywords \
  -H "Content-Type: application/json" \
  -H "X-Soke-Key: sk_live_your_api_key" \
  -d '{
    "topic": "productivity tips for developers",
    "platform": "youtube",
    "recencyDays": 180
  }'

Without a topic (channel auto-detect)

curl -X POST https://api.usesoke.ai/api/v1/research/keywords \
  -H "Content-Type: application/json" \
  -H "X-Soke-Key: sk_live_your_api_key" \
  -d '{}'

Response

200 OK
{
  "success": true,
  "data": {
    "topic": "productivity tips for developers",
    "keywords": [
      {
        "keyword": "productivity tips for developers",
        "searchVolume": 8,
        "competitionScore": 0.342,
        "trendDirection": "rising",
        "isLongTail": true,
        "relatedTerms": [
          "developer productivity hacks",
          "coding productivity",
          "time management for programmers"
        ]
      },
      {
        "keyword": "developer productivity hacks",
        "searchVolume": 5,
        "competitionScore": 0.218,
        "trendDirection": "rising",
        "isLongTail": true,
        "relatedTerms": []
      }
    ],
    "longTailPhrases": [
      "productivity tips for developers 2024",
      "best productivity tips for software developers"
    ],
    "topCompetingVideos": [
      {
        "title": "10 Productivity Tips Every Developer Needs",
        "channelTitle": "Tech With Tim",
        "viewCount": 524000,
        "publishedAt": "2024-08-15T14:00:00Z",
        "description": "In this video I share my top productivity tips...",
        "tags": ["productivity", "developer", "coding"],
        "viewVelocity": 1200.5
      }
    ],
    "dataSources": "YouTube Suggest API, YouTube Data API v3, Google Trends"
  },
  "meta": {
    "platform": "youtube",
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "processing_time_ms": 1850
  }
}

Response Fields

FieldTypeDescription
topicstringThe researched topic (may differ from input if auto-detected from channel)
keywordsarrayKeyword results sorted by opportunity (low competition first)
keywords[].keywordstringThe keyword or phrase
keywords[].searchVolumeinteger | nullEstimated relative search volume
keywords[].competitionScorenumberCompetition score from 0 (low) to 1 (high)
keywords[].trendDirectionstring"rising", "falling", or "stable"
keywords[].isLongTailbooleanWhether the keyword has 4+ words
keywords[].relatedTermsstring[]Related keyword suggestions
longTailPhrasesstring[]Long-tail phrases extracted from results
topCompetingVideosarrayTop 5 competing videos by view count
topCompetingVideos[].viewVelocitynumberAverage views per day since publish
dataSourcesstringData sources used for the analysis

Error Codes

CodeStatusDescription
TOPIC_REQUIRED400No topic provided and no YouTube channel connected
BAD_REQUEST400Invalid parameters (e.g., topic exceeds 200 characters)
RATE_LIMIT_EXCEEDED429Rate limit exceeded
INSUFFICIENT_CREDITS402Not enough credits
PLATFORM_NOT_IMPLEMENTED501Platform not yet supported

On this page