Flights API

Overview

The Flights API is an asynchronous API with the following request types:

All requests can be made using a HTTP GET with arguments passed in the query string.

Example Request

http:///api/1.4/xml/Flights?action={requestType}
http:///api/1.4/json/Flights?action={requestType}

StartSearch (Request)

NameTypeDescription
keystringAPI key
originstringOrigin airport code (IATA)
destinationstringDestination airport code (IATA)
outDatestringDeparture date (YYYY-mm-dd)
retDatestringReturn date (YYYY-mm-dd)
adultsintNumber of adults
childrenintNumber of children
infantsintNumber of infants
cabincharCabin class
currencyCodestringCurrency code (ISO 4217)
countryCodestringCountry code (ISO 3166-1 alpha-2)
languageCodestringLanguage code (ISO 639-1)
datastringCaller supplied data string (optional) [1]

[1] The data string gets echoed in the response. This can be used by the caller to match responses to requests.

StartSearch (Response)

NameTypeDescription
elapsedTimeintTime to process request (in milliseconds)
datastringCaller supplied data string (optional)
searchIdstringSearch ID for PollSearch

PollSearch (Request)

NameTypeDescription
keystringAPI key
searchIdstringSearch ID returned by StartSearch
datastringCaller supplied data string (optional) [1]

PollSearch (Response)

NameTypeDescription
elapsedTimeintTime to process request (in milliseconds)
datastringCaller supplied data string (optional)
searchResultsFlightResultsFlight search results

StartFareRequest (Request)

NameTypeDescription
keystringAPI key
itineraryIdstringItinerary ID returned by PollSearch
datastringCaller supplied data string (optional) [1]

[1] The data string gets echoed in the response. This can be used by the caller to match responses to requests.

StartFareRequest (Response)

NameTypeDescription
elapsedTimeintTime to process request (in milliseconds)
datastringCaller supplied data string (optional)
fareRequestIdstringPollFareRequest

PollFareRequest (Request)

NameTypeDescription
keystringAPI key
fareRequestIdstringFare request ID returned by StartFareRequest
datastringCaller supplied data string (optional) [1]

[1] The data string gets echoed in the response. This can be used by the caller to match responses to requests.

PollFareRequest (Response)

NameTypeDescription
elapsedTimeintTime to process request (in milliseconds)
datastringCaller supplied data string (optional)
fareRequestResultsFlightResultsFare request results

FlightResults

NameTypeDescription
isFinishedboolIndicates if search has completed yet
currencyCodestringResponse currency code (ISO 4217)
countryCodestringResponse country code (ISO 3166-1 alpha-2)
languageCodestringResponse language code (ISO 639-1)
airlinesAirline[]Array of airlines
airportsAirport[]Array of airports
hopsHop[]Array of hops
legsLeg[]Array of legs
agents Agent[]Array of agents
itinerariesItinerary[]Array of itineraries

Airline

NameTypeDescription
codestringAirline code (IATA)
namestringDisplay name
urlstringAirline URL (optional)
iconIconAirline icon (optional)

NameTypeDescriptioncodestringAirport code (IATA) namestringDisplay name latfloatLatitude (WGS84) lngfloatLongitude (WGS84) timeZonestringTime zone (IANA)

Hop

NameType Description
airlineintMarketing carrier (index into airlines array)
flightNumberstringFlight number
operatingAirlineintOperating carrier (index into airlines array)
fromAirportintOrigin airport (index into airports array)
toAirportintDestination airport (index into airports array)
depTimestringDeparture time (24-hour local time - hh:mm)
arrTimestringArrival time (24-hour local time - hh:mm)

Leg

NameTypeDescription
hopsint[] Array of hops (indices into hops array)

Agent

NameTypeDescription
namestringAgent name

Itinerary

NameTypeDescription
outboundLegintOutbound leg (index into legs array)
returnLegintReturn leg (index into legs array)
itineraryIdstringItinerary ID for StartFareRequest
faresFare[]Array of fares

Fare

NameTypeDescription
agentintAgent (index into agents array)
bookingUrlstringBooking deeplink URL
pricefloatFare price
currencyCodestringCurrency code (ISO 4217)

Icon

NameTypeDescription
urlstringRelative URL path of icon image
xintegerHorizontal offset of icon in image (in pixels)
yintegerVertical offset of icon in image (in pixels)
wintegerWidth of icon in image (in pixels)
hintegerHeight of icon in image (in pixels)

Cabin Class

ValueDescription
eEconomy
pEconomyPlus
bBusiness
fFirst

Boolean

A Boolean is encoded as an integer, where 0 = false and 1 = true.

Sign up to use Rome2rio free on your web site or mobile app today.


Sign up Now