Hacker News new | past | comments | ask | show | jobs | submit login

Fares and rules come from ATPCO (http://atpco.net). Flights come from OAG (http://www.oag.com). Seat availability requires data directly from the carrier, usually via a live query to the carrier's reservation system.

The GDS companies get this data from these sources and then in turn provide (crappy) APIs for customers to use to query it.

In general, if you're doing bookings you can get small amounts of the data (a query at a time) from a GDS. Otherwise you're looking at millions of dollars per year. And then you need to write code to parse it and price tickets using it (approximately 1M LoC if you're terse about it -- more like 30M if you're a GDS).

(I know all this because I co-founded ITA Software, whose software now powers Google Flights.)

This is what I love about HN. Someone asks a good technical question and literally one of the most qualified people in the world answers it.

I love the fact that literally one of the most qualified people in the world answers it and my first response is hmmm... hasn't OAG been replaced by Innovata as a schedules provider by now?

Thank you for building ITA Matrix - it is amazing tool and I don't know what I would do without it.

Lots of other people did a lot more of the actual building than I did, but on their behalf, "You're welcome!"

> Thank you for building ITA Matrix - it is amazing tool and I don't know what I would do without it.

Honest question (I swear I'm not trying to troll): what do you actually do with it that you can't do (or do as well as) with Google Flights or Kayak or some other site like that?

I ask because I've used ITA Matrix and never managed to find a cheaper flight than I can through "normal" means... but I rarely fly multi-destination (and basically never do more complicated stuff) so I'm not sure if the use case is beyond mine or if I just don't know how to utilize it in a useful manner.

- Time bars (incredibly handy for optimising for things like tight connections, which can be essential when flying international and missing a connection means being stranded for a day): https://i.imgur.com/RteViUF.png

- Multiple departure/destination airports (you can search SFO,SJC,OAK to LGB,LAX,SNA and back in a single search). To be fair Google supports this on desktop too (but doesn't on mobile).

- Better search for return flights with variable stay lengths (Google only does a 5x5 matrix, ITA Matrix does a full month).

However, perhaps the biggest downside is that you can't actually book through ITA Matrix. It only finds the fare, you have to find it elsewhere to actually buy it (although Hipmunk takes routing codes, which makes it easier)

One of the features I like to use a lot is the ability to specify fair classes. As an example, say I want to fly to Tokyo, and I am an Alaska Airlines mileage plan member. Alaska Airlines does not fly to Tokyo, but it has deals with airlines that do. However, sometimes the fare classes are quite complicated. For instance, "Economy" is broken down into many buckets, and not all are created equal. For instance, Delta has at least 13 buckets for Economy, and they each 'fare class' award different amounts of mileage to Alaska flyers [1]:

E: 25% Mileage

L, U, T, X, V: 50% Mileage

H, Q, K: 75%

B, M, S: 100% Mileage

Y: 125% Mileage

If you search on Google Flights, these will all be called "Economy". If you search on most of the other OTA's, you can sometimes find the fare class during checkout or even as part of your search results, but you can't filter on it (Hipmunk is one that does support some of ITA's syntax for these filters, but not all). The buckets aren't always strictly more/less expensive, but they're usually not exposed very easily, if at all[2]. So, you're often left crawling from listing to listing, expanding to see if they are going to get you any miles. (I'll save the debate of whether miles are worth all the effort for another day.)

On ITA, it's not unreasonable to construct a query that says "During the month of November, show me round trips that are between 12 and 19 days that are going from Denver to either Narita or Haneda Airports, which will earn me more than 50% miles on either Delta or American or JAL, but also only ones that connect in Portland or Los Angeles, with no prop planes or overnight stops, and no <50 minute connections or 3+ hour connections". (I wouldn't actually specify all of these stipulations, but they're good for the example! :) )

[1] https://www.alaskaair.com/content/mileage-plan/how-to-earn-m...

[2] Delta, to its credit, does allow you to search by minimum fair class on its advanced search)

Using ITA Matrix is pretty easy. Using ITA Matrix to actually find better deals takes a lot of knowledge about how the airline systems work.

If you're only looking at flights out of a particular airport and with a specific (default) routing, you'll probably not find anything better.

If you know that certain airports are hubs, or that a particular carrier has a slightly longer route that takes you via a certain city and maybe have a longer layover then you might be able to find some really good deals.

Being in Australia, I really don't get to take advantage of these things at all.

1. there's minconnect -- I can structure flights so I have time to sleep while in transit. You will never find those in a normal search engine, they try to achieve minimal time. There's also padconnect, if you don't like booking right on MCT -- which is often wise! -- then, as the name suggests, this will add N minutes to the prescribed minimal connection time.

2. As recently revealed by the company http://www.flyertalk.com/forum/27265924-post483.html you can avoid connections in certain countries which can be beneficial for visa purposes or certain personal privacy requirements ( I know a German physics professor who refuses to go to the US because of the fingerprinting. )

ITA Matrix Powers Google Flights and Kayak, or at least parts therein.

Last time I tried I found the fact I was able to select multiple departure airports and multiple destinations and see a calendar of fares a great way to find the cheapest fares.

A strong second to that, literally my favorite web tool in existence.

Thanks for Crash Bandicoot.

How did you go from games to developing airlines reservation and fares software?

I knew two awesome people through the MIT AI Lab, one of whom co-founded Naughty Dog, and the other of whom co-founded ITA Software. :)

Awesome connections!

If you don't mind sharing, does ITA/Google Flights still use Common Lisp for the backend?

Yes. The core of the backend is still in Common Lisp (and C++). Many ITA hackers are still contributing to the Common Lisp community :)

Interesting -- didn't Google use to be super strict on the languages/runtimes they use in production? Did they make an exception for ITA?

I don't actually know. But porting it would be a huge undertaking.

It does.

30M LoC sounds insane - what is the main reason behind there being so much code?

It requires a lot of code because the rules that govern the use of fares on a ticket are insanely complicated -- literally beyond anything you could possibly imagine a priori. There are dozens of rule "categories", each larded up with tons of complexity. There's even "Rule Category 25: Fare By Rule" which is essentially a complete macro facility for fares, allowing carriers to literally take an arbitrary fare's rules, modify them in all kinds of random ways, and publish the result as a new "virtual" fare.

As for the GDSes, their code is primarily TPF assembly. So now add the LoC blow-up of using a very low-level language.

There are like 25 people in the world who understand this stuff, and half of them likely work at ITA/Google.

Also people at Sabre (worked there) and I presume Amadeus (those are two main players - surprised you seemed to "forget" to mention them?).

As to the "categories", people at Sabre working with them used to say in some cases you can not even be sure if the calculation (of a ticket price - "fare") will end in finite time, so the "macro language" is apparently Turing-complete!

I wasn't meaning to slight either Amadeus or Sabre, and indeed they have most of the other half of the people who understand this stuff between them. The others are at various airlines around the world and at ATPCO.

I've written elsewhere that I personally think the original Sabre system was/is one of the most impressive accomplishments in the history of computing. Using modern tools made things easier for us at ITA, though we compensated for that by trying to compute the entire (very large) solution space for every query, where prior systems used heuristics.

Just some random question. Can you give some insight on how "Greenspuns Tenth Rule Of Programming" apply in this 30million LoC? thanks in advance

Does all that complexity limit the amount of price competition airlines engage in?

Java boilerplate? Just kidding. :)

What are your favorite travel hacks?

Never set foot on an airplane unless I absolutely have to. :)

Why is that exactly?

I'd imagine after staring at all the convoluted fare rules for a substantial amount of work time, anything to do with air travel becomes far less magical.

Do you know how expert flyer works under the hood? Always been curious about their credit model. Are they charging per query since they're paying per query to the GDS companies?

Hi Brett, we charge a monthly or a yearly subscription fee that at the Premium level includes unlimited searching. Details here: http://www.expertflyer.com/frequent-flyer-programs Email us if you want to discuss more at customercare@

Seconded on ITA Matrix, great piece of software!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact