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": []
}
}
}