Using Routing Language with ITA Fare Matrix

Today I’m going to show you the true power of the ITA Fare Matrix search engine. Some of this routing language has been incorporated into Hipmunk, although it’s not widely publicized. (Read my reviews to learn more; there are links in yesterday’s Hipmunk Giveaway post.)

How to Use ITA

Yesterday I introduced how to use ITA for a basic round trip flight from Seattle to Washington, DC. Among other things I showed you how to use time bars to display flight options and how to learn the fare breakdown for your final itinerary.

Although SEA-IAD seems like a very simple trip with lots of nonstop and one-stop options in each direction, there are ways to limit your search results to force certain airlines, certain flight numbers, and certain connections. ITA shares some of this information on its website, but I find it awfully brief. There are also other “secret” commands. These commands are extremely useful when you already have a strong sense of what kind of itinerary you want to build. They’re more than just specifying a favorite airline.

In addition, ITA sometimes will time out if your search is overly broad, returning some but not all of the possible itineraries. All search engines do this, and ITA has gotten worse since it was acquired by Google. If you can specify your restrictions in advance, then ITA will explore everything else much more thoroughly looking for the best possible deal.

Entering Advanced Routing Language

So, how do we activate this magical feature? Underneath the fields for departure and destination there is a link that says “Advanced routing codes.”

Clicking on this will open one additional field under each airport. You can type your advanced routing codes here, or you can place them immediately after the airport code, separated by two colons. (I usually prefer to write them in the departure and destination fields after two colons. The routing code fields will populate automatically and I don’t have to fill them in separately.)

To walk you through some examples, instead of “SEA” alone, use this command to require that the flight be marketed by United.

  • SEA :: UA

Because “UA” is listed once, ITA will look for a single direct flight. Repeat multiple times to specify the number of flights (e.g., “SEA :: UA UA UA” for three flights) or use the plus symbol to indicate any number of flights all marketed by the same carrier (e.g., “SEA :: UA+”).

Searching Multiple Airlines and Airports

You can search for multiple airports and airlines at the same time by separating them with a comma. The Washington, DC, area has three major airports: IAD, DCA, and BWI. Some of you may be aware of city codes, such as WAS, that encompass multiple airports, but be aware that they might not include every one you’re thinking of. For some reason I once thought NYC included JFK and LGA but not EWR. Apparently it does include all three, but my point is you should pay attention if you get strange results. I prefer to always specify individual airports. In addition to United, US Airways and American Airlines have a decent presence at DC-area airports. So you could change your search again to include all three airports and only those three airlines, or use a city code:

  • WAS :: UA,US,AA

You can also specify connecting cities by changing the command to look like this, for example, to require a connection in Denver or Chicago O’Hare:

  • SEA :: DEN,ORD

If you want to specify both a connection and an airline, you will have to be more careful. The airline code must go before the airport code for the connection, and you will only be specifying the airline for that particular flight. Here are two examples:

  • Example 1: SEA :: UA DEN
  • Example 2: SEA :: UA DEN UA

In the first example, only the first flight to Denver will be marketed by United, but the subsequent one can be marketed by other airlines. In the second example, both the first and second flights must be marketed by United. You can use the plus symbol to avoid entering the airline multiple times (e.g., “SEA :: UA+ DEN”).

You’ll notice that I keep saying flights are “marketed by” United. This means they could be codeshares that are operated by another carrier such as Air Canada or US Airways. That’s unlikely on a flight to a United hub like DEN, but you can still use “O:UA” to force ITA to find only flights operated by United (e.g., “SEA :: O:UA+ DEN”). Unlike before, where all flights were marketed by United but could be operated by other carriers, now the reverse is true. All flights will be operated by United, but could be marketed by other carriers.

All Advanced Routing Codes and Their Definitions

I am including a list of all the advanced routing commands at the end of this post, but before we get there, let me describe a much smaller group that uses a different syntax.

You can specify that flights be marketed by a particular alliance (so you don’t have to type in all the airline codes) or that tickets be issued in a particular fare class or booking class (such as “W” so that you can use your United systemwide upgrade to move from coach to business). These commands don’t require the two colons after the airport, but they won’t hurt, either. However, you must use a forward slash and include them at the end of any other advanced routing codes.

  • “/alliance star-alliance” to search Star Alliance members like United
  • “/alliance oneworld” to search oneworld members like American Airlines
  • “/alliance skyteam” to search SkyTeam members like Delta
  • “/f bc=w” to search for tickets in the W fare class
  • “/f bc=w|bc=y” to search for tickets in the W or Y fare classes

