Google Flights
Google Flights: One Way
One Way from Google Flights. Costs 1 credit per successful call.
GET
https://api.perceptlayer.com
/
v1
/
google-flights
/
one-way
One Way
curl --request GET \
--url https://api.perceptlayer.com/v1/google-flights/one-way \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.perceptlayer.com/v1/google-flights/one-way"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.perceptlayer.com/v1/google-flights/one-way', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.perceptlayer.com/v1/google-flights/one-way';
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.perceptlayer.com/v1/google-flights/one-way"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.perceptlayer.com/v1/google-flights/one-way",
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: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.perceptlayer.com/v1/google-flights/one-way")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.get("https://api.perceptlayer.com/v1/google-flights/one-way")
.header("X-API-Key", "<api-key>")
.asString();{
"endpoint": "google-flights.one-way",
"params": {
"origin": "JFK",
"destination": "LAX",
"departure_date": "2026-12-15"
},
"response": {
"flights": [
{
"price": 179,
"currency": "USD",
"total_duration_minutes": 384,
"stops": 0,
"airline_name": "JetBlue",
"emissions": {
"co2_grams": 426000,
"co2_kilograms": 426,
"typical_co2_grams": 344000,
"typical_co2_kilograms": 344,
"difference_percent": 24
},
"booking_token": "CjRISVFvemhYdy1QZTBBQTR3SXdCRy0tLS0tLS0tLWVqY3J5N0FBQUFBR3JhOFJBQUFyOGdBEgZCNjIyMjMaCwiwiwEQAhoDVVNEOBxwsIsB",
"legs": [
{
"airline": "B6",
"flight_number": "2223",
"departure_airport": "JFK",
"arrival_airport": "LAX",
"departure_time": "2026-12-15T08:01:00",
"arrival_time": "2026-12-15T11:25:00",
"duration_minutes": 384
}
]
},
{
"price": 189,
"currency": "USD",
"total_duration_minutes": 378,
"stops": 0,
"airline_name": "Delta",
"emissions": {
"co2_grams": 244000,
"co2_kilograms": 244,
"typical_co2_grams": 344000,
"typical_co2_kilograms": 344,
"difference_percent": -29
},
"booking_token": "CjRISVFvemhYdy1QZTBBQTR3SXdCRy0tLS0tLS0tLWVqY3J5N0FBQUFBR3JhOFJBQUFyOGdBEgVETDc3MxoLCJiTARACGgNVU0Q4HHCYkwE=",
"legs": [
{
"airline": "DL",
"flight_number": "773",
"departure_airport": "JFK",
"arrival_airport": "LAX",
"departure_time": "2026-12-15T09:00:00",
"arrival_time": "2026-12-15T12:18:00",
"duration_minutes": 378
}
]
},
{
"price": 215,
"currency": "USD",
"total_duration_minutes": 377,
"stops": 0,
"airline_name": "American",
"emissions": {
"co2_grams": 281000,
"co2_kilograms": 281,
"typical_co2_grams": 344000,
"typical_co2_kilograms": 344,
"difference_percent": -18
},
"booking_token": "CjRISVFvemhYdy1QZTBBQTR3SXdCRy0tLS0tLS0tLWVqY3J5N0FBQUFBR3JhOFJBQUFyOGdBEgVBQTM0MRoLCMCnARACGgNVU0Q4HHDApwE=",
"legs": [
{
"airline": "AA",
"flight_number": "341",
"departure_airport": "JFK",
"arrival_airport": "LAX",
"departure_time": "2026-12-15T14:59:00",
"arrival_time": "2026-12-15T18:16:00",
"duration_minutes": 377
}
]
}
],
"search_metadata": {
"origin": "JFK",
"destination": "LAX",
"departure_date": "2026-12-15",
"passengers": {
"adults": 1,
"children": 0,
"infants_in_seat": 0,
"infants_on_lap": 0
},
"cabin_class": "Economy",
"exclude_basic": false,
"max_stops": "Any number of stops",
"sort_by": "Top Flights",
"hl": "en",
"gl": "US",
"currency": "USD",
"response_time_ms": 5598
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}1 credit per successful call; failed calls are free. See the Google Flights API overview for every Google Flights endpoint.
Authorizations
Query Parameters
Maximum string length:
3Maximum string length:
3Available options:
economy, premium_economy, business, first Available options:
any, nonstop, one_or_fewer, two_or_fewer Maximum string length:
3Available options:
0 Available options:
top_flights, cheapest, departure_time, arrival_time, duration, emissions Maximum string length:
2Was this page helpful?
⌘I
One Way
curl --request GET \
--url https://api.perceptlayer.com/v1/google-flights/one-way \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.perceptlayer.com/v1/google-flights/one-way"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.perceptlayer.com/v1/google-flights/one-way', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.perceptlayer.com/v1/google-flights/one-way';
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.perceptlayer.com/v1/google-flights/one-way"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.perceptlayer.com/v1/google-flights/one-way",
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: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.perceptlayer.com/v1/google-flights/one-way")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.get("https://api.perceptlayer.com/v1/google-flights/one-way")
.header("X-API-Key", "<api-key>")
.asString();{
"endpoint": "google-flights.one-way",
"params": {
"origin": "JFK",
"destination": "LAX",
"departure_date": "2026-12-15"
},
"response": {
"flights": [
{
"price": 179,
"currency": "USD",
"total_duration_minutes": 384,
"stops": 0,
"airline_name": "JetBlue",
"emissions": {
"co2_grams": 426000,
"co2_kilograms": 426,
"typical_co2_grams": 344000,
"typical_co2_kilograms": 344,
"difference_percent": 24
},
"booking_token": "CjRISVFvemhYdy1QZTBBQTR3SXdCRy0tLS0tLS0tLWVqY3J5N0FBQUFBR3JhOFJBQUFyOGdBEgZCNjIyMjMaCwiwiwEQAhoDVVNEOBxwsIsB",
"legs": [
{
"airline": "B6",
"flight_number": "2223",
"departure_airport": "JFK",
"arrival_airport": "LAX",
"departure_time": "2026-12-15T08:01:00",
"arrival_time": "2026-12-15T11:25:00",
"duration_minutes": 384
}
]
},
{
"price": 189,
"currency": "USD",
"total_duration_minutes": 378,
"stops": 0,
"airline_name": "Delta",
"emissions": {
"co2_grams": 244000,
"co2_kilograms": 244,
"typical_co2_grams": 344000,
"typical_co2_kilograms": 344,
"difference_percent": -29
},
"booking_token": "CjRISVFvemhYdy1QZTBBQTR3SXdCRy0tLS0tLS0tLWVqY3J5N0FBQUFBR3JhOFJBQUFyOGdBEgVETDc3MxoLCJiTARACGgNVU0Q4HHCYkwE=",
"legs": [
{
"airline": "DL",
"flight_number": "773",
"departure_airport": "JFK",
"arrival_airport": "LAX",
"departure_time": "2026-12-15T09:00:00",
"arrival_time": "2026-12-15T12:18:00",
"duration_minutes": 378
}
]
},
{
"price": 215,
"currency": "USD",
"total_duration_minutes": 377,
"stops": 0,
"airline_name": "American",
"emissions": {
"co2_grams": 281000,
"co2_kilograms": 281,
"typical_co2_grams": 344000,
"typical_co2_kilograms": 344,
"difference_percent": -18
},
"booking_token": "CjRISVFvemhYdy1QZTBBQTR3SXdCRy0tLS0tLS0tLWVqY3J5N0FBQUFBR3JhOFJBQUFyOGdBEgVBQTM0MRoLCMCnARACGgNVU0Q4HHDApwE=",
"legs": [
{
"airline": "AA",
"flight_number": "341",
"departure_airport": "JFK",
"arrival_airport": "LAX",
"departure_time": "2026-12-15T14:59:00",
"arrival_time": "2026-12-15T18:16:00",
"duration_minutes": 377
}
]
}
],
"search_metadata": {
"origin": "JFK",
"destination": "LAX",
"departure_date": "2026-12-15",
"passengers": {
"adults": 1,
"children": 0,
"infants_in_seat": 0,
"infants_on_lap": 0
},
"cabin_class": "Economy",
"exclude_basic": false,
"max_stops": "Any number of stops",
"sort_by": "Top Flights",
"hl": "en",
"gl": "US",
"currency": "USD",
"response_time_ms": 5598
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}