Google Trends 搜尋 API
API 健康狀態
健康 可用 受限 多數不可用 無資料
正在載入健康狀態...
取得 Google Trends 搜尋資料,包括隨時間變化的興趣、地理細分及相關查詢,用於需求分析與季節性趨勢監控。
標籤: Google Trends
請求參數
| 名稱 | 必填 | 類型 | 預設值 | 說明 |
|---|---|---|---|---|
query | 是 | string | 要在 Google Trends 中分析的搜尋詞或主題 ID(例如 'iPhone'、'/m/027lnzs' 代表比特幣)。最多可提供 5 個以逗號分隔的詞彙進行比較。 | |
language | 否 | string | en | 使用兩個字母的代碼設定結果語言(例如 'en' 表示英文,'fr' 表示法文)。請參閱 Google 語言。 |
geo | 否 | string | 用於篩選趨勢的地理位置代碼(例如 'US'、'GB')。省略則為全球趨勢。請參閱 Google Trends 地點。 | |
region | 否 | string | 細化區域圖表的結果。 可用值: - COUNTRY:國家層級結果。- REGION:區域層級結果。- DMA:指定市場區域結果。- CITY:城市層級結果。 | |
data_type | 否 | string | 要擷取的趨勢資料類型。 可用值: - INTEREST_OVER_TIME:隨時間變化的興趣。舊值 TIMESERIES 也可接受。- REGION_BREAKDOWN:按區域劃分。舊值 GEO_MAP 也可接受。 | |
tz | 否 | integer | 時區偏移量(分鐘)(例如 '420' 代表 PDT)。範圍:-1439 到 1439。 | |
cat | 否 | string | 0 | 搜尋類別代碼(例如 '0' 代表所有類別)。 |
gprop | 否 | string | 用於篩選趨勢的 Google 屬性。 可用值: - IMAGES:Google 圖片。舊值 images 也可接受。- NEWS:Google 新聞。舊值 news 也可接受。- SHOPPING:Google 購物。舊值 froogle 也可接受。- YOUTUBE:YouTube。舊值 youtube 也可接受。 | |
date | 否 | string | 搜尋的日期範圍篩選器。支援預設值(now 1-H、now 4-H、now 1-d、now 7-d、today 1-m、today 3-m、today 12-m、today 5-y、all)和自訂範圍:yyyy-mm-dd yyyy-mm-dd(例如 2021-10-15 2022-05-25)或每小時 yyyy-mm-ddThh yyyy-mm-ddThh 在 1 週內(例如 2022-05-19T10 2022-05-24T22,基於 tz)。 |
複製請求
bash
curl -X GET "https://api.justserpapi.com/api/v1/google/trends/search?query=coffee" \
-H "X-API-Key: YOUR_API_KEY"js
const res = await fetch("https://api.justserpapi.com/api/v1/google/trends/search?query=coffee", {
headers: { "X-API-Key": "YOUR_API_KEY" }
});
const data = await res.json();
console.log(data);python
import requests
url = "https://api.justserpapi.com/api/v1/google/trends/search"
headers = { "X-API-Key": "YOUR_API_KEY" }
params = {
"query": "coffee"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())php
<?php
$url = "https://api.justserpapi.com/api/v1/google/trends/search?query=coffee";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-API-Key: YOUR_API_KEY"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.justserpapi.com/api/v1/google/trends/search?query=coffee", nil)
req.Header.Set("X-API-Key", "YOUR_API_KEY")
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}回應
正在載入最新回應範例...
