Hotels API v2.0

The Hotels API gives you programmatic access to your Hotel List Feed. You can list all indexed (or valid) hotels, or list hotels that are not indexed. Properties are not indexed when they are unmatched, overclustered, or have data quality issues.

Path

base_path/api_version/account_id/hotels

Where:

Path Parameter Description
base_path https://www.googleapis.com/travelpartner
api_version v2.0
account_id A master account ID. If you specify a sub account, this API does not return a response.

Query String Parameters

Parameter Description
maxresults (GET requests only) Specifies the maximum number of results per page. The default value is 100,000. This parameter is optional.
nextrow (GET requests only) Specifies a random string that represents an offset for your query. For more information, see Using Offsets. This parameter is optional.
type (Optional) Specifies the type of results you want. Possible values are:
  • "ALL": Requests all of your hotels that are in Google’s hotel manifest.
  • "OVER_CLUSTERED": Requests overclustered hotels only.
  • "LISTING_FEED": Returns a list of all hotels in your Hotel List Feed, including those that are not in Google's hotels manifest. The response also includes error codes that should help you determine why these hotels encountered an issue.

The default value is "ALL".

Supported Methods

HTTP Method Description
GET Gets all indexed hotels, over-clustered hotels, or all hotels, regardless of whether they are indexed.

Examples

Gets a list of all hotels in the specified account:

GET https://www.googleapis.com/travelpartner/v2.0/4200042/hotels

Gets a list of all hotels in the Hotel List Feed for the specified account:

GET https://www.googleapis.com/travelpartner/v2.0/4200042/hotels?type=LISTING_FEED

If you discover that your Hotel List Feed contains issues, you must remove, fix, or consolidate listings that are causing those issues, and then resubmit the feed. To do this, you can use the Manual Match Fix tool.

Getting a list of all hotels

You can use the Hotels API to get a list of all hotels in your Hotel List Feed.

To get a list of all hotels, send a GET request with the following URL syntax:

GET https://www.googleapis.com/travelpartner/v2.0/account_id/hotels

The following example gets a list of all hotels for the account 4200042:

GET https://www.googleapis.com/travelpartner/v2.0/4200042/hotels

The Hotels API returns a list of hotels as objects in the hotel_mapping array. Each object in the array represents one of the hotels in the Hotel List Feed.

The following sample response includes hotels with no data issues, hotels with data issues, and overclustered hotels:

{
  "kind": "travelpartner#hotelList",
  "hotel_mapping": [
    {
      "kind": "travelpartner#hotel",
      "partnerHotelId": "1066",
      "googleHotelId": "1234567890123456790",
      "googleClusterId": "11112222233333"
    },
    {
      "kind": "travelpartner#hotel",
      "partnerHotelId": "1492",
      "googleHotelId": "1234567890123456789",
      "googleClusterId": "22222233333444",
      "dataIssues": [
        "MISSING_PHONE_NUMBER"
      ],
      "manifestOnly": true  // rare condition
    },
    {
      "kind": "travelpartner#hotel",
      "partnerHotelId": "1620",
      "googleHotelId": "1234567890123456791",
      "googleClusterId": "3333444445555",
      "dataIssues": [
        "MISSING_PHONE_NUMBER",
        "MISSING_ADDRESS"
      ]
    },
    {
      "kind": "travelpartner#hotel",
      "partnerHotelId": "1971",
      "googleHotelId": "1234567890123456792",
      "googleClusterId": "4444455556666",
      "overClusteredPartnerHotelIds": [
        "1974"
      ]
    }
  ]
}

The following table describes the fields of the objects in the hotel_mapping array:

Field Description
kind The type of object. The value is "travelpartner#hotel".
partnerHotelId The unique ID of the hotel that you provided in your Hotel List Feed.
googleClusterId The Google Maps identifier for the hotel.
dataIssues Indicates that the hotel has data quality issues. The value of this field is an array of error codes that indicate what types of issues the listing has.

If your feed contains data issues, update the feed and resubmit it. For more information, see Matching Report.

overClusteredPartnerHotelIds Indicates that the hotel is over-clustered. The value of this field is an array of other hotel IDs that the hotel is over-clustered with.

If your feed contains overclustered hotels, update the feed and resubmit using the Manual Match Fix tool.

googleHotelId Google's canonical ID for the hotel.
manifestOnly A boolean indicating whether the hotel is in Google's manifest (and not in your feed). If this value is true, then you might have dropped the property from your latest feed, but we have not yet generated a manifest using that feed.

This is a rare condition. If the value is false, then it will be not present in the Hotels API response.

Getting over clustered hotels

You can use the Hotels API to get a list of overclustered hotels for the specified account or sub account.

To get over clustered hotels, set the type query string parameter to OVER_CLUSTERED, as the following example shows:

GET https://www.googleapis.com/travelpartner/v2.0/4200042/hotels?type=OVER_CLUSTERED

Hotels API Changes

Changes to v2.0 of the Hotels API include the following:

  • All results are returned as JSON.
  • The Hotels API uses the new RESTful syntax.
  • Two new fields have been added to the response:
    • manifestOnly
    • googleHotelId

Send feedback about...

Need help? Visit our support page.