主题
按 Google 产品或服务类别获取(实时)
本接口使用 POST 方法,路径为:
/v3/keywords_data/google/keywords_for_category/live
本接口根据指定的 Google 产品或服务类别返回建议,并同时提供最近一个月的搜索量、过去 12 个月的搜索量趋势、平均每次点击费用(CPC)和付费搜索竞争度。
这是实时查询接口,提交请求后无需再单独调用任务查询接口即可获取结果。若不要求实时返回,可使用标准任务接口,以降低单次成本。搜索量的更新状态可通过以下接口查询:
/v3/keywords_data/google/adwords_status
> 说明:该接口使用的是容路径,底层数据来源于 Google Ads 数据服务。
请求信息
- 请求方法:POST
- 请求地址:
https://api.seermartech.cn/v3/keywords_data/google/keywords_for_category/live - 请求格式:JSON
- 请求体格式:JSON 数组
- 单次请求最多返回:700 个建议 平台限流以认证说明中的 30/60/120 次/分钟规则为准
无论最终返回多少个,均按请求次数计费;返回 1 个或 700 个的单次价格相同。
计费说明
参考价约 ¥0.5400 / 次。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
category_code | integer | 是 | Google 产品或服务类别 ID。可通过 GET /v3/keywords_data/google/categories 获取可用类别列表。 |
location_name | string | 否 | 搜索引擎位置的完整名称。使用该参数时,不要同时传 location_code 或 location_coordinate。可通过 GET /v3/keywords_data/google/locations 获取位置列表。忽略此参数时返回结果。示例:London,England,United Kingdom |
location_code | integer | 否 | 搜索引擎位置代码。使用该参数时,不要同时传 location_name 或 location_coordinate。示例:2840 |
location_coordinate | string | 否 | 位置 GPS 坐标,格式为 纬度,经度。使用该参数时,不要同时传 location_name 或 location_code。数据将坐标所属国家返回。示例:52.6178549,-155.352142 |
language_name | string | 否 | 搜索引擎语言名称。使用该参数时,不要同时传 language_code。可通过 GET /v3/keywords_data/google/languages 获取语言列表。忽略此参数时返回所有可用语言的结果。示例:English |
language_code | string | 否 | 搜索引擎语言代码。使用该参数时,不要同时传 language_name。示例:en |
search_partners | boolean | 否 | 是否 Google 搜索合作伙伴网络的数据。true 表示同时返回 Google 及搜索合作伙伴数据,默认值为 false。 |
sort_by | string | 否 | 结果排序方式。可选值:search_volume、relevance。结果按降序排列,默认值为 search_volume。 |
keywords_negative | array | 否 | 否定列表。列表中的不会出现在结果中,最多可指定 200 个。传的会自动转换为小写。 |
tag | string | 否 | 用户自定义任务标识,最长 255 个字符。可用于请求与响应,返回值位于响应的 data 对象中。 |
参数互斥
以下参数组中,每组只能选择一个:
location_name、location_code、location_coordinatelanguage_name、language_code
请求示例
cURL
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/keywords_data/google/keywords_for_category/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"location_name": "United States",
"language_name": "English",
"category_code": 13895,
"sort_by": "search_volume",
"tag": "category-keywords-demo"
}
]'PHP
php
<?php
$apiUrl = 'https://api.seermartech.cn/v3/keywords_data/google/keywords_for_category/live';
$postData = [
[
'location_name' => 'United States',
'language_name' => 'English',
'category_code' => 13895
]
];
$ch = curl_init($apiUrl);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer smt_live_YOUR_KEY',
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode($postData, JSON_UNESCAPED_UNICODE)
]);
$response = curl_exec($ch);
if ($response === false) {
throw new Exception(curl_error($ch));
}
curl_close($ch);
$result = json_decode($response, true);
print_r($result);TypeScript
typescript
import axios from "axios";
const postData = [
{
location_name: "United States",
language_name: "English",
category_code: 13895,
},
];
axios({
method: "post",
url: "https://api.seermartech.cn/v3/keywords_data/google/keywords_for_category/live",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
data: postData,
})
.then((response) => {
// 处理响应数据
console.log(response.data);
})
.catch((error) => {
console.error(error.response?.data || error.message);
});Python
python
import requests
url = "https://api.seermartech.cn/v3/keywords_data/google/keywords_for_category/live"
post_data = [
{
"location_name": "United States",
"language_name": "English",
"category_code": 13895
}
]
response = requests.post(
url,
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
},
json=post_data,
timeout=60
)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败,状态码:%s,信息:%s"
% (result.get("status_code"), result.get("status_message"))
)C#
csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public static class Demo
{
public static async Task GetKeywordsForCategoryLive()
{
using var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "smt_live_YOUR_KEY");
var postData = new[]
{
new
{
location_name = "United States",
language_name = "English",
category_code = 13895
}
};
var content = new StringContent(
JsonSerializer.Serialize(postData),
Encoding.UTF8,
"application/json"
);
var response = await httpClient.PostAsync(
"https://api.seermartech.cn/v3/keywords_data/google/keywords_for_category/live",
content
);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}响应结构
服务端返回 JSON 数据 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 请求级状态码。成功通常为 20000。 |
status_message | string | 请求级状态信息。 |
time | string | 请求执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | tasks 数组中返回错误的任务数量。 |
tasks | array | 任务结果数组。 |
完整状态码和错误信息请参考错误码文档。
tasks 对象字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。 |
status_code | integer | 任务状态码,通常位于 10000–60000 范围。 |
status_message | string | 任务状态信息。 |
time | string | 任务执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
result_count | integer | result 数组中的结果数量。 |
path | array | 请求路径信息。 |
data | object | 本次请求中传的参数。 |
result | array | 结果数组。 |
result 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 返回的。 |
location_code | integer / null | 对应的位置代码。无数据时为 null。 |
language_code | string / null | 对应的语言代码。无数据时为 null。 |
search_partners | boolean | 是否搜索合作伙伴网络的数据。 |
competition | float / null | 付费搜索竞争度,取值范围为 0–1,表示付费搜索结果中的相对竞争程度。无数据时为 null。 |
cpc | float / null | 历史平均每次点击费用。该字段沿用平台数据口径,通常以表示;无数据时为 null。 |
search_volume | integer / null | 月均搜索量,即目标地理位置下该的估算月均搜索次数。无数据时为 null。 |
categories | array / null | 与的产品或服务类别。无数据时为 null。 |
monthly_searches | array / null | 过去 12 个月的月度搜索量数据。无数据时为 null。 |
monthly_searches 数组字段
| 字段 | 类型 | 说明 |
|---|---|---|
year | integer | 年份。 |
month | integer | 月份。 |
search_volume | integer | 当月估算搜索量。 |
响应示例
json
{
"version": "0.1.20200130",
"status_code": 20000,
"status_message": "Ok.",
"time": "5.2880 sec.",
"cost": 0.54,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "00000000-0000-0000-0000-000000000000",
"status_code": 20000,
"status_message": "Ok.",
"time": "5.1000 sec.",
"cost": 0.54,
"result_count": 3,
"path": [
"v3",
"keywords_data",
"google",
"keywords_for_category",
"live"
],
"data": {
"api": "keywords_data",
"function": "keywords_for_category",
"se": "google",
"location_name": "London,England,United Kingdom",
"language_name": "English",
"category_code": 13895,
"tag": "tag1"
},
"result": [
{
"keyword": "polygon",
"location_code": 1006886,
"language_code": "en",
"search_partners": false,
"competition": 0.0013572539051896456,
"cpc": 0,
"search_volume": 6600,
"categories": [],
"monthly_searches": [
{
"year": 2024,
"month": 1,
"search_volume": 6600
}
]
},
{
"keyword": "mountain bike",
"location_code": 1006886,
"language_code": "en",
"search_partners": false,
"competition": 0.9998855922507818,
"cpc": 0.770228,
"search_volume": 5400,
"categories": [],
"monthly_searches": [
{
"year": 2024,
"month": 1,
"search_volume": 5400
}
]
},
{
"keyword": "hyundai kona",
"location_code": 1006886,
"language_code": "en",
"search_partners": false,
"competition": 0.29028968834971763,
"cpc": 0.860399,
"search_volume": 4400,
"categories": [],
"monthly_searches": [
{
"year": 2024,
"month": 1,
"search_volume": 4400
}
]
}
]
}
]
}错误处理
建议客户端同时检查以下字段:
- 顶层
status_code - 顶层
status_message tasks_error- 每个任务对象中的
status_code - 每个任务对象中的
status_message
当 status_code 不等于 20000,或 tasks_error 大于 0 时,应记录错误信息并根据业务需要执行重试、降级或人工复核。
实用场景
- 发现指定产品类别下的,快速构建 SEO主题和库。
- 筛选高搜索量,优安排落地页、专题页和博客的优化顺序。
- 结合竞争度与 CPC 评估商业价值,识别适合投放或重点转化的。
- 分析过去 12 个月的搜索趋势,判断季节性需求并规划发布时间。
- 按国家、城市或语言拆分数据,支持多地区 SEO 策略和本地化市场分析。