It’s unfortunate that multiple fare classes have to be entered individually separated by that vertical bar (located on your backslash key). However, it’s still very useful when you are trying hard to find an upgradeable flight.

Let me leave you with a warning. Because an ITA search will timeout after one minute, an overly broad search will not have time to return all the results. You will still get results, just not all of them. Usually this isn’t an issue, but it will be if you specify too many airports. Narrowing the number of airlines or choosing specific flights prevents the timeout. So, if you are planning to meet up with friends in one of several different cities in the United States to fly to Europe over spring break, and you want to keep your options open, you could easily use ITA to search for something like this:

  • Departing from: SEA,SFO,LAX,IAD,MIA
  • Destination: LHR,MUC,CDG,FCO,BCN,FRA

But it probably won’t return everything available, which means you could be missing the cheapest fares. Specifying a few airlines or even a single alliance will help a lot. It will also help to use some of the commands in the list below when you have found one or two specific flight numbers you are interested for the transatlantic portion of your journey but are still flexible about the domestic legs that get you to the gateway city.

I have found this route language to be most helpful in the past particularly when I am trying to connect through particular cities, such as choosing Houston over Denver in the winter, or when I want to avoid others, such as Toronto, which always seems to involve a five-hour layover. Feel free to ask me questions about how to structure your particular search parameters. You can also let me know if you are aware of any commands that I over looked.

My examples are based on ITA’s own instructions, which you can bring up by clicking on the question mark next to each of the advanced routing entry fields. I’ve expanded on them a bit where I felt ITA was unclear. And with that said, I give you the list:

chart of ITA routing commands

Various combinations of these commands are possible. For example:

chart of ITA routing command combinations

There are also many special commands to prevent “bad” flights courtesy of SeattleFred on FlyerTalk. List them after a forward slash and separated by commas, e.g., “BOS :: / -overnight,-redeye”. (Those are minus signs, not the tildes used for negation above.)

chart of ITA negative commands

SeattleFred also tells us how to set connection times and itinerary duration. These commands must also be preceded by a forward slash.

chart of ITA connection time and duration commands

