# Retrieve Flights
The following Endpoint will provide you with the price of a flight based on the input parameters entered. In addition to the price, it will provide you with detailed information about the origin, destination, duration, information about the carrier, among others.
Example API Request:
https://www.goflightlabs.com/retrieveFlights?
access_key=YOUR_ACCESS_KEY&originIATACode=LGW&destinationIATACode=JFK&date=2026-04-22&returnDate=2026-04-29&sortBy=best&mode=roundtrip
HTTP GET Request Parameters:
| Parameter | Description | |
|---|---|---|
access_key |
required | Your API access key, which can be found in your account dashboard. |
originIATACode |
required | Three-letter IATA code for the origin airport (use Retrieve Airports to obtain it). |
destinationIATACode |
required | Three-letter IATA code for the destination airport. |
date |
required | Date of departure (YYYY-MM-DD). |
returnDate |
optional | Date of return for roundtrips (YYYY-MM-DD). |
sortBy |
optional | Sort order for the scraping output. Possible values: best, cheapest, quickest. Default: best. |
mode |
optional | Flight mode. Possible values: roundtrip (default) or oneway. |
group_by_roundtrip |
optional | When set to true, the response is returned as roundtrip itineraries grouping outbound and inbound legs together (pairs + unpaired). Possible values: true, false (default). Only meaningful when mode=roundtrip. |
Example API Response:
{
"flights": [
{
"price": 283,
"currency": "USD",
"origin": {
"code": "LGW",
"city": "London"
},
"destination": {
"code": "JFK",
"city": "New York"
},
"departure": "2024-04-25T13:05:00",
"arrival": "2024-04-25T15:55:00",
"durationInMinutes": 470,
"stopCount": 0,
"flightNumber": "701",
"marketingCarrier": "Norse Atlantic Airways (UK)",
"operatingCarrier": "Norse Atlantic Airways (UK)"
},
{...}
]
}
Example API Response (with group_by_roundtrip=true):
{
"pairs": [
{
"outbound": {
"price": 283,
"currency": "USD",
"origin": { "code": "LGW", "city": "London" },
"destination": { "code": "JFK", "city": "New York" },
"departure": "2024-04-25T13:05:00",
"arrival": "2024-04-25T15:55:00",
"durationInMinutes": 470,
"stopCount": 0,
"flightNumber": "701",
"marketingCarrier": "Norse Atlantic Airways (UK)",
"operatingCarrier": "Norse Atlantic Airways (UK)"
},
"inbound": {
"price": 283,
"currency": "USD",
"origin": { "code": "JFK", "city": "New York" },
"destination": { "code": "LGW", "city": "London" },
"departure": "2024-05-02T18:10:00",
"arrival": "2024-05-03T06:30:00",
"durationInMinutes": 440,
"stopCount": 0,
"flightNumber": "702",
"marketingCarrier": "Norse Atlantic Airways (UK)",
"operatingCarrier": "Norse Atlantic Airways (UK)"
}
},
{...}
],
"unpaired": [
{...}
]
}
API Response Objects:
| Response Object | Description |
|---|---|
flights |
Array of scraped flight options. Returned by default (when group_by_roundtrip is not set or false). |
pairs |
Only present when group_by_roundtrip=true. Array of roundtrip itineraries, each containing an outbound and an inbound leg matched from the same provider offer. |
pairs[].outbound |
Flight object for the outbound leg (origin → destination). |
pairs[].inbound |
Flight object for the inbound leg (destination → origin). |
unpaired |
Only present when group_by_roundtrip=true. Array of flight legs that could not be grouped into a complete roundtrip pair. |
price |
Numeric price value for the flight. |
currency |
Currency code associated with the price (e.g., USD). |
origin |
Object describing the departure airport. |
origin.code |
IATA code of the origin airport. |
origin.city |
City where the origin airport is located. |
destination |
Object describing the arrival airport. |
destination.code |
IATA code of the destination airport. |
destination.city |
City where the destination airport is located. |
departure |
ISO datetime for takeoff. |
arrival |
ISO datetime for landing. |
durationInMinutes |
Total flight duration in minutes. |
stopCount |
Number of stops or layovers. |
flightNumber |
Marketing flight number. |
marketingCarrier |
Carrier selling or marketing the flight. |
operatingCarrier |
Carrier operating the aircraft. |