通过提取实时 SERP 数据来生成数据驱动的内容简介:排名靠前的标题、人们也提出问题、AI 概述存在以及相关搜索。每个简报的 API 总成本:0.025 美元(5 次搜索,每次 0.005 美元)。
前置条件
- Scavio API 密钥
- Python 3.8+ 或 Node.js 18+
- 内容片段的目标关键字
操作指南
步骤 1: 提取主关键字的 SERP 数据
在启用 AI 概览的情况下,在 Google 中搜索目标关键字。
Python
import requests, os
HEADERS = {'x-api-key': os.environ['SCAVIO_API_KEY'], 'Content-Type': 'application/json'}
def serp_data(query):
return requests.post('https://api.scavio.dev/api/v1/search',
headers=HEADERS,
json={'query': query, 'country_code': 'us',
'include_ai_overview': True}).json()
data = serp_data('best CRM software 2026')步骤 2: 提取简要组件
提取 PAA 问题、竞争对手标题和相关关键词。
Python
brief = {
'keyword': 'best CRM software 2026',
'top_titles': [r['title'] for r in data.get('organic_results', [])[:5]],
'paa_questions': [q['question'] for q in data.get('people_also_ask', [])],
'ai_overview': bool(data.get('ai_overview')),
'related_keywords': [r['query'] for r in data.get('related_searches', [])],
}
for k, v in brief.items():
print(f'{k}: {v}')步骤 3: 使用相关关键字 SERP 进行扩展
搜索 4 个相关关键字以获取更多上下文。
Python
for related_kw in brief['related_keywords'][:4]:
related_data = serp_data(related_kw)
related_paa = [q['question'] for q in related_data.get('people_also_ask', [])]
brief['paa_questions'].extend(related_paa)
brief['paa_questions'] = list(set(brief['paa_questions']))
print(f'Total unique PAA questions: {len(brief["paa_questions"])}')Python 示例
Python
import requests, os, json
H = {'x-api-key': os.environ['SCAVIO_API_KEY'], 'Content-Type': 'application/json'}
def content_brief(keyword, related_count=4):
def search(q):
return requests.post('https://api.scavio.dev/api/v1/search',
headers=H, json={'query': q, 'country_code': 'us',
'include_ai_overview': True}).json()
main = search(keyword)
brief = {
'keyword': keyword,
'top_titles': [r['title'] for r in main.get('organic_results', [])[:5]],
'paa': [q['question'] for q in main.get('people_also_ask', [])],
'ai_overview': bool(main.get('ai_overview')),
'related': [r['query'] for r in main.get('related_searches', [])],
}
for kw in brief['related'][:related_count]:
extra = search(kw)
brief['paa'].extend([q['question'] for q in extra.get('people_also_ask', [])])
brief['paa'] = list(set(brief['paa']))
return brief
b = content_brief('best CRM software 2026')
print(json.dumps(b, indent=2))JavaScript 示例
JavaScript
const H = {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'};
async function contentBrief(keyword) {
async function search(q) {
return fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST', headers: H,
body: JSON.stringify({query: q, country_code: 'us', include_ai_overview: true})
}).then(r => r.json());
}
const main = await search(keyword);
const brief = {
keyword,
topTitles: (main.organic_results || []).slice(0, 5).map(r => r.title),
paa: (main.people_also_ask || []).map(q => q.question),
aiOverview: !!main.ai_overview,
related: (main.related_searches || []).map(r => r.query),
};
for (const kw of brief.related.slice(0, 4)) {
const extra = await search(kw);
brief.paa.push(...(extra.people_also_ask || []).map(q => q.question));
}
brief.paa = [...new Set(brief.paa)];
return brief;
}
contentBrief('best CRM software 2026').then(b => console.log(JSON.stringify(b, null, 2)));预期输出
JSON
Content brief with top-ranking titles, unique PAA questions from main + related keywords, AI Overview presence flag, and related keyword list.