The Blog's Back Up!
Other Features of ITA Fare Matrix
  • Grant

    Wow, so much to learn..,

  • Naif

    Great article..thanks

  • FEV7

    As a “newbie”, I am really appreciative of the information that you share. Thank you.

  • Scottrick

    You’re welcome, everyone! (I wouldn’t worry too much about the last two figures if you’re new. They are the least commonly used functions, at least in my experience.)

  • Travel Summary

    Is there a way to leverage this to find good mileage runs? Or is it just a matter of searching for different scenarios?

    • Scottrick

      Yes and no. There is a version of ITA that includes a price-per-mile calculation. I included it in yesterday’s post, and here it is again.

      When searching for mileage runs, I generally prefer to force a certain number of connections, force connections in certain places (e.g., IAH instead of ORD for someone like me in SEA heading to the East Coast), and search for several destinations at once (e.g., PBI, FLL, MIA, TPA).

  • Lfdf

    Great article. What’s the command the force really distant connections like LAX to SEA via IAH or ORD?

    • Scottrick

      In your case, I would use “LAX :: IAH,ORD” to force a flight from LAX connecting in either IAH or ORD. However, there may not be any fares published that allow this routing. In that case, ITA will be limited to combining two other fares, LAX-IAH and IAH-SEA for example, and that combination may cost much more than the extra miles are worth.

  • Hth

    Can I use ITA to find reward flight on airline like AA? Thanks for all the great info.

    • Scottrick

      Most airlines work. The exception are those like Southwest, which do not share their fares with Global Distribution Systems like Apollo and Sabre.

  • Nvm

    Is there a way to set the number of stopovers on ita?

    • Scottrick

      Yes. Use “X” or an actual airline code (“UA” or “AA” for example) multiple times separated by spaces. Each time will require one stop.

  • Gerg

    Great article explaining a lot of things including some I hadn’t seen. However one nit, you say typing “UA” will find one non-stop flight. That’s not quite correct. It will find one direct flight but direct flights can include stops when the same flight number continues on.

    • Scottrick

      Thank you for pointing that out. I’ll make the necessary change.

  • JIgger

    How can I do a calendar search using matrix restricting the search to one airline e.g. Delta so I can see the best days to fly to a destination? Thanks

    • Scottrick

      Use the DL+ command and perform a month-long search as usual. For example, a round trip flight from Seattle to Salt Lake City would look like:

      (Outbound) SEA :: DL+
      (Return) SLC :: DL+

  • tine

    Hello !
    I have one problem with multiple search at itamatrix: i like to fly
    with TK first and second flight(and not other airlines..), and 3. flight
    with 3K. When i try in round trip mode(for 1 and 2. flight ) i have no
    problems to find flight with Turkish airlines, but when go to multi
    city i dont know, where i have to put zestair code…? Can somebody help
    me please.

    • Scottrick

      Everything other than the airport code should go in the advanced routing language box below or after the airport using a double colon. See the previous post if this confuses you. Example:

      Flight 1:

      IST :: TK

      Flight 2:

      PER :: 3K

      Another way to do this is to specify a single trip (on the same day) that starts in IST and connects in PER, using two different airlines. Example:

      Flight 1:

      IST :: TK PER 3K

      • tine

        Thank you for quick answer! Maybe you didn t understand me, because i would like to fly 1: Budapest-Almaty(BUD :: TK) 2:Almaty-Budapest (ALA :: TK ), 3: Singapure-Kuala lumpur (SIN :: 3K). So what did i wrong? Thank you!

        • tine

          – i have one more qestion, is it 3x good for FD, when i put it in ita matrix i didnt see any YR or YO… do i look on real continet for 3x? thank you

          • Scottrick

            If there is no fuel surcharge, then there is no way to dump what does not exist.

        • Scottrick

          If you’re using the multi-city search you will need to specify an origin and destination for every flight. In a roundtrip search, it assumes that the second flight returns back to the origin of the first.

          So for a multi-city search like yours:

          Flight 1:

          Departing from: BUD :: TK
          Destination: ALA

          Flight 2:

          Departing from: ALA :: TK
          Destination: BUD

          Flight 3:

          Departing from: SIN :: 3K
          Destination: KUL

  • Bob

    How to search for flights only with staralliance AND in a certain fare class (upgradeable like W)?

    • Scottrick

      You should enter this line in the routing code field (below the airport name):

      /alliance star-alliance /f bc=w

      Basically, specify the alliance first and then the booking class. However, this solution isn’t really the best one to use. United only allows you to upgrade W fares or higher on flights they operate. A better way to search is to use this command:

      O:UA+ /f bc=w

      This will allow any number of flights so long as each one is operated by United. It still includes some codeshares (e.g., an ANA flight number, operated by United), but those are easy to wean out after performing the search.

      Since systemwide upgrades can also be used on some Lufthansa flights, in some cases you would want to change O:UA+ to O:LH+.

  • Ankit Agarwal

    Is it possible to select a 7 days stopover in ITA search ? I am looking for del-jfk return with stopover at lhr on both legs.

    • Scottrick

      Yes and no. A stopover is a feature of the fare rules. It basically means they’ll let you stop somewhere for seven days. Sometimes this is free, sometimes it costs money, and sometimes it isn’t allowed at all so you just have to book two separate fares.

      Whether you can do a stopover isn’t really important. What’s importnat is that you end up with a low fare, and that can happen with or without a true stopover.

      I suggest doing a multi-city search so you can specify each leg of your journey and the time you want to spend in each city.

  • Nina Beck

    How do I search for Y-Up fares? I’m new to this whole routing language thing! I love flying first class but hate paying for it! Any tips?

    • Scottrick

      Each airline has its own rules on fares that are eligible for a complimentary upgrade, which may include Y, B, and M fares on United (just one example). Elite status can also come into play, as well as the route traveled.

      To search for a specific fare, you would use the following command and replace “y” with the booking class of your choice:

      /f bc=y

  • Pingback: Introduction to Airline Inventory - Travel Codex()