Skip to content
Scrappa Get API key

Google Hotels Autocomplete

The Google Hotels Autocomplete API provides real-time location and hotel name suggestions as users type, powered by the same suggestion engine behind Google Hotels. Build type-ahead search experiences for travel apps, hotel booking platforms, and destination discovery tools.

What You Get

  • Hotel suggestions — Specific accommodations matching the query (e.g., "Paris Hotel Las Vegas", "Hilton London Bankside")
  • Location suggestions — Cities, regions, and landmarks (e.g., "Paris, France", "Times Square, New York")
  • Direct booking links — Each suggestion includes a ready-to-use scrappa_google_hotels_link to fetch full hotel search results
  • Thumbnails & metadata — Hotel images, Knowledge Graph IDs (kgmid), and property tokens for deeper lookups

Common Use Cases

  • Travel search bars — Power autocomplete dropdowns in hotel booking interfaces with instant suggestions
  • Destination discovery — Help users explore locations by surfacing relevant cities and landmarks as they type
  • Hotel name resolution — Resolve partial hotel names to exact properties with unique identifiers and property tokens
  • Multi-language support — Localize suggestions for 50+ languages using the hl and gl parameters

How It Works

Send a partial query (minimum 2 characters) and the API returns ranked suggestions from Google's hotel database. Use the type parameter to filter results:

  • hotel (default) — Returns only accommodation suggestions (specific hotels, resorts, hostels)
  • location — Returns only geographic suggestions (cities, regions, landmarks)
  • all — Returns both hotel and location suggestions together

Response Type Values

Each suggestion includes a type field indicating the suggestion category:

  • accommodation — Hotels, resorts, hostels, and other lodging properties
  • location — Cities, regions, landmarks, and geographic areas

Each suggestion includes a scrappa_google_hotels_link that you can call directly to get full hotel search results for that location or property — no extra parameter mapping needed.

Scrappa vs. Building Your Own

Google does not offer a public Hotels Autocomplete API. Building this yourself requires reverse-engineering Google's internal batchexecute protocol, handling protobuf-encoded payloads, and maintaining parsers as Google changes their internal format. Scrappa handles all of this, returning clean JSON with a simple REST interface.

Run this endpoint

Google Hotels Autocomplete 1 credit/request

Endpoint

