# Example Requests

## Basic Google Hotels Search

In this example, we send a simple Google Hotels request searching for hotels in **Rome**.

The request specifies:

* search location (`q`)
* check-in and check-out dates
* number of adults staying

### Request

```bash
curl -X GET "https://serp-api.netnut.io/search?engine=google_hotels&q=rome&hl=en&gl=us&adults=2&checkInDate=2026-04-10&checkOutDate=2026-04-12" \
  -U "username:password"
```

### Example Response

Example shape — your actual `jobId`, timestamps, and hotel data will vary.

```json
{
  "url": "https://www.google.com/travel/search?...",
  "general": {
    "searchEngine": "google_hotels",
    "language": "en",
    "device": "desktop",
    "searchType": "text",
    "pageTitle": "rome - Google Hotel Search",
    "timestamp": "2026-03-10T13:29:47.328468801Z",
    "render": false
  },
  "input": {
    "originalUrl": "https://www.google.com/search?...",
    "jobId": "b40c5eab-2694-4aa8-9114-68096e05102e"
  },
  "hotels": [
    {
      "name": "CC Palace Hotel Roma",
      "tags": [
        "Excellent location"
      ],
      "link": "https://www.google.com/travel/hotels/entity/ChoItMjNnKqkq7aGARoNL2cvMTF0NWxndDc3NxAB?...",
      "propertyToken": "ChoItMjNnKqkq7aGARoNL2cvMTF0NWxndDc3NxAB",
      "hotelClass": "4-star hotel",
      "extractedHotelClass": 4,
      "overallRating": 4.7,
      "ratePerNight": {
        "lowest": "$126",
        "extractedLowest": 126
      },
      "totalRate": {
        "lowest": "$156 total",
        "extractedLowest": 156
      },
      "reviews": "362",
      "amenities": [
        "Breakfast ($)",
        "Free Wi-Fi",
        "Parking ($)",
        "Air conditioning",
        "Bar",
        "Restaurant",
        "Airport shuttle",
        "Accessible"
      ],
      "images": [
        {
          "thumbnail": "https://lh3.googleusercontent.com/gps-cs-s/example1"
        },
        {
          "thumbnail": "https://lh3.googleusercontent.com/p/example2"
        }
      ],
      "reviewsLink": "https://www.google.com/travel/hotels/entity/.../reviews",
      "rank": 1
    }
  ]
}
```

### In this response

* `url` is the final Google Hotels search URL used to retrieve the results.
* `general` contains metadata about the request, such as language, device, page title, and timestamp.
* `input` contains the original request URL and the internal `jobId`.
* `hotels` contains the parsed hotel results.
* each hotel object may include fields such as `name`, `tags`, `link`, `propertyToken`, `hotelClass`, `overallRating`, pricing, amenities, images, and `rank`.

***

## Request with `rawHtml=1`

In this example, we request the normal parsed JSON response **and** the raw HTML returned from Google Hotels.

This mode is useful when you want the structured hotel data while also keeping access to the original page source for debugging, validation, or custom parsing.

### Request

```bash
curl -X GET "https://serp-api.netnut.io/search?engine=google_hotels&q=uk&hl=en&gl=us&rawHtml=1" \
  -U "username:password"
```

### Example Response

Example shape — shortened for readability. Your actual response may include more hotel results and a much longer HTML string.

```json
{
  "url": "https://www.google.com/travel/search?gl=US&hl=en&q=uk&start=0&ts=...",
  "general": {
    "searchEngine": "google_hotels",
    "language": "en",
    "device": "desktop",
    "searchType": "text",
    "pageTitle": "uk - Google Hotel Search",
    "timestamp": "2026-03-10T15:37:20.199550063Z",
    "render": false
  },
  "input": {
    "originalUrl": "https://www.google.com/search?gl=US&hl=en&q=uk&start=0&ts=...",
    "jobId": "25c07af6-05eb-4740-9240-c8f953c4157a"
  },
  "hotels": [
    {
      "name": "Smart Hyde Park View",
      "tags": [
        "Excellent location"
      ],
      "link": "https://www.google.com/travel/hotels/entity/ChcIqsyXsbLfss8SGgsvZy8xdGR5ZjMwbhAB?engine=google_hotels&q=uk...",
      "propertyToken": "ChcIqsyXsbLfss8SGgsvZy8xdGR5ZjMwbhAB",
      "hotelClass": "2-star hotel",
      "extractedHotelClass": 2,
      "overallRating": 3.7,
      "ratePerNight": {
        "lowest": "$19",
        "extractedLowest": 19
      },
      "totalRate": {
        "lowest": "$38 total",
        "extractedLowest": 38
      },
      "reviews": "1,935",
      "amenities": [
        "Breakfast ($)",
        "Free Wi-Fi",
        "Air conditioning",
        "Bar",
        "Restaurant"
      ],
      "images": [
        {
          "thumbnail": "https://lh5.googleusercontent.com/proxy/..."
        }
      ],
      "reviewsLink": "https://www.google.com/travel/hotels/entity/.../reviews",
      "rank": 1
    },
    {
      "name": "The Cowshed Boutique Bunkhouse",
      "link": "https://www.google.com/travel/hotels/entity/ChkI593Ck4WhnYYdGg0vZy8xMWJjOTZ0a3RrEAE?engine=google_hotels&q=uk...",
      "propertyToken": "ChkI593Ck4WhnYYdGg0vZy8xMWJjOTZ0a3RrEAE",
      "hotelClass": "Free Wi-Fi",
      "extractedHotelClass": 0,
      "overallRating": 4.7,
      "ratePerNight": {
        "lowest": "$34",
        "extractedLowest": 34
      },
      "totalRate": {
        "lowest": "$67 total",
        "extractedLowest": 67
      },
      "reviews": "670",
      "rank": 2
    }
  ],
  "html": "<!doctype html><html lang/>..."
}
```

### In this response

* the response includes the regular parsed JSON fields:
  * `url`
  * `general`
  * `input`
  * `hotels`
* in addition, it includes:
  * `html` — the raw HTML source of the Google Hotels page

This mode is useful for:

* validating parsed results against the original source
* storing both parsed data and page source
* custom downstream extraction workflows

***

## Request with `rawHtml=2`

In this example, we request **only the raw HTML** of the Google Hotels page.

This mode is useful when you do not need the parsed JSON response and only want the page source.

### Request

```bash
curl -X GET "https://serp-api.netnut.io/search?engine=google_hotels&q=uk&hl=en&gl=us&rawHtml=2" \
  -U "username:password"
```

### Example Response

```html
<!doctype html><html lang/>
```

### In this response

* the API returns **only the raw HTML**
* no parsed JSON fields such as `general`, `input`, or `hotels` are returned

This mode is useful for:

* custom parsers
* raw source collection
* debugging page output without parsed normalization
