public-roadmap icon indicating copy to clipboard operation
public-roadmap copied to clipboard

[Google Flights API] Convert Location Names to Airport Codes

Open schaferyan opened this issue 1 year ago • 2 comments

A customer requested support for converting location names to airport codes.

We might be able to scrape this using Google Flights Autocomplete:

Screenshot 2024-05-23 at 12 14 28 PM

Potentially we could also compile a list or serve these as a separate API, similar to our Locations API or Walmart Stores Locations.

Potentially we could also get kgmids from the Wikidata Rest API. I've suggested that as a workaround for the customer.

Intercom | Wikidata Rest API

schaferyan avatar May 23 '24 19:05 schaferyan

Another user requested this:

Front | Intercom

martin-serpapi avatar Jun 26 '24 10:06 martin-serpapi

One way to convert a city name to IATA code is using our Google answer box API. We can use this as a temporary suggestion to a customer.

Here is an example: Playground: search for airport code for Beirut

hilmanski avatar Oct 03 '24 02:10 hilmanski

Another user requested this:

Intercom


For context, the user was trying to perform a search using the departure ID BUE. BUE is not actually a specific airport code, but instead a generic code for all Buenos Aires Metropolitan airports (source).

Currently, the Google Flights API does not return any flights for this:

image

https://serpapi.com/playground?engine=google_flights&departure_id=BUE&arrival_id=PDX&currency=USD&outbound_date=2024-12-30&return_date=2025-01-17&adults=2

Opening the google_flights_url returns flights in Google:

image

https://www.google.com/travel/flights?hl=en&gl=us&curr=USD&tfs=CBwQAhoeEgoyMDI0LTEyLTMwagcIARIDQlVFcgcIARIDUERYGh4SCjIwMjUtMDEtMTdqBwgBEgNQRFhyBwgBEgNCVUVCAgEBSAFwAZgBAQ==

Typing BUE into Google Flights returns Buenos Aires, Argentina (or the equivalent of the location kgmid).

image

As @schaferyan suggested, using data from a Google Flights Autocomplete API would likely resolve this user's issue.

NateSkiles avatar Dec 10 '24 23:12 NateSkiles

Another customer requested this:

Intercom

martin-serpapi avatar Jan 06 '25 07:01 martin-serpapi

A user requested this:

Intercom

sonika-serpapi avatar Jan 14 '25 19:01 sonika-serpapi

Another customer requested this:

Intercom

NateSkiles avatar Jan 29 '25 21:01 NateSkiles

Another user requested this:

Intercom

NateSkiles avatar Mar 10 '25 18:03 NateSkiles

A user requested this.

Intercom

hilmanski avatar May 06 '25 05:05 hilmanski

A customer wanted to use this:

Intercom

sonika-serpapi avatar Dec 08 '25 20:12 sonika-serpapi