GET https://scrappa.co/api/google-hotels/autocomplete?q=Berlin
Request preview GET
https://scrappa.co/api/google-hotels/autocomplete?q=Berlin
Auth header x-api-key
Cost 1 credit/request
q = Berlin
Response preview 200 OK
{
    "search_parameters": {
        "engine": "google_hotels_autocomplete",
        "q": "Paris",
        "gl": "us",
        "hl": "en",
        "currency": "USD"
    },
    "suggestions": [
        {
            "position": 1,
            "value": "paris hotel las vegas",
            "type": "accommodation",
            "highlighted_words": [
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

1 required parameter needed before sending a request.

4 optional filters available.

q string Required

Location search query

Example value Berlin
gl string Optional

2-letter country code for localization (e.g., us, gb, de, fr)

Example value us
hl string Optional

2-letter language code for results (e.g., en, es, fr, de)

Example value en
currency string Optional

3-letter currency code used in suggestion links (e.g., USD, EUR, GBP)

Example value USD
type string Optional

Type of suggestions to return: location (cities/locations only), hotel (accommodations only), all (both). Default: hotel

Example value hotel

Request Examples

<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://scrappa.co/api/google-hotels/autocomplete?q=Berlin",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "x-api-key: YOUR_API_KEY_HERE"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}
<?php

use Illuminate\Support\Facades\Http;

$response = Http::timeout(30)
    ->withHeaders(['x-api-key' => 'YOUR_API_KEY_HERE'])
    ->get('https://scrappa.co/api/google-hotels/autocomplete?q=Berlin');

if ($response->successful()) {
    echo $response->body();
} else {
    echo "Error: " . $response->status();
}
const options = {
    method: 'GET',
    headers: {
        'x-api-key': 'YOUR_API_KEY_HERE'
    }
};

fetch('https://scrappa.co/api/google-hotels/autocomplete?q=Berlin', options)
    .then(response => {
        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }
        return response.text();
    })
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
const axios = require('axios');

const options = {
    method: 'GET',
    url: 'https://scrappa.co/api/google-hotels/autocomplete?q=Berlin',
    headers: {
        x-api-key: 'YOUR_API_KEY_HERE',
    }
};

try {
    const response = await axios(options);
    console.log(response.data);
} catch (error) {
    console.error('Error:', error.message);
}
require 'net/http'
require 'uri'

uri = URI.parse("https://scrappa.co/api/google-hotels/autocomplete?q=Berlin")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'

request = Net::HTTP::Get.new(uri.request_uri)
request['x-api-key'] = 'YOUR_API_KEY_HERE'

begin
    response = http.request(request)
    puts response.body
rescue => e
    puts "Error: #{e.message}"
end
import http.client
import json

conn = http.client.HTTPSConnection("scrappa.co")

headers = {
    'x-api-key': 'YOUR_API_KEY_HERE',
}

try:
    conn.request("GET", "/api/google-hotels/autocomplete?q=Berlin", headers=headers)
    res = conn.getresponse()
    data = res.read()
    print(data.decode("utf-8"))
except Exception as e:
    print(f"Error: {e}")
finally:
    conn.close()
import requests

headers = {
    'x-api-key': 'YOUR_API_KEY_HERE',
}

try:
    response = requests.get('https://scrappa.co/api/google-hotels/autocomplete?q=Berlin', headers=headers)
    response.raise_for_status()
    print(response.text)
except requests.exceptions.RequestException as e:
    print(f"Error: {e}")
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;

public class ApiExample {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        Request request = new Request.Builder()
            .url("https://scrappa.co/api/google-hotels/autocomplete?q=Berlin")
        .addHeader("x-api-key", "YOUR_API_KEY_HERE")
            .build();

        try (Response response = client.newCall(request).execute()) {
            if (response.isSuccessful()) {
                System.out.println(response.body().string());
            } else {
                System.out.println("Error: " + response.code());
            }
        } catch (IOException e) {
            System.out.println("Error: " + e.getMessage());
        }
    }
}
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {
    client := &http.Client{}
    req, err := http.NewRequest("GET", "https://scrappa.co/api/google-hotels/autocomplete?q=Berlin", nil)
    if err != nil {
        fmt.Println("Error creating request:", err)
        return
    }
    req.Header.Set("x-api-key", "YOUR_API_KEY_HERE")

    resp, err := client.Do(req)
    if err != nil {
        fmt.Println("Error making request:", err)
        return
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        fmt.Println("Error reading response:", err)
        return
    }

    fmt.Println(string(body))
}
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/google-hotels/autocomplete?q=Berlin"
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        using var client = new HttpClient();
        client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY_HERE");

        try
        {
            var response = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "https://scrappa.co/api/google-hotels/autocomplete?q=Berlin"));
            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error: {ex.Message}");
        }
    }
}
import axios from 'axios';

async function run(): Promise<void> {
    try {
        const response = await axios({
            method: 'GET',
            url: 'https://scrappa.co/api/google-hotels/autocomplete?q=Berlin',
            headers: {
        'x-api-key': 'YOUR_API_KEY_HERE',
            },
        });

        console.log(response.data);
    } catch (error) {
        console.error('Error:', error);
    }
}

void run();
use reqwest::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();

    let response = client
        .get("https://scrappa.co/api/google-hotels/autocomplete?q=Berlin")
        .header("x-api-key", "YOUR_API_KEY_HERE")
        .send()
        .await?;

    println!("{}", response.text().await?);

    Ok(())
}

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

search_parameters suggestions response_time_ms

Common suggestions fields

