ITA Matrix Codes

ITA Matrix

The ITA Matrix (http://matrix.itasoftware.com/) is flight research tool that was designed by MIT scientists in 1996. It was acquired by Google in 2010 and is the engine behind Google flights as well many of the webs' most popular travel booking sites such as Kayak & Orbitz. Whilst Google Flights allows you to book flights and the ITA Matrix doesn't, it's still the better tool due to its far superior searching capabilities. Once the ITA Matrix has found your ideal flights the bookings will can be made via google flights, the carrier or a travel agent site such as Skyscanner. It's searching features are highly customisable. They allow advanced searches using codes to filter on or dismiss certain airlines and airports, use certain airline alliances such as Oneworld, and compare date ranges.

The main page shows the interface which has 3 tabs; Return Trip, One-way and Multi-City.
The majority of the options are self explanatory but clicking on 'Advanced Controls' right underneath the departure and destination fields allows you to use the advanced codes to highly customise the search.

Example Screenshots

In the first screen shot, a search is being performed for return flights from Jersey in the Channel Islands to Las Vegas, flying in Business Class or higher and with any airline in the Oneworld Alliance.

  • Departing anytime on either the 14th, 15th or 16th August 2020 and returning on the 21st August (but not until after lunchtime).
  • We know that there are no direct flights between the Channel Islands and Las Vegas so there will have to be one stop in London but we are happy to look at other options with up to 1 extra stop.
  • We have unticked 'Only show flights & prices with available seats' as we may be able to get these fares direct with the airline or with an agent.
  • Show prices in GBP
ITA Matrix Search Example


In this next example screen shot a similar search is being performed but this time using the Routing Codes to specify a carrier and the Extension Codes to specify a fare bucket.

  • Departing anytime of day on the 15th August, 2020 returning anytime of day on 21st August.
  • We use the Routing Code to specify British Airways as the Carrier for the first (and any subsequent flights) C:BA+
  • We want to search for the cheapest First Class fares so we use the Extension code to set the Fare's Booking Code f bc=a
  • We have no preference on the number of stops.
  • Finally, we have unticked 'Only show flights & prices with available seats' as we may be able to get these fares direct with the airline or with an agent.
ITA Matrix Search Example

Other examples of routing and extension codes include just using the Airlines Codes and specifying not in the economy cabin

ITA Matrix Search Example

Routing Codes

ITA's routing codes are an advanced feature that lets you include specific notations in your search to quickly add restrictions. The routing codes uses the following general rules:

  • Airlines are represented by their two letter codes.
  • Airports are represented by their three letter codes.
  • A direct flight is a flight with only one flight number, though it may have one or more take-off and landing. A non-stop flight is a flight with only one take-off and landing.
  • Carrier Prefixes:
  • C indicates marketing carrier.
  • O indicates operating carrier (the carrier whose logo is on the plane).
  • Airline codes entered without a prefix are assumed to mean marketing carriers (i.e., the carrier whose flight number is displayed, including codeshares.)
  • F can be used to identify a specific flight number or as a placeholder, indicating a flight segment. For example, if you want to make your trip in three segments, you would enter [F F F].
  • The prefixes C, X, and F can be used in your query to make it visually clearer what you are trying to accomplish, but they are optional. If you use them as a prefix, be sure to follow them with a colon. If you omit the prefixes, the system interprets two-letter codes as marketing carriers, three-letter codes as airports for connection points, and airline codes followed immediately by numbers as flights.
  • Countries are represented by their two-letter ISO3166 country codes
  • A ~ indicates negation and can be applied to airport codes, airline codes, and attributes, such as red-eye flights or risky connections.
  • A + indicates one or more flights or airports meeting the specified criteria.
  • A * indicates zero or more flights or airports meeting the specified criteria.
  • A ? indicates zero or one flight or airport meeting the specified criteria.

Codes apply to flight segments in the order they are specified, and restrict your results to the number of segments specified. If you want the code to apply to more than one segment, add + or ? to the code.

If you want to specify something for a particular flight segment and allow any additional flight segments before or after the specified segment, you should add F? before and after the codes you have specified. For example, to ensure you fly at least one leg of the trip on American Airlines, enter [AA] to restrict your search to itineraries with exactly one direct flight by American Airlines. Use [F* AA F*] to restrict your search to itineraries with at least one American Airlines flight, and some itineraries that can include additional flights from any carrier.

Flight segments are separated by spaces. When multiple options are acceptable for a particular flight segment, separate them with a comma, and be careful to omit any spaces.

Example Queries

DescriptionFormat
Restricting to specific airlines
Direct flight marketed by British Airways[BA] or [C:BA]
Any number of flights marketed by British Airways[BA+] or [C:BA+]
Direct flight marked by British Airways, United, or Delta[BA,CO,DL] or [C:BA,C:UA,C:DL]
Direct flight operated by British Airways (as opposed to a code-share or subsidiary carrier)[O:BA]
Direct flight operated by British Airways, United, or Delta (as opposed to a code-share)[O:BA,O:UA,O:DL]
Up to 3 flights, including at least one marketed by British Airways[F? BA F?]
Any number of flights, including at least one marketed by British Airways[F+ BA F+]
Exclude American Airlines and only show direct flights[~AA]
Exclude American Airlines and show options with zero or more connections.[~AA+]
Search for results with exactly two flights, and excluding American Airlines from the 2nd flight[F ~AA]
Search for results with a direct flight excluding flights marketed by British Airways, United, or Delta[~BA,UA,DL]
A flight on British Airways followed by a flight on United[BA UA]

Extension Codes

ITA Matrix has something called extension codes. Extension codes can be used to manipulate itinerary searches or fare results. Think of it as a filter, but with far more detailed customizability.

The use of extension codes is the single feature that makes Matrix one of the most powerful tools for searching for flights. When using multiple extension codes, you must separate them with a semicolon “;”. 
For example: f bc=i;alliance oneworld

Fare Codes

Fare codes represent the different categories of tickets, each with its own price and set of rules. Some fare classes and codes are standard across all airlines, while some are different depending on the airline. Below are some examples which are typically the same across all airlines:

  • Y: Full-fare economy-class ticket
  • J: Full-fare business-class ticket
  • F: Full-fare first-class ticket

British Airways has 22 fare classes and 4 redemption classes. Revenue fare classes are bookable for cash whilst redemption fare classes are for Avios or mileage bookings. Broadly speaking, the different fare classes within each cabin correlate both to the cost of the ticket as well as the flexibility of the fare offered. Of the 22 fare classes in BA, 12 of these are for economy class. thepointsguy.co.uk has some excellent further explanation on this.

British Airways Fare Codes:

CodeFare ClassAvios awardedTier Points
FFirst Class, Flexible300% Avios100%
AFirst Class, Lowest250% Avious100%
ZFirst Class, Reward0% Avious0%
J, C, DBusiness Class, Flexible250% Avios100%
R, IBusiness Class, Lowest150% Avios100%
UBusiness Class, Reward0% Avios0%
WPremium Economy, Flexible150% Avios100%
E, TPremium Economy, Lowest100% Avios100%
PPremium Economy, Reward0% Avios0%
Y, B, HEconomy, Flexible100% Avios100%
K, L, M, N, S, V Economy, Low50% Avios50%
Q, O, GEconomy, Low25% Avios25%
XEconomy, Reward0% Avios0%

For example, to specify the cheapest non-flexible Fare using a Booking Code use the following synatx:

  • For First Class use: f bc=a
  • For Business Class use f bc=i
  • For Premium Economy use f bc=t
  • For Cheapest Economy Class use f bc=s

Here are more Extensions Codes that can be used. When using multiple extension codes, separate them with a semicolon “;”. 

ITA Matrix Extension Codes for Faring
SyntaxExampleMeaning
+CABIN code1 code2 ...+CABIN 1Require booking in the specified cabin classes. For first class, use 1; for second, use 2; for premium economy, use premium-coach; for economy, use 3.
-CABIN code1 code2 ...-CABIN 3Prohibit booking in the specified cabin classes. See +CABIN for what codes to use for each cabin class.
F BC=codeF bc=yUse fares with the specified prime booking code. Note: the actual booking class used may be different due to being overridden by the carrier's booking code exception table.
F BC=code|BC=code|...F bc=y|bc=bSpecify that fares use one of several prime booking codes (e.g. book in either Y or B class). See the note on the above item.
F carrier.city1+city2.farebasisSpecify which fares to use. Multiple alternate fare specifications can be separated by a vertical bar. See below for specific examples.
F CC.AAA+BBB.FFFFFFF aa.lon+chi.yupSpecify carrier, market (city pair), and fare basis code of the fares to use (e.g. only AA LON-CHI YUP fares).
F ..FFFFFFF ..yup|..fSpecify the fare code (but not carrier or market) of the fare to use (e.g. either YUP or F fares on any airline and between any city pairs).
F .AAA+BBB.F .lon+chi.Specify the market (city pair) for the fares (e.g. use only LON-CHI through fares).
F CC..FFFFFFF aa..yup|aa..fSpecify the carrier and fare basis code, but not the market (e.g. use either YUP or F fares on AA for any city pair).
F ..F-F ..y-|..b-Specify the fare basis using "wildcards" (e.g. only use fare bases that start with either Y or B).
 
 
ITA Matrix Extension Codes for Itineraries
SyntaxExampleMeaning
-CODESHARE-CODESHAREDisallow codeshares.
MAXSTOPS nMAXSTOP 2Set a limit on the number of stops on this portion of the trip.
MAXDUR hh:mmMAXDUR 6:45Set a limit on the duration of this portion of the trip.
MAXMILES nMAXMILES 2900Set a cap on the number of miles flown on this portion of the trip.
MINMILES nMINMILES 2600Set a floor on the number of miles flown on this portion of the trip.
MINCONNECT hh:mmMINCONNECT 1:00Set a minimum connection time.
MAXCONNECT hh:mmMAXCONNECT 2:00Set a maximum length of connection time.
PADCONNECT hh:mmPADCONNECT 0:30Pad connection times with this much additional time.
ALLIANCE code|code|...ALLIANCE star-alliancePermit only flights on these carriers in this alliance (or alliances). Separate multiple alliances with a vertical bar character. Supported alliances are oneworld, skyteam, and star-alliance.
-AIRLINES code1 code2 ...-AIRLINES AA BAProhibit flights on the specified carriers.
AIRLINES code1 code2 ...AIRLINES BA AFAllow only flights on the specified carriers.
OPAIRLINES code1 code2 ...OPAIRLINES AAAllow only flights operated by these carriers (no matter the marketing carrier).
-OPAIRLINES code1 code2 ...-OPAIRLINES AAProhibit flights operated by these carriers (no matter the marketing carrier).
-CITIES code1 code2 ...-CITIES DFW ORDProhibit connections at these cities.
-REDEYES-REDEYESProhibit overnight flights.
-OVERNIGHTS-OVERNIGHTSProhibit solutions requiring overnight stops.
-PROPS-PROPSProhibit flights on propeller planes.
-NOFIRSTCLASS-NOFIRSTCLASSAll flights must have a first class cabin (though flights may still be booked in another cabin)