主题
Google Trends 语言列表
接口说明
GET /v3/keywords_data/google_trends/languages
调用本接口可获取 Google Trends 支持的语言列表。
该接口返回 JSON 格式数据,结果位于 tasks 数组中可用语言信息。
计费说明
调用本接口不收费。
可理解为参考价约 ¥0.0000 / 次。 扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求地址
https://api.seermartech.cn/v3/keywords_data/google_trends/languages
请求方式
GET
请求头
| 请求头 | 类型 | 填 | 说明 |
|---|---|---|---|
| Authorization | string | 是 | 使用 Bearer Token 鉴权:Bearer smt_live_YOUR_KEY |
| Content-Type | string | 是 | 固定为 application/json |
响应结构
| 字段名 | 类型 | 说明 |
|---|---|---|
version | string | API 当前版本 |
status_code | integer | 局状态码 |
status_message | string | 局状态信息 |
time | string | 执行耗时,单位:秒 |
cost | float | 本次请求总费用,单位:USD |
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 |
result_count | integer | result 数组中的数量 |
path | array | URL 路径 |
data | object | GET 请求 URL 中携带的参数信息 |
result | array | 结果数组 |
tasks[].data 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
api | string | API 模块名称 |
function | string | 接口功能名称 |
se | string | 搜索引擎或数据源标识,此处为 google_trends |
tasks[].result[] 字段
| 字段名 | 类型 | 说明 |
|---|---|---|
language_name | string | 语言名称 |
language_code | string | 语言代码,遵循 ISO 639-1 标准 |
状态码说明
-局状态码见:/v3/appendix/errors
- 任务状态码见:
/v3/appendix-errors/
常见成功状态:
20000:请求成功
调用示例
cURL
bash
curl --location --request GET "https://api.seermartech.cn/v3/keywords_data/google_trends/languages" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
url = "https://api.seermartech.cn/v3/keywords_data/google_trends/languages"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
result = response.json
# 处理返回结果
if result.get("status_code") == 20000:
print(result)
else:
print(f'error. Code: {result.get("status_code")} Message: {result.get("status_message")}')TypeScript
typescript
import axios from "axios";
axios({
method: "get",
url: "https://api.seermartech.cn/v3/keywords_data/google_trends/languages",
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
})
.then((response) => {
const result = response.data;
// 返回结果
console.log(result);
})
.catch((error) => {
console.error(error);
});响应示例
json
{
"version": "0.1.20200408",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1977 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "2d9a4c4e-6b6b-4a8c-8c7d-1234567890ab",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.1142 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"keywords_data",
"google_trends",
"languages"
],
"data": {
"api": "keywords_data",
"function": "languages",
"se": "google_trends"
},
"result": [
{
"language_name": "English",
"language_code": "en"
},
{
"language_name": "French",
"language_code": "fr"
}
]
}
]
}返回结果说明
接口成功后,tasks[].result 中会返回 Google Trends 可用语言列表。每条记录至少:
language_name:语言名称language_code:ISO 639-1 双字母语言代码
这些值通常用于后续趋势分析接口中的语言参数校验、下拉选项初始化或多语言映射。
注意事项
- 该接口为只读查询接口,无需提交请求体。
- 尽管返回结构中
cost字段,但该接口默认不计费。 - 建议在正式调用 Google Trends 接口前,通过本接口同步支持语言,传无效语言代码。
- 若需排查失败原因,请结合
status_code与status_message一并判断。
实用场景
- 初始化语言下拉选项:为趋势分析后台或报表系统拉取可选语言列表,手工维护枚举。
- 校验语言参数:在提交 Google Trends 查询前校验
language_code,降低无效请求和参数错误率。 - 构建多语言趋势监控:基于支持语言列表自动生成监控,提升跨地区、多语种 SEO 研究效率。
- 同步基础字数据:将语言列表定时写本地中心或数据库,便于前后端统一使用。
- 映射化设置:将平台语言标识与 ISO 639-1 代码对齐,便于趋势数据与站点化策略联动。