serpapi / public-roadmap

Public Roadmap for SerpApi, LLC (https://serpapi.com)
55 stars 5 forks source link

[Google Flight API] Support multi city search #1503

Closed hilmanski closed 3 months ago

hilmanski commented 7 months ago

A user asked if we can perform a "multi city" search on our Google Flight API.

This feature is supported by Google Flight search. CleanShot 2024-03-26 at 12 57 32@2x

Intercom

marm123 commented 5 months ago

A user requested this:

Intercom

corear commented 5 months ago

Is this not going to be implemented anytime soon?

marm123 commented 5 months ago

Hi @corear, thank you for reaching out. Unfortunately, I can't share any ETA for when the feature will be implemented. However, I'll bump this in our queue and change the status to queued. We'll get back to you once it's finished.

stedelmanto1 commented 5 months ago

Thanks for finally queueing this! Really needing this functionality

stedelmanto1 commented 5 months ago

Hi- just wanted to add that for the multi city a key requirement is to be able to add multiple flights (ex: SFO->EWR, EWR->IAH, IAH->ORD), not just a two destination itinerary (ex: SFO->EWR, EWR->IAH). Google flights supports this functionality with the + button when in multi city search mode.

hilmanski commented 4 months ago

A customer requested for this feature.

Front

vuemix commented 4 months ago

We are the customer that recently requested the feature. From google's end, the only key difference between one-way, round-trip, and multi-city is what Serp calls 'type'. Multi-city is type 3. The high-level problem is Serp's API is designed around single departure and arrival ID whereas Google Flight (and every other Flight API I know of e.g. Duffel, Amadeus, TravelPort, etc.) use arrays. Google Flight's native API request is organized roughly like below regardless of type:

{
     type: 1/2/3,
     cabin: <cabin type>,
     passengers: <passenger counts>,
     price-range: <range>,
     route: [ { origin: <code>,
                    destination: <code>,
                    departure-date: <date>,
                    timeofday: <timecode>,
                    stops: <stopcode>,
                    include-airlines:
                    exclude-airlines:
                    ...
                  },  
                  { origin: <code>,
                    destination: <code>,
                    timeofday: <timecode>,
                    ...
                   },
                  ...
                ]
}

which not only has an array of origin/dest but pulls in many of the filters on a per-segment basis. The departure_token / booking_token would likely be similar except there would be multiple departure_token steps as the desired segments get selected for each leg of the itinerary.

zyc9012 commented 4 months ago

@vuemix Thanks for your information. We were aware of the multi-city option when we designed this API. We didn't make the request to be an array because we wanted users to get started with the API more easily.

We are now working on this and will allow users to send arrays for multi-city flights.

zyc9012 commented 3 months ago

We've released the multi-city support. Please refer to https://serpapi.com/google-flights-api#api-parameters-advanced-google-flights-parameters-multi-city-json for documentation.

Example Playground

image

hilmanski commented 3 months ago

Thank you very much, @zyc9012 !

stedelmanto1 commented 3 months ago

Amazing!! Thank you very much @zyc9012 !