# 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.

NOTE: Some of the input parameters need to be obtained beforehand from the Retrieve Airports API and/or Retrieve Countries API.

If you receive incomplete results, please wait a moment and try your request again for the full information. Sometimes heavy queries may take longer to process.
Please be aware that incomplete API calls will still be counted towards your API usage.

Example API Request:

https://app.goflightlabs.com/retrieveFlights? access_key=YOUR_ACCESS_KEY&originSkyId=LOND&destinationSkyId=NYCA&originEntityId=27544008&destinationEntityId=27537542&date=2024-06-21

HTTP GET Request Parameters:

Parameter Description
access_key required Your API access key, which can be found in your account dashboard.
originSkyId required Extract the originSkyId code from the retrieveAirport endpoint.
destinationSkyId required Retrieve the destinationSkyId code from the retrieveAirport endpoint.
originEntityId required The originEntityId code is attainable from the retrieveAirport endpoint.
destinationEntityId required The destinationEntityId code is retrievable from the retrieveAirport endpoint.
date required Date of departure or travel. Format: YYYY-MM-DD.
returnDate optional Date of return. Format: YYYY-MM-DD.
adults optional Number of adults (aged 18 and over) Default value: 1.
cabinClass optional Possible values: economy, premium_economy, business, first.
sortBy optional Possible values: best, price_high, fastest, outbound_take_off_time, outbound_landing_time, return_take_off_time, return_landing_time.
childrens optional Number of children (aged 2-12 years).
infants optional Number of infants (under 2 years old).
currency optional Desired currency. For example USD. Can be obtained from the endpoint retrieveCountries.
market optional For example en-US. Can be obtained from the endpoint retrieveCountries.
countryCode optional For example US. Can be obtained from the endpoint retrieveCountries.