position value type highlighted_words
JSON Response
200 OK
{
    "search_parameters": {
        "engine": "google_hotels_autocomplete",
        "q": "Paris",
        "gl": "us",
        "hl": "en",
        "currency": "USD"
    },
    "suggestions": [
        {
            "position": 1,
            "value": "paris hotel las vegas",
            "type": "accommodation",
            "highlighted_words": [
                "hotel las vegas"
            ],
            "autocomplete_suggestion": "paris hotel las vegas",
            "scrappa_google_hotels_link": "https://scrappa.co/api/google-hotels/search?q=Las+Vegas%2C+NV&check_in_date=2026-09-27&check_out_date=2026-09-28&adults=2&children=0&currency=USD&hl=en&gl=us&property_token=ChgIgbj58O-AraJFGgovbS8wMzQ4czYwEAE",
            "location": "Las Vegas, NV",
            "thumbnail": "https://lh3.googleusercontent.com/grass/AKc-QJEPi1pQEfr-uPrS56QJayOxIX_eB0VMbaasFAlqvvL0jM_cI_a_D9_lrItRAZpRCCIRP8yh8iZqTQw-WRk7PCoe2Q=w92-h92-n-k-no",
            "kgmid": "/m/0348s60",
            "data_cid": "4991312229159558145",
            "property_token": "ChgIgbj58O-AraJFGgovbS8wMzQ4czYwEAE",
            "scrappa_link": "https://scrappa.co/api/search?q=paris+hotel+las+vegas&hl=en&gl=us&kgmid=%2Fm%2F0348s60"
        }
    ],
    "response_time_ms": 587
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

The q, hl, gl, currency, or type query parameter failed validation before the Google Hotels autocomplete request ran.

{
    "errors": {
        "q": [
            "The q field is required."
        ]
    },
    "message": "The request validation failed"
}
403

Google Hotels Upstream Blocked

Google returned a blocking or forbidden response through the configured cookie/proxy session path.

{
    "error": "Google Hotels autocomplete upstream blocked the request.",
    "retryable": true,
    "error_code": "google_hotels_autocomplete_upstream_forbidden",
    "status_code": 403,
    "upstream_status": 403
}
429

Google Hotels Rate Limited

Google rate limited the autocomplete request through the configured cookie/proxy session path.

{
    "error": "Google Hotels autocomplete upstream is rate limited.",
    "retryable": true,
    "error_code": "google_hotels_autocomplete_rate_limited",
    "status_code": 429,
    "upstream_status": 429
}
502

Temporary Upstream Failure

Google returned an unavailable non-200 response through the configured cookie/proxy session path.

{
    "error": "Google Hotels autocomplete upstream returned an unavailable response.",
    "retryable": true,
    "error_code": "google_hotels_autocomplete_upstream_bad_response",
    "status_code": 502,
    "upstream_status": 500
}
502

Autocomplete Parse Failure

Google returned HTTP 200, but the response could not be parsed into the documented autocomplete suggestion shape.

{
    "error": "Google Hotels autocomplete returned an unparseable response.",
    "retryable": true,
    "error_code": "google_hotels_autocomplete_parse_failed",
    "status_code": 502,
    "upstream_status": 200
}
503

Autocomplete Temporarily Unavailable

The upstream returned HTTP 503, the provider-backed request could not connect, or Scrappa hit an unexpected temporary autocomplete failure after validation passed.

{
    "error": "Google Hotels autocomplete is temporarily unavailable.",
    "retryable": true,
    "error_code": "google_hotels_autocomplete_temporary_unavailable",
    "status_code": 503
}
503

Cookie Session Temporarily Unavailable

Scrappa could not acquire a usable provider-backed Google cookie/proxy session before the autocomplete request ran.

{
    "error": "Google Hotels autocomplete cookie session is temporarily unavailable.",
    "retryable": true,
    "error_code": "google_hotels_autocomplete_cookie_session_unavailable",
    "status_code": 503
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.