API Hop 文档
Google Trends 接口参考
查询 Google Trends 搜索热度、建议、实时热搜和相关新闻。
并发上限
AI 与 Data 分别共享账户级并发槽位,默认 5 AI / 2 Data,订阅套餐可调整上限。接口单独配置仍受分类总上限约束。达到任一上限返回 HTTP 429;异步任务执行结束前占用槽位。
GET /v1/google-trends/search GET /v1/google-trends/autocomplete GET /v1/google-trends/news GET /v1/google-trends/trending-now 查询 Google Trends 搜索热度、建议、实时热搜和相关新闻。
认证与计费
默认每次成功请求 $0.0003(300 credits)。 使用 API Hop API Key。可用性取决于已启用网关和密钥权限。每次成功请求的价格以当前目录和账户显示为准,账户专属价格优先。成功的空结果也计费,失败请求释放预占额度。超时为 60 秒,不自动重试或翻页,结算失败不会重复调用上游。
Authorization: Bearer YOUR_API_KEY仅接受查询参数,不接受请求体。拒绝未知、重复、空值或无效参数,已说明的 geo 和 gprop 空值除外。仅支持 JSON,不自动翻页或重试。AND 表示同时提供,OR 表示任一,XOR 表示二选一,NOT 表示不能提供,=> 表示需要。标识和新闻令牌应从最新响应复制;示例不代表真实测试结果。每次成功查询分别计费。
Google Trends: 查询搜索热度
GET https://api.apihop.ai/v1/google-trends/search
请求参数
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
query | string | 搜索词; query: REQUIRED | tesla |
country | string | 国家或站点代码 (country); country: optional; ^[A-Za-z]{2}$ | - |
language | string | 语言; language: optional | - |
category | string | 图表类型或地理粒度 (category); category: optional; interest_over_time, interest_by_region, related_queries, related_topics | interest_over_time |
time_range | string | 相对时间或日期范围 (time_range); time_range: optional | - |
device | string | 设备; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不归档响应产物; zero_trace: optional | true |
data_type | string | 图表类型或地理粒度 (data_type); data_type: optional; TIMESERIES, GEO_MAP, GEO_MAP_0, RELATED_TOPICS, RELATED_QUERIES | TIMESERIES |
geo | string | 趋势地区代码 (geo); geo: optional; UTF-8 bytes: 100 | - |
region | string | 图表类型或地理粒度 (region); region: optional; COUNTRY, REGION, DMA, CITY | COUNTRY |
cat | integer | 主题分类标识 (cat); cat: optional; 0, 3, 5, 7, 8, 11, 12, 13, 14, 16, ... 1133 | 0 |
gprop | string | 搜索来源 (gprop); gprop: optional; `, images, news, froogle, youtube` | |
date | string | 相对时间或日期范围 (date); date: optional; UTF-8 bytes: 256 | - |
csv | boolean | 附加 CSV 数据 (csv); csv: optional | true |
include_low_search_volume | boolean | 包括低搜索量地区 (include_low_search_volume); include_low_search_volume: optional | true |
tz | integer | 时区偏移分钟数(浏览器约定) (tz); tz: optional; min: -1439; max: 1439 | -1439 |
校验规则
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/query: 1..5 nonempty comma-separated terms; NOT (category AND data_type); NOT (date AND time_range)category: interest_over_time = TIMESERIES, interest_by_region = GEO_MAP_0, related_queries = RELATED_QUERIES, related_topics = RELATED_TOPICS; default TIMESERIESregion OR include_low_search_volume => data_type = GEO_MAP OR GEO_MAP_0; GEO_MAP_0 requires exactly one termgeo: empty = worldwide; uppercase country or subdivision; overrides country; comma-separated locations require TIMESERIES and one location per termgprop: empty = web search; froogle = shopping; tz: browser offset minutes (420 = UTC-07:00)date, time_range: all, now 1-H, now 4-H, now 1-d, now 7-d, today 1-m, today 3-m, today 12-m, today 5-y, OR ordered YYYY-MM-DD YYYY-MM-DD within 2004-01-01..todaydate: multiple comma-separated custom ranges require TIMESERIES and one range per term; cat: topic ID (default 0)
示例
curl --get "https://api.apihop.ai/v1/google-trends/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "query=tesla"Google Trends: 查询主题建议
GET https://api.apihop.ai/v1/google-trends/autocomplete
请求参数
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
query | string | 搜索词; query: REQUIRED | tesla |
language | string | 语言; language: optional | - |
limit | integer | 结果上限; limit: optional; min: 1; max: 100 | 1 |
device | string | 设备; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不归档响应产物; zero_trace: optional | true |
校验规则
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/
示例
curl --get "https://api.apihop.ai/v1/google-trends/autocomplete" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "query=tesla"Google Trends: 查询相关新闻
GET https://api.apihop.ai/v1/google-trends/news
请求参数
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
page_token | string | 从最新 Trending Now 结果复制的新闻令牌 (page_token); page_token: REQUIRED; UTF-8 bytes: 32768; ^gtn1\.[A-Za-z0-9_-]+$ | ${NEWS_PAGE_TOKEN} |
device | string | 设备; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不归档响应产物; zero_trace: optional | true |
校验规则
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/page_token: exact news_page_token from a fresh Trending Now response; account-bound opaque continuation, do not fabricate or reuse expired tokens
示例
curl --get "https://api.apihop.ai/v1/google-trends/news" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "page_token=${NEWS_PAGE_TOKEN}"Google Trends: 查询实时热搜
GET https://api.apihop.ai/v1/google-trends/trending-now
请求参数
| 字段 | 类型 | 约束 | 示例 |
|---|---|---|---|
country | string | 国家或站点代码 (country); country: optional; ^[A-Za-z]{2}$ | us |
language | string | 语言; language: optional | - |
limit | integer | 结果上限; limit: optional; min: 1; max: 100 | 1 |
device | string | 设备; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | 不归档响应产物; zero_trace: optional | true |
geo | string | 趋势地区代码 (geo); geo: optional; `, AL, DZ, AO, AR, AR-C, AR-B, AR-K, AR-H, AR-U`, ... 1445 | |
hours | integer | 过去的小时数 (hours); hours: optional; 4, 24, 48, 168 | 4 |
category_id | integer | 主题分类标识 (category_id); category_id: optional; 0, 1, 2, 3, 20, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19 | 0 |
only_active | boolean | 仅显示仍活跃的趋势 (only_active); only_active: optional | true |
校验规则
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/geo: empty = US; overrides country; hours: default 24; category_id: 0 = all; only_active: active trends only
示例
curl --get "https://api.apihop.ai/v1/google-trends/trending-now" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "country=us"响应与错误
保留原生 JSON 响应和数字精度。下方仅为空成功结果示例,不是真实调用。HTTP 400 表示输入无效;401 需要认证;402 余额不足;403 不可用或无权限;405 方法不支持;429 限流;5xx 服务或上游故障。请保留 X-Request-Id 以便排查。
{
"success": true,
"request_id": "example-request",
"data": {
"format": "json",
"content": {
"results": []
}
}
}