In 2014, a recent study amassed 1.5 billion airfares and watched 4,986,522 trips, recording the lowest fare for each trip every day from 320 days in advance up until one day before flight time. It’s a treasure trove of cool info if you’re an airfare geek; or, a curious use of terabytes, if you’re anybody else.

They found that the best time to buy domestic flights was 47 days ahead of time

Here are 5 additional pieces of advice that we are able to glean from this massive study. Keep in mind that our focus here is on domestic flights – those within the U.S.

1. When You Buy Matters

A graph of the best fare by the numbers of days booked in advance looks deceptively smooth, aside from the sharp rise once you get inside 14 days. At 320 days out when we started looking, average fares were about $50 higher than their low point. Prices dropped gradually until 47 days out (the bottom) and after that they started to rise again slowly. Once inside of 14 days they shot up pretty significantly.

But the smoothness of this graph belies the true volatility of the market. It looks smooth only because we are aggregating such a large number of individual trips. The spikes and dips even out over such a large dataset. But our study confirms that the price volatility when buying an airline ticket is more like buying a share of stock than buying something at Target. The lowest possible prices change on average 70 times during the booking window we looked at – that’s once every 4 ½ days! And even if we ignore the super-pricey booking period of within 14 days, the average difference between the best low fare and the worst low fare was a whopping $201 during the time a trip was available for sale! So the date you pick to book your flight absolutely makes a huge difference.

2. Waiting for Last Minute Deals is a Bad Idea

The easiest and most obvious conclusion we can draw is that you should buy your ticket at least 14 days in advance. The Boston to Detroit example above was an outlier. Fares are almost always more expensive at the last minute. Tickets purchased within 14 days were $111 more, on average, than those purchased further in advance; tickets purchased within seven days were $174 more. So don’t believe the myth that never seems to die that a day before flight time airlines will practically give away their unsold seats. That doesn’t happen. Give yourself 14 days advance purchase at the very least; or better yet, 21 if you can swing it.

3. Be Careful Not to Book Too Early

The worst thing you could do is buy your ticket too late but the second worst thing you could do was to buy your ticket too early. That’s still true, but the “penalty” for buying a ticket too early is less significant than in years past.

Airlines have historically come out with really high fares when flights open for sale, let them sit for a while, and then introduce various sales a few months before flight time in a mad scramble to fill all the empty seats. But with Delta having swallowed up Northwest, United merging with Continental, Southwest buying AirTran and now American combining with US Airways, there is less competition and less capacity. Airlines don’t have to do as much scrambling. Fares still tend to be lower a few months before travel than they are 11 months before travel, but that difference is not as pronounced as it used to be. Still, on average, domestic flights open up for sale about $50 higher than their ultimate lowest price – and they typically stay that way for many months.

4. One to Four Months Out is the “Prime Booking Window”

The general pattern is that from the time a flight opens for sale, fares will drop slowly but steadily until reaching a low point somewhere between 27 days and 114 days out. That three month window, which is essentially between one and four months in advance, is what we call the “prime booking window”. Much more often than not, the best fare for a domestic trip will be offered at some point during that window.

If you don’t book within this window, it is generally better to book too early than too late. Those booking more than 114 days out paid an average of $32 more for their flight in 2014; those booking inside 27 days paid an average of $47 more (and a lot more than that if within 14 days).

5. For Summer and Holiday Travel, the Rules are a Little Different

There are important exceptions to these patterns, mostly for very popular routes during very popular times where flights tend to fill up quickly and the most optimal time to buy tends to be earlier than the normal one to four months. Hawaii is a great example; the best time to buy flights to Hawaii is usually pretty close to the time they go on sale (11 months in advance). Flights around Christmas and Thanksgiving, and warm weather trips for Spring Break, also have a different dynamic and you’re generally better off booking sooner rather than later.

In 2014, demand for air travel continued to increase and airlines kept supply in check for the whole summer. June to August began to look a lot like the special holiday seasons. For summer travel last year, the best time to book was 76 days in advance on average – almost a month earlier than the rest of the year. And the danger in booking too early was much less pronounced. Fares booked 320 days in advance were, on average, only $8 more than their low point. More than ever before, air travel has become a seller’s market, especially in the peak seasons, and the airlines don’t have to be as aggressive as they used to in order to fill all their seats. This means that the deals you see early on for peak season flights are increasingly likely to be among the best deals that will be offered.

But It’s Not Just About Price…

It’s important to understand something about our methodology. For every booking date for every trip, we simply looked at the lowest possible fare that would have gotten you there, without regard to airlines, flight times, or number of stops. Sometimes, there are differences in the quality of flights or choices of flights that are not reflected in our numbers. For instance, there might be a situation where 80 days before a trip from L.A. to New York there were eight non-stop and 24 one-stop flight options for $350. 30 days before that same trip there might have been just one flight left at $350, a one-stop flight at 6:00am with a 2 ½ hour layover in Chicago. Based on our methodology, each of the two scenarios has the same low fare so we would have treated both as equal – and our numbers would suggest you are in a good position to wait. In reality? You would have been much better off booking 80 days out.

No matter where you’re going, it’s a pretty fair assumption that the number of options (and, therefore, the quality of those options) is highest the earlier you book. This is important for flyers who care a lot about specific flights, specific flight times, specific routes, or specific airlines. The less flexible you are with respect to these parameters, the more we advise you to book earlier than we would otherwise suggest to make sure you can get a flight that is satisfactory.

Some Additional Tips for Finding the Best Air Fares

Given everything that we’ve learned, here is some general advice on how to go about your airfare search:

– Since it’s impossible to know exactly the best day to buy an airline ticket, the best strategy is to check fares early and often. For travel during the summer or holidays, start your research as soon as you can. For other travel dates, try to check frequently in the one to four month lead-up to your travel dates. By checking often enough, you are likely to see both the ups and the downs as fares fluctuate– and you’ll be able to tell the difference and recognize a good deal.

– Aim for a good deal, not the best deal. With 70 different fare changes on average for each trip, you have to get very lucky to book your flight at their absolute rock bottom. So don’t get too caught up in trying to squeeze a few extra dollars off your ticket price. When you see a good deal, grab it since any good fare is much more likely to go up than down.

– Consider booking much earlier than the 47 days in advance if: (1) you are traveling for a holiday; (2) you are traveling during the summer; (3) you are traveling with a family or large party (three or more travelers); (4) or, you are particular about your airline, number of stops, travel times, or seat assignments and you see only a few flights offered that you’d be happy with.

– Avoid booking too early (before four months) if all of these are true: (1) you are not traveling during the summer or for a holiday; (2) you are traveling by yourself; (3) and, you’re flexible on the airline and flight times.