Duffel Blog Lockup

Introducing Place Suggestion API: build an intuitive flight search tool faster

Profile image of post author James Wair
James Wair · May 2022

A great flight booking experience starts with an intuitive search function. You want to get it right for your customers but it takes time to build. That’s why we’re excited to introduce the Place Suggestion API as part of our complete toolkit for selling flights so you can deliver this functionality fast and at the highest quality.

Existing place search solutions

There are thousands of places to fly worldwide and your customers often know exactly which one they want to fly to. You can give them a great booking experience by getting rid of friction and helping them find their chosen city or airport as quickly as possible.

In traditional booking tools, users type their origin and destination into a form field and the API searches a list of places, aiming to find them with just a few keystrokes. For example, a user travelling to London might start typing ‘Lon’ and they’d expect to see relevant airports in the city. They might also start typing ‘Hea’ for Heathrow Airport or ‘Sta’ for Stansted Airport.

This seemingly simple functionality is a core aspect of a great booking experience so it’s important to get right. You could build it yourself but you’ll need to tackle a few core challenges including accessing reliable data, manipulating the data, and delivering search results to customers in an intuitive way.

To access reliable places data, you could either buy a dataset or scrape it from a public source, but you’ll quickly run into issues with these approaches. It can be expensive and the data can be unreliable which takes time to clean and risks you serving poor quality, inaccurate information on places to customers.

You then need to build an algorithm to manipulate the data. There are a number of considerations: cities vs metropolitan areas, airport location inside or outside of city limits, multiple airports in the same city or metropolitan area, and commercial vs private airports. For example, London is both a city and metropolitan area with six airports, however, only two of these are within city limits. Looking at the country level, England has 186 airports that need to be categorised: 96 commercial, 47 military, and 44 private. Worldwide this scales to thousands of airports that aren’t relevant to commercial travel sellers.

You also need to make the data searchable and deliver it to customers in an intuitive way. You need to consider data filtering and ordering, airport popularity, official IATA codes, and more. For example, customers looking for flights from London will likely be most interested in Heathrow, Stansted, and Gatwick – the three most popular airports. Frequently flyers will likely know the three-letter codes for these airports – LHR, STN, and LGW – and will need to be able to search by these as well as the full names.

Building the search algorithm from scratch can take days or weeks; it’s a costly investment when trying to move fast. Then once you’ve built and launched your own solution, you’ll need to continue investing engineers’ time to make sure the data and algorithm are accurate and up to date.

Introducing Place Suggestion API

Now with Place Suggestion API from Duffel, you can offer a best-in-class place search functionality, fast. You’ll save development time by connecting to the ‘suggestions’ endpoint in our API with just a few lines of code.

Instead of buying a dataset or scraping from unreliable sources, you’ll get access to the high-quality dataset maintained by the Duffel team with more than nine thousand places worldwide. We take care of the data manipulation to figure out which airports match cities and metropolitan areas and make sure customers can search and find the places they’re looking for, filtered for relevance and ranked by popularity.

Code snippet and visual component showing an example place search for ‘Lon’
An example search for airports in London

We also maintain the data over time so you can trust your customers will see a well-organised list of suggested places regularly updated, for example, when an airport opens or shuts down.

You know your customers the best and we want you to spend time building great flight booking experiences for them. There’s no need to spend engineering time researching and developing your own search algorithm – we’ve done the work for you. The Place Suggestion API takes care of the behind-the-scenes technical work so you can focus on designing intuitive user experiences.

Great developer tools with Duffel

Duffel makes it easy for flight sellers like you to scale their travel business. Once you integrate with the Duffel Flights API once, you’ll have access to 300+ airlines including 30+ Direct Connects and new airlines added every month.

To make the development process easier and give you more time to focus on your product and customers, you can access comprehensive developer documentation, client libraries, and pre-built user interface components.

Sign up to Duffel today >

Latest posts

Try it out on your own for free today

Sign up and start selling flights in less than 1 minute.