Usage

This page presents some sample calls using the Travel Partner API v3.

The Travel Partner API endpoints uses REST-ful syntax via HTTPS calls. The base_url for all API requests is:

https://travelpartner.googleapis.com/v3/accounts/account_id

For the complete list of request and response fields, check out the API resources catalog.

Hotels

The Hotel View Service provides either a list of all the hotels or a summary of them for a particular account.

Getting a list of hotels

The following example retrieves a list of all the hotels in account 12345678:

GET https://travelpartner.googleapis.com/v3/accounts/12345678/hotelviews

The request accepts query parameters for navigating through multi-page results:

GET base_url/hotelviews?pageSize=10&pageToken=11

Getting a properties summary

This example gets a summary of the properties for account 12345678:

GET https://travelpartner.googleapis.com/v3/accounts/12345678/hotelviews:summarize

Price accuracy

The Price Accuracy Views Service allow retrieval of price accuracy reports and scorecards for a particular account.

Getting a price accuracy report

The following example retrieves the price accuracy report on 8/26/2019 for account 12345678:

GET https://travelpartner.googleapis.com/v3/accounts/12345678/priceAccuracyViews/20190826

Besides the usual query parameters for paging through the response, there are a couple more for including matched prices or pixel signals in the results.

In this example, the price accuracy report on 8/26/2019 includes matched prices and pixel signals:

GET base_url/priceAccuracyViews/20190826?includeMatchedPrices=true&includePixels=true

Listing available price accuracy reports

To get a list of the available reports, send this request:

GET https://travelpartner.googleapis.com/v3/accounts/12345678/priceAccuracyViews

You can included the usual query parameters for paging through the results.

Getting a price accuracy score

To get the price accuracy scorecard, use the summarize method:

GET https://travelpartner.googleapis.com/v3/accounts/12345678/priceAccuracyViews:summarize

Price coverage

The Price Coverage Views Service provides the latest price coverage report or the entire price coverage history.

Getting the latest price coverage stats

The following example retrieves the latest price coverage stats for account 12345678:

GET https://travelpartner.googleapis.com/v3/accounts/12345678/priceCoverageViews:latest

Getting the price coverage history

This request gets the entire price coverage history for an account:

GET https://travelpartner.googleapis.com/v3/accounts/12345678/priceCoverageViews

Price

The Price Views Service lets you retrieve a price report for a given property.

Getting pricing data for a property

To get the pricing report for a particular hotel (ID=101) belonging to account 12345678, issue this request:

GET https://travelpartner.googleapis.com/v3/accounts/12345678/priceViews/101

Reconciliation reports

The Reconciliation Reports Service

Getting a list of reconciliation reports

The following example gets a list of reports for account 12345678:

GET https://travelpartner.googleapis.com/v3/accounts/12345678/reconciliationReports

You can include optional start and end date query parameters to limit the results. For example, this query confines reports to only those between 6/15/2019 to 9/15/2019:

GET base_url/reconciliationReports?startDate=2019-06-15&endDate=2019-09-15

Downloading a reconciliation report

This example retrieves the booking_report.csv report (as a JSON response) that was uploaded at 2019-08-26T12:00:00:

GET base_url/reconciliationReports/2019-08-26T12%3A00%3A00~bookings.csv

Validating a reconciliation report

You can use this method to validate the report before uploading it. Validating a report does not upload it.

The reconciliation report is included in the body of the request, as the value for the contents field. The reconciliation report must follow the syntax described in Reconciliation reports.

The following example validates a report for account 12345678:

POST https://travelpartner.googleapis.com/v3/accounts/12345678/reconciliationReports:validate

Uploading a reconciliation report

After you've confirmed that a reconciliation report is valid, you can upload it to Google like in this example:

POST https://travelpartner.googleapis.com/v3/accounts/12345678/reconciliationReports