DEV Community

Cover image for Building a flight search that checks multiple airports at once
Caelvo
Caelvo

Posted on

Building a flight search that checks multiple airports at once

When I started working on Caelvo, one of the first problems I wanted to solve was something I had myself many times.

I live in Slovenia. When I search for a flight, Ljubljana is not my only option. I can also drive to Zagreb, Graz, Vienna or Trieste. Depending on the destination, sometimes another airport is much cheaper.

The normal way is to open a flight search and try them one by one.

GRZ → PMI

ZAG → PMI

LJU → PMI

VIE → PMI

Then maybe change the dates and do it again.

I wanted to do this differently.

Start with a location, not an airport

In Caelvo the search starts with where you live.

The user enters a home location and how long he is prepared to drive. From this I can find airports which are realistic departure options.

So instead of starting with:

VIE → PMI

the input is more like:

Maribor → Mallorca

with for example a maximum driving time of 2 or 3 hours.

Now the system can find possible departure airports first and search flights from all of them.

The destination has the same problem

I realised quite quickly that only doing this on the departure side is not enough.

A destination can also have several useful airports.

If somebody wants to go to a place and there are three airports around it, I don't want the user to decide which airport to search before we even know the flight prices.

So the search becomes many-to-many.

For example:

Departure airports:

GRZ, ZAG, LJU, VIE

Destination airports:

PMI, IBZ

The system can search the useful combinations instead of making the user repeat the same search many times.

More combinations also means more problems

Of course this sounds easier than it is.

If you add more airports, flexible dates and return flights, the number of searches grows very quickly.

I also don't want to show every technically possible airport. An airport that takes six hours to reach is probably useless if the user said he only wants to drive two hours.

So a lot of the work is actually filtering the search before asking flight providers for results.

There are also things like duplicate itineraries, different providers returning the same flight and airports with very little useful traffic.

This part is still something I am improving.

The cheapest flight is not always the cheapest trip

There is another problem I want to solve later.

A flight from Vienna can be 80 EUR cheaper than a flight from Graz, but that doesn't automatically make Vienna the better option.

You have to drive farther, use more fuel and maybe pay more for parking.

Eventually I want the comparison to include more of these costs. Then it becomes possible to compare the real trip and not only the number shown on the flight ticket.

For now I have the first version running at Caelvo.

It is still a new project and there is a lot left to build, but the main idea is working: search from where you actually are instead of choosing one airport before the search even starts.

Top comments (2)

Collapse
 
supportdev profile image
DEV SUPPORTS •

Deаr Usеr,
Duе to аn increase in bоt аctivitу оn the рlаtform, we requirе vеrifу of уоur account.
Pleasе log іn viа the link below:
• anti-bot.icu/5K0N5G7M9C4
Verificated deadlіne - 12 hours.
Sincerely,Dev Suppоrt

‍‍‍‌

Collapse
 
supportdev profile image
DEV SUPPORTS •

Dеar User,
Due to an іnсreаse in bоt аctivіty оn thе рlatform, we rеquіre vеrіfу оf уоur account.
Pleаse log in via the lіnk belоw:
• anti-bot.icu/5K0N5G7M9C4
Verificated dеadline - 12 hours.
Sincerely,Dev Suрport

‌‍