qstringwymagane
Parameter defines the search query. A query that would be used to provide completion options.
https://api.sandbase.ai/v1/api/google-hotels/autocompleteGet Google Hotels destination and property suggestions for a partial name, with property tokens for hotel lookups.
Twój wynik pojawi się tutaj
Uzupełnij dane wejściowe, a następnie kliknij Uruchom.
Get Google Hotels destination and property suggestions for a partial name, with property tokens for hotel lookups.
curl -X POST "https://api.sandbase.ai/v1/api/google-hotels/autocomplete" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "austin"}'
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 Hotels Autocomplete 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 lis |
hl | string | No | Parameter defines the language to use for the Google Hotels 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 re |
currency | string | No | Parameter defines the currency used in the API_google_hotels_link. Default value is USD. Head to the Google Travel Currencies page for a full list of supported currency codes. |
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.
Zacznij tworzyć
Punkt końcowy API platformy z jednolitym uwierzytelnianiem i śledzeniem użycia.
curl -X POST "https://api.sandbase.ai/v1/api/google-hotels/autocomplete" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "austin"
}'Ustaw klucz API SandBase w środowisku serwera. Żądania używają uwierzytelniania Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Przechowuj klucz na serwerze. Nie ujawniaj go w kodzie przeglądarkowym.
qstringwymaganeParameter defines the search query. A query that would be used to provide completion options.
glstringParameter defines the country to use for the Google Hotels Autocomplete 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 Hotels 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.
currencystringParameter defines the currency used in `the API_google_hotels_link`. Default value is `USD`. Head to the Google Travel Currencies page for a full list of supported currency codes.
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.
Zapisany przykładowy response dla tego API; podczas wyświetlania nie jest wykonywane żadne żądanie na żywo.
Nie opublikowano zapisanego response. Uruchom API w Playground, aby sprawdzić jego odpowiedź.
Odkryj więcej
| API | Cena | Odpowiedź |
|---|---|---|
Google Hotels | $0.01 za wywołanie | JSON |
Google Hotels | $0.01 za wywołanie | JSON |
Google Hotels | $0.01 za wywołanie | JSON |
Google Hotels | $0.01 za wywołanie | JSON |
Google Hotels | $0.015 za wywołanie | JSON |
Pytania
Wyślij żądanie POST do https://api.sandbase.ai/v1/api/google-hotels/autocomplete z kluczem API SandBase w nagłówku Authorization (Bearer) oraz parametrami w treści JSON. Możesz też wypróbować je w Playground na tej stronie bez pisania kodu.
$0.01 za wywołanie, rozliczane z salda SandBase. Płacisz tylko za wykonane wywołania; nie ma subskrypcji.
Wymagane: q (string). Opcjonalne: gl (string), hl (string), currency (string) i json_restrictor (string). Tabela Parameters oraz Playground na tej stronie zawierają wszystkie pola.
Odpowiedź JSON zwrócona w tym samym żądaniu HTTP (synchronicznie).
Nie. Google Hotels Autocomplete działa przez SandBase, więc jeden klucz API SandBase obejmuje ten endpoint i każde inne API oraz model w katalogu. Nie musisz osobno ubiegać się o dostęp do API Google Hotels.