Keyword Insights Support Documentation
  • What is Keyword Insights?
  • learning center
    • Keyword Insights Tool Workflow
    • The Features
      • Keyword Clustering
        • The Advanced Settings
          • Keyword Grouping Accuracy
          • Topical Cluster Creation Method
          • Clustering Types
      • Topical Clusters
      • Competitor Visibility
      • Search Intent/Context
      • Keyword Discovery
      • Content Briefs
      • Writer Assistant
      • AI Writer Agent
    • Freemium Tools
      • SERP Similarity
      • SERP Analyzer
      • Title AI - (Blog Idea Generator)
  • User guide
    • How To Get The $1 Trial
    • How To Build Keyword Lists
      • Using Keyword Discovery
      • Google Search Console (Integration)
      • Using Google Keyword Planner
      • Using Ahrefs/Semrush
      • Google Search Console (Manual)
  • Understanding the output
    • How to Interpret Clusters with In-app Visualisations
    • How to Interpret Clusters in Google Sheets
    • How to Interpret Topical clusters
    • How to Interpret Context/Intent
  • Tool use cases
    • Finding Keyword Cannibalisation (Case study 1)
    • Finding Keyword Cannibalisation (Case study 2)
    • Finding Content Gaps
    • Uncover Keyword Opportunities
    • Find Intent Misalignment
    • Building service level pages
  • Account Management
    • Pricing
      • Subscription
        • Universal Credits Explained
      • Legacy Subscriptions
    • Subscription Management
      • Buying a subscription
      • Cancelling a subscription
      • Pausing a subscription
      • Downgrading a subscription
      • Upgrading a subscription
      • Refunds
    • Payments & Credit cards
      • Downloading invoices
      • Add or change VAT number
      • Changing billing name or address
      • How to add a backup payment method
      • Changing credit card details
    • Team Management
      • Adding a Team Member
      • Sharing Team Reports
      • Sharing Projects
      • User seats
  • Data retention
    • Data storage and limits
  • ⚙️Integrations
    • Integrations
  • API
    • How to use the Public API?
    • API Use Cases
      • Public API: Clustering
  • FAQs
    • Frequently Asked Questions
  • Help & Support
    • Getting Support
    • Changelog
Powered by GitBook
On this page
  • Clustering: Intent Only
  • Intent Only: Parameters
  • Intent Only: Example Payload
  • Intent Only: Code Example Python
  1. API
  2. API Use Cases

Public API: Clustering

On this page, you'll find examples on how to use the Keyword Insights Public API for clustering projects.

Clustering: Intent Only

In order to create a clustering order for intent only, you have to specify all clustering parameters, exactly as for a full clustering order.

Intent Only: Parameters

project_name*: Name of the project for easier identification in the keywordinsights.ai UI.

keywords*: List of keywords. ["keyword 1", "keyword 2", "keyword 3"]

search_volumes*: List of search volumes. [213, 1561, 616] Or any data really doesn't matter, as that is always provided by the user

language*: Language code to use for SERP results scraping.

location*: Location name to use for SERP results scraping.

insights*: The types of insights to perform within the order (cluster required).

clustering_method: The method to be used for grouping the keywords into clusters.

grouping_accuracy: Parameter used with clustering method "volume". Describes minimum number of SERP URLs in common between every keyword in cluster and cluster lead keyword.

hub_creation_method: Describes the level of similarity of keywords within the cluster for the HUB algorithm.

device: The device for the SERP scraping.

mobile_type: The type of mobile device. Applied if device=mobile.

tablet_type: The type of tablet device. Applied if device=tablet.

url: The url for ranking. Required if "rank" is specified within the "insights" property.

Intent Only: Example Payload

The difference to a full clustering order is the contents of the insights array inside the payload. You only need to pass "context" vs "context", "rank" and "cluster".

For a full clustering order, you need to define:

"insights": [
    "cluster",
    "rank",
    "context"
  ],

For an intent only orders you only pass context:

"insights": [
    "context"
  ],

A full example of an intent only order below:

{
  "clustering_method": "volume",
  "device": "desktop",
  "grouping_accuracy": 4,
  "hub_creation_method": "medium",
  "insights": [
    "context"
  ],
  "keywords": [
    "tesla",
    "tesla s",
    "tesla 3",
    "tesla x"
  ],
  "language": "en",
  "location": "United States",
  "mobile_type": "android",
  "project_name": "project_name",
  "search_volumes": [
    213,
    1561,
    616,
    777
  ],
  "tablet_type": "android",
  "url": "https://tesla.com/"
}

Intent Only: Code Example Python

import os
from urllib.parse import urljoin

import requests

# See https://docs.keywordinsights.ai/api/public-api-documentation#how-to-authenticate-with-the-public-api-and-retrieve-a-bearer-token-email-and-password-approach
JWT_TOKEN = os.environ.get("JWT_TOKEN")
BASE_API = "https://api.keywordinsights.ai"

keywords = ["what was used before freon", "clean air act refrigerant regulations", "dielektrol capacitor"]

payload = {
    "clustering_method": "volume",
    "device": "desktop",
    "grouping_accuracy": 4,
    "hub_creation_method": "medium",
    "insights": ["context"],
    "keywords": keywords,
    "language": "en",
    "location": "United States",
    "project_name": "Intent only project",
    "search_volumes": len(keywords) * [0],
}

response = requests.post(
    urljoin(BASE_API, "/api/keywords-insights/order/"),
    headers={"Authorization": f"Bearer {JWT_TOKEN}"},
    json=payload,
)

print(response.json())  # Order will show in the dashboard under "Intent only project"

PreviousAPI Use CasesNextFrequently Asked Questions

Last updated 6 months ago