qstring必須
Parameter defines the search query. A query that would be used to provide completion options.
https://api.sandbase.ai/v1/api/google/autocompleteGet Google search box suggestions for a partial query, localized by country and language.
出力はここに表示されます
入力を完了してから[実行]をクリックしてください。
Get Google search box suggestions for a partial query, localized by country and language.
curl -X POST "https://api.sandbase.ai/v1/api/google/autocomplete" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "how to make cold"}'
The result is returned in outputs[0].data as structured JSON.
| Name | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Parameter defines the search query. A query that would be used to provide completion options. |
gl | string | No | Parameter defines the country to use for the Google search. It's a two-letter country code. (e.g., us for the United States, uk for United Kingdom, or fr for France) Head to the Google countries page for a full list of supported Googl |
hl | string | No | Parameter defines the language to use for the Google Autocomplete search. It's a two or three-letter language code. (e.g., en for English, es for Spanish, or fr for French), optionally followed by a two-letter or three-digit region co |
cp | string | No | Cursor pointer defines the position of cursor for the query provided, position starts from 0 which is a case where cursor is placed before the query /query. If not provided acts as cursor is placed in the end of query query/. |
client | string | No | Parameter used to define client for autocomplete. List of supported clients. |
json_restrictor | string | No | Parameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details. |
$0.010 per successful call. Failed calls are not charged.
開発を始める
統一認証と使用状況の追跡を備えたプラットフォームAPIエンドポイントです。
curl -X POST "https://api.sandbase.ai/v1/api/google/autocomplete" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "how to make cold"
}'SandBaseのAPIキーをサーバー環境に設定してください。リクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開しないでください。
qstring必須Parameter defines the search query. A query that would be used to provide completion options.
glstringParameter defines the country to use for the Google search. It's a two-letter country code. (e.g., `us` for the United States, `uk` for United Kingdom, or `fr` for France) Head to the Google countries page for a full list of supported Google countries.
hlstringParameter defines the language to use for the Google Autocomplete search. It's a two or three-letter language code. (e.g., `en` for English, `es` for Spanish, or `fr` for French), optionally followed by a two-letter or three-digit region code (e.g., `en-gb` for British English, or `es-419` for Latin American Spanish). Head to the Google languages page for a full list of supported Google languages.
cpstringCursor pointer defines the position of cursor for the query provided, position starts from 0 which is a case where cursor is placed before the query `|query`. If not provided acts as cursor is placed in the end of query `query|`.
clientstringParameter used to define client for autocomplete. List of supported clients.
json_restrictorstringParameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.
このAPIの保存済みサンプルレスポンスです。表示時にライブリクエストは行われません。
保存済みレスポンスはまだ公開されていません。PlaygroundでAPIを実行し、レスポンスを確認してください。
さらに探索
| API | 価格 | レスポンス |
|---|---|---|
Google Autocompleteこの API Google | $0.01 / 回 | JSON |
Google | $0.01 / 回 | JSON |
Google | $0.015 / 回 | JSON |
Google | 1回あたり $0.002 から | JSON |
Google | 1回あたり $0.0015 から | JSON |
Google | $0.01 / 回 | JSON |
質問
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/google/autocomplete に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
1回あたり $0.01、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。
必須: q (string)。 任意: gl (string), hl (string), cp (string), client (string) と json_restrictor (string)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。
いいえ。Google Autocomplete は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。Google の API アクセスを別途申請する必要はありません。