Example API Response:

    
    {
    "context": {
        "status": "complete",
        "totalResults": 493
    },
    "itineraries": [
        {
            "id": "13542-2404251305--30598-0-12712-2404251555",
            "price": {
                "raw": 283,
                "formatted": "$283",
                "pricingOptionId": "H5jQFQJ9D3AU"
            },
            "legs": [
                {
                    "id": "13542-2404251305--30598-0-12712-2404251555",
                    "origin": {
                        "id": "LGW",
                        "name": "London Gatwick",
                        "displayCode": "LGW",
                        "city": "London",
                        "country": "United Kingdom",
                        "isHighlighted": false
                    },
                    "destination": {
                        "id": "JFK",
                        "name": "New York John F. Kennedy",
                        "displayCode": "JFK",
                        "city": "New York",
                        "country": "United States",
                        "isHighlighted": false
                    },
                    "durationInMinutes": 470,
                    "stopCount": 0,
                    "isSmallestStops": false,
                    "departure": "2024-04-25T13:05:00",
                    "arrival": "2024-04-25T15:55:00",
                    "timeDeltaInDays": 0,
                    "carriers": {
                        "marketing": [
                            {
                                "id": -30598,
                                "logoUrl": "https://logos.skyscnr.com/images/airlines/favicon/I%29.png",
                                "name": "Norse Atlantic Airways (UK)"
                            }
                        ],
                        "operationType": "fully_operated"
                    },
                    "segments": [
                        {
                            "id": "13542-12712-2404251305-2404251555--30598",
                            "origin": {
                                "flightPlaceId": "LGW",
                                "displayCode": "LGW",
                                "parent": {
                                    "flightPlaceId": "LOND",
                                    "displayCode": "LON",
                                    "name": "London",
                                    "type": "City"
                                },
                                "name": "London Gatwick",
                                "type": "Airport",
                                "country": "United Kingdom"
                            },
                            "destination": {
                                "flightPlaceId": "JFK",
                                "displayCode": "JFK",
                                "parent": {
                                    "flightPlaceId": "NYCA",
                                    "displayCode": "NYC",
                                    "name": "New York",
                                    "type": "City"
                                },
                                "name": "New York John F. Kennedy",
                                "type": "Airport",
                                "country": "United States"
                            },
                            "departure": "2024-04-25T13:05:00",
                            "arrival": "2024-04-25T15:55:00",
                            "durationInMinutes": 470,
                            "flightNumber": "701",
                            "marketingCarrier": {
                                "id": -30598,
                                "name": "Norse Atlantic Airways (UK)",
                                "alternateId": "I)",
                                "allianceId": 0,
                                "displayCode": ""
                            },
                            "operatingCarrier": {
                                "id": -30598,
                                "name": "Norse Atlantic Airways (UK)",
                                "alternateId": "I)",
                                "allianceId": 0,
                                "displayCode": ""
                            }
                        }
                    ]
                }
            ],
            "isSelfTransfer": false,
            "isProtectedSelfTransfer": false,
            "farePolicy": {
                "isChangeAllowed": false,
                "isPartiallyChangeable": false,
                "isCancellationAllowed": false,
                "isPartiallyRefundable": false
            },
            "eco": {
                "ecoContenderDelta": 11.6927805
            },
            "fareAttributes": [],
            "tags": [
                "cheapest"
            ],
            "isMashUp": false,
            "hasFlexibleOptions": false,
            "score": 0.999
        },
        {...}
      }
    
  

API Response Objects:

Response Object Description
itineraries An array of itineraries containing flight information.
id Unique identifier for the itinerary.
price Object containing price details for the itinerary.
price.raw The raw price of the itinerary.
price.formatted The formatted price of the itinerary.
price.pricingOptionId The pricing option ID for the itinerary.
legs An array of legs (flight segments) for the itinerary.
legs.id Unique identifier for the leg.
legs.origin Object containing details about the origin airport.
legs.origin.id The IATA code of the origin airport.
legs.origin.name The name of the origin airport
legs.origin.displayCode The display code of the origin airport.
legs.origin.city The city where the origin airport is located.
legs.origin.country The country where the origin airport is located.
legs.origin.isHighlighted Indicates if the origin airport is highlighted.
legs.destination Object containing details about the destination airport.
legs.destination.id The IATA code of the destination airport
legs.destination.name The name of the destination airport.
legs.destination.displayCode The display code of the destination airport.
legs.destination.city The city where the destination airport is located.
legs.destination.country The country where the destination airport is located.
legs.destination.isHighlighted Indicates if the destination airport is highlighted
legs.durationInMinutes The duration of the flight segment in minutes.
legs.stopCount The number of stops in the flight segment.
legs.isSmallestStops Indicates if the flight segment has the smallest number of stops.
legs.departure The departure datetime of the flight segment.
legs.arrival The arrival datetime of the flight segment.
legs.timeDeltaInDays The time delta in days for the flight segment.
legs.carriers Object containing details about the carrier of the flight segment.
legs.carriers.marketing Array of marketing carriers for the flight segment.
legs.carriers.marketing.id The ID of the marketing carrier.
legs.carriers.marketing.logoUrl The URL of the logo of the marketing carrier.
legs.carriers.marketing.logoUrl The URL of the logo of the marketing carrier.
legs.carriers.marketing.name The name of the marketing carrier.
legs.carriers.marketing.operationType The operation type of the carrier.
legs.segments An array of segments within the leg.
legs.segments.id Unique identifier for the segment.
legs.segments.origin Object containing details about the origin of the segment.
legs.segments.origin.flightPlaceId The flight place ID of the origin airport.
legs.segments.origin.displayCode The display code of the origin airport.
legs.segments.origin.parent Object containing details about the parent location of the origin airport.
legs.segments.origin.name The name of the origin airport.
legs.segments.origin.type The type of location for the origin airport (e.g., Airport, City).
legs.segments.origin.country The country where the origin airport is located.
legs.segments.destination Object containing details about the destination of the segment.
legs.segments.destination.flightPlaceId The flight place ID of the destination airport.
legs.segments.destination.displayCode The display code of the destination airport.
legs.segments.destination.parent Object containing details about the parent location of the destination airport.
legs.segments.destination.name The name of the destination airport.
legs.segments.destination.type The type of location for the destination airport (e.g., Airport, City).
legs.segments.destination.country The country where the destination airport is located.
legs.segments.departure The departure datetime of the segment.
legs.segments.arrival The arrival datetime of the segment.
legs.segments.durationInMinutes The duration of the segment in minutes.
legs.segments.flightNumber The flight number of the segment.
legs.segments.marketingCarrier Object containing details about the marketing carrier of the segment.
legs.segments.marketingCarrier.id The ID of the marketing carrier.
legs.segments.marketingCarrier.name The name of the marketing carrier.
legs.segments.marketingCarrier.alternateId The alternate ID of the marketing carrier.
legs.segments.marketingCarrier.allianceId The alliance ID of the marketing carrier.
legs.segments.marketingCarrier.displayCode The display code of the marketing carrier.
legs.segments.operatingCarrier Object containing details about the operating carrier of the segment.
legs.segments.operatingCarrier.id The ID of the operating carrier.
legs.segments.operatingCarrier.name The name of the operating carrier.
legs.segments.operatingCarrier.alternateId The alternate ID of the operating carrier.
legs.segments.operatingCarrier.allianceId The alliance ID of the operating carrier.
legs.segments.operatingCarrier.displayCode The display code of the operating carrier.
isSelfTransfer Indicates if the itinerary is a self-transfer.
isProtectedSelfTransfer Indicates if the itinerary is a protected self-transfer.
farePolicy Object containing details about the fare policy for the itinerary.
farePolicy.isChangeAllowed Indicates if changes are allowed for the fare.
farePolicy.isPartiallyChangeable Indicates if partial changes are allowed for the fare.
farePolicy.isCancellationAllowed Indicates if cancellations are allowed for the fare.
farePolicy.isPartiallyRefundable Indicates if partial refunds are allowed for the fare.
eco Object containing eco-related details for the itinerary..
eco.ecoContenderDelta The eco-contender delta value.
fareAttributes Array of fare attributes for the itinerary.
isMashUp Indicates if the itinerary is a mash-up.
hasFlexibleOptions Indicates if the itinerary has flexible options.
score The score of the itinerary.