Full endpoint reference available on Swagger.
Quick Start
Create a keyword content order to extract People Also Ask questions:import os
import requests
API_KEY = os.environ["KWI_API_KEY"]
BASE_URL = "https://api.keywordinsights.ai"
HEADERS = {"X-API-Key": API_KEY}
payload = {
"keyword": "best project management tools",
"language": "en",
"location": "United States",
"content_insights": ["paa"],
}
response = requests.post(
f"{BASE_URL}/api/keyword-content/order/",
headers=HEADERS,
json=payload,
)
data = response.json()
print(data)
# {"status": true, "order_id": "2879fa0b-...", "cost": 50}
const API_KEY = process.env.KWI_API_KEY;
const BASE_URL = "https://api.keywordinsights.ai";
const HEADERS = {
"X-API-Key": API_KEY,
"Content-Type": "application/json"
};
const payload = {
keyword: "best project management tools",
language: "en",
location: "United States",
content_insights: ["paa"],
};
async function createOrder() {
const response = await fetch(`${BASE_URL}/api/keyword-content/order/`, {
method: "POST",
headers: HEADERS,
body: JSON.stringify(payload),
});
const data = await response.json();
console.log(data);
// {"status": true, "order_id": "2879fa0b-...", "cost": 50}
}
createOrder();
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /api/keyword-content/order/ | Create a keyword content order |
| GET | /api/keyword-content/order/?order_id={id} | Get order status and results |
Parameters
Required
| Parameter | Type | Description |
|---|---|---|
keyword | string | Target keyword to research |
language | string | Language code (e.g. en). See /api/content-brief/languages/ |
location | string | Location name (e.g. United States). See /api/keywords-insights/locations/ |
content_insights | string[] | Types of content insights to extract (see below) |
Optional
| Parameter | Type | Default | Description |
|---|---|---|---|
device | string | desktop | desktop or mobile |
Content Insight Types
Thecontent_insights array controls which data is extracted. You can combine multiple types in a single order:
| Insight | Description | Cost |
|---|---|---|
paa | People Also Ask questions from Google SERP | 50 credits |
reddit_questions | Related Reddit discussions and questions | 50 credits |
quora_questions | Related Quora questions | 50 credits |
meta_titles | AI-generated meta title suggestions | 200 credits |
meta_descriptions | AI-generated meta description suggestions | 200 credits |
Customizations
All Content Insights
Extract everything in a single order:payload = {
"keyword": "email marketing automation",
"language": "en",
"location": "United States",
"content_insights": [
"paa",
"reddit_questions",
"quora_questions",
"meta_titles",
"meta_descriptions",
],
}
# Cost: 50 + 50 + 50 + 200 + 200 = 550 credits
const payload = {
keyword: "email marketing automation",
language: "en",
location: "United States",
content_insights: [
"paa",
"reddit_questions",
"quora_questions",
"meta_titles",
"meta_descriptions",
],
};
// Cost: 50 + 50 + 50 + 200 + 200 = 550 credits
Questions Only
Get user questions from multiple platforms at a lower cost:payload = {
"keyword": "best CRM software",
"language": "en",
"location": "United States",
"content_insights": ["paa", "reddit_questions", "quora_questions"],
}
# Cost: 50 + 50 + 50 = 150 credits
const payload = {
keyword: "best CRM software",
language: "en",
location: "United States",
content_insights: ["paa", "reddit_questions", "quora_questions"],
};
// Cost: 50 + 50 + 50 = 150 credits
Retrieving Results
Poll until the order status is"done":
import os
import time
import requests
API_KEY = os.environ["KWI_API_KEY"]
BASE_URL = "https://api.keywordinsights.ai"
HEADERS = {"X-API-Key": API_KEY}
order_id = "2879fa0b-deae-4aab-ad87-fd8fb8db9717"
while True:
response = requests.get(
f"{BASE_URL}/api/keyword-content/order/",
headers=HEADERS,
params={"order_id": order_id},
)
data = response.json()["result"]["payload"]
if data["status"] == "done":
break
print("Processing...")
time.sleep(10)
results = data["results"]
# People Also Ask
if "paa" in results:
print("People Also Ask:")
for q in results["paa"]:
print(f" - {q}")
# Reddit questions
if "reddit_questions" in results:
print("\nReddit questions:")
for q in results["reddit_questions"]:
print(f" - {q}")
# AI meta titles
if "meta_titles" in results:
print("\nSuggested meta titles:")
for title in results["meta_titles"]:
print(f" - {title}")
const API_KEY = process.env.KWI_API_KEY;
const BASE_URL = "https://api.keywordinsights.ai";
const HEADERS = { "X-API-Key": API_KEY };
const order_id = "2879fa0b-deae-4aab-ad87-fd8fb8db9717";
async function getResults() {
let data;
while (true) {
const url = new URL(`${BASE_URL}/api/keyword-content/order/`);
url.searchParams.append("order_id", order_id);
const response = await fetch(url, {
headers: HEADERS,
});
const json = await response.json();
data = json.result.payload;
if (data.status === "done") {
break;
}
console.log("Processing...");
await new Promise((r) => setTimeout(r, 10000));
}
const results = data.results;
// People Also Ask
if (results.paa) {
console.log("People Also Ask:");
for (const q of results.paa) {
console.log(` - ${q}`);
}
}
// Reddit questions
if (results.reddit_questions) {
console.log("\nReddit questions:");
for (const q of results.reddit_questions) {
console.log(` - ${q}`);
}
}
// AI meta titles
if (results.meta_titles) {
console.log("\nSuggested meta titles:");
for (const title of results.meta_titles) {
console.log(` - ${title}`);
}
}
}
getResults();
# Download CSV files
files = results.get("files", {}).get("csv", {})
for insight_type, download_url in files.items():
print(f"{insight_type}: {download_url}")
// Download CSV files
const files = results.files?.csv || {};
for (const [insight_type, download_url] of Object.entries(files)) {
console.log(`${insight_type}: ${download_url}`);
}
Complete Example
Extract People Also Ask and Reddit questions, then save results to a file:import os
import time
import json
import requests
API_KEY = os.environ["KWI_API_KEY"]
BASE_URL = "https://api.keywordinsights.ai"
HEADERS = {"X-API-Key": API_KEY}
def create_content_order(keyword, insights, language="en", location="United States"):
"""Create a keyword content order."""
response = requests.post(
f"{BASE_URL}/api/keyword-content/order/",
headers=HEADERS,
json={
"keyword": keyword,
"language": language,
"location": location,
"content_insights": insights,
},
)
response.raise_for_status()
return response.json()
def wait_for_results(order_id):
"""Poll until results are ready."""
while True:
response = requests.get(
f"{BASE_URL}/api/keyword-content/order/",
headers=HEADERS,
params={"order_id": order_id},
)
data = response.json()["result"]["payload"]
if data["status"] == "done":
return data["results"]
print("Processing...")
time.sleep(10)
# --- Run ---
result = create_content_order(
keyword="best project management tools",
insights=["paa", "reddit_questions"],
)
order_id = result["order_id"]
print(f"Order created: {order_id} (cost: {result['cost']} credits)")
results = wait_for_results(order_id)
# Save to file
with open("content_research.json", "w") as f:
json.dump(results, f, indent=2)
paa_count = len(results.get("paa", []))
reddit_count = len(results.get("reddit_questions", []))
print(f"Saved {paa_count} PAA questions and {reddit_count} Reddit questions")
const fs = require("fs");
const API_KEY = process.env.KWI_API_KEY;
const BASE_URL = "https://api.keywordinsights.ai";
const HEADERS = {
"X-API-Key": API_KEY,
"Content-Type": "application/json"
};
async function createContentOrder(keyword, insights, language = "en", location = "United States") {
const response = await fetch(`${BASE_URL}/api/keyword-content/order/`, {
method: "POST",
headers: HEADERS,
body: JSON.stringify({
keyword,
language,
location,
content_insights: insights,
}),
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return await response.json();
}
async function waitForResults(order_id) {
while (true) {
const url = new URL(`${BASE_URL}/api/keyword-content/order/`);
url.searchParams.append("order_id", order_id);
const response = await fetch(url, {
headers: HEADERS,
});
const json = await response.json();
const data = json.result.payload;
if (data.status === "done") {
return data.results;
}
console.log("Processing...");
await new Promise((r) => setTimeout(r, 10000));
}
}
// --- Run ---
async function run() {
const result = await createContentOrder(
"best project management tools",
["paa", "reddit_questions"]
);
const order_id = result.order_id;
console.log(`Order created: ${order_id} (cost: ${result.cost} credits)`);
const results = await waitForResults(order_id);
// Save to file
fs.writeFileSync("content_research.json", JSON.stringify(results, null, 2));
const paa_count = (results.paa || []).length;
const reddit_count = (results.reddit_questions || []).length;
console.log(`Saved ${paa_count} PAA questions and ${reddit_count} Reddit questions`);
}
run();