Send Requests

How to retrieve low-fare flight search results

HTTP POST Protocol

The simplest way to try out this API is to send it a POST request with curl. For example, create a file named request.json with the following content (replace each instance of YYYY-MM-DD with a date, which can be up to a year in the future.):

{
  "request": {
    "passengers": {
      "adultCount": 1
    },
    "slice": [
      {
        "origin": "BOS",
        "destination": "LAX",
        "date": "YYYY-MM-DD"
      },
      {
        "origin": "LAX",
        "destination": "BOS",
        "date": "YYYY-MM-DD"
      }
    ]
  }
}

Then execute the following command from within the same directory as the above request.json file. (As explained in Prerequisites, you must first obtain an API key.)

curl -d @request.json --header "Content-Type: application/json" https://www.googleapis.com/qpxExpress/v1/trips/search?key=your_API_key_here

You should get back a string of JSON containing your flight solution. The request and response JSON are documented in the Reference section.

(Other methods will be listed here when available)


Example queries and responses

Here's a full example of the JSON for a simple one-way from San Francisco SFO to Los Angeles LAX, limited to just one solution: request and response. Here is a more complicated example of an international round-trip from Maui OGG to Nice NCE with an adult and a child and multiple solutions: request and response.