SerpBase

API リファレンス · 検索エンジン

Google Search Autocomplete

接頭辞から Google の検索候補を取得します。検索ボリュームの測定値ではありません。

POSThttps://api.serpbase.dev/google/autocomplete
1 クレジットPlayground で実行

例

BASH
curl -X POST 'https://api.serpbase.dev/google/autocomplete' \
  -H "Content-Type: application/json" \
  -H 'X-API-Key: YOUR_API_KEY' \
  --max-time 60 \
  -d '{"query":"weather"}'
レスポンス · 実データ・抜粋
{
  "status": 0,
  "credits_charged": 1,
  "request_id": "r-4b27fe8a36d9ac303a5da7dd",
  "product_id": "google_autocomplete",
  "query": "weather",
  "search_type": "autocomplete",
  "suggestions": [
    {
      "rank": 1,
      "relevance": 601,
      "value": "weather tomorrow"
    },
    {
      "rank": 2,
      "relevance": 600,
      "value": "weather rock hill sc"
    }
  ]
}

パラメーター

format
"json" | "markdown"
json(デフォルト)は解析済みの結果、markdown は同じ結果を言語モデル向けの Markdown テキスト(text/markdown)で返します。
詳細

クレジットは同じで、失敗時は JSON のエンベロープが返ります。

query
string
例: "weather"

例は完全な契約ではありません。既知の項目は検証され、追加パラメーターは許可されます。

返るフィールド

フィールドは上の応答例のとおりです。すべてのエンドポイントに status、credits_charged、request_id が含まれます。

失敗したとき

失敗したリクエストは status が 0 以外で error が付き、課金されません。よくあるもの:

1000パラメーターが不足または誤りリクエストを修正
1020クレジット不足チャージ
1029毎秒リクエスト数の超過Retry-After 秒待つ
1502 · 1504今回は取得元を読み取れなかった再試行
すべてのステータスコード →