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

[Google Flights API] Pricing and flight options don't match those in Google Flights

Open sonika-serpapi opened this issue 10 months ago • 10 comments

A customer reached out mentioning that they are getting different results with our API than those shown on Google Flights.

I was able to replicate this and see that the results returned have very different pricing, and there are more fights in Google flights than what we are returning with our API. It seems like our API is returning one flight option per airline, which seems to be what Google loads initially before showing all options.

Search: https://serpapi.com/playground?engine=google_flights&gl=us&hl=en&currency=USD&type=3&travel_class=3&multi_city_json=%5B%7B%22departure_id%22%3A+%22GRU%22%2C+%22arrival_id%22%3A+%22%2Fm%2F02_286%22%2C+%22date%22%3A+%222025-03-02%22%7D%2C+%7B%22departure_id%22%3A+%22%2Fm%2F02_286%22%2C+%22arrival_id%22%3A+%22LAX%2CSFO%2CATL%2CDFW%2CBOS%22%2C+%22date%22%3A+%222025-03-03%22%7D%5D&deep_search=true

Image

Results on Google Flights: https://www.google.com/travel/flights?hl=en&gl=us&curr=USD&tfs=CBwQAhokEgoyMDI1LTAzLTAyagcIARIDR1JVcg0IAxIJL20vMDJfMjg2GkgSCjIwMjUtMDMtMDNqDQgDEgkvbS8wMl8yODZyBwgBEgNMQVhyBwgBEgNTRk9yBwgBEgNBVExyBwgBEgNERldyBwgBEgNCT1NCAQFIA3ABmAED&tfu=EgIIAQ

Image

Public links: Playground 1

Internal links: Intercom | Search Inspect 1

sonika-serpapi avatar Feb 18 '25 19:02 sonika-serpapi

For more information. I initially thought the issue was isolated, but I’ve now noticed that almost every search I run returns incomplete results, as described above. This wasn’t happening a few weeks ago.

From what I can tell, the issue isn’t specific to multicity searches but affects other types too. This makes the tool almost useless, as the results being returned - although valid selections - have huge price discrepancies of what Google Flights actually displays.

And it looks like Serp can return more than one option per airline: Image

^returns two AA results priced at 503

Stedelmanto avatar Feb 19 '25 19:02 Stedelmanto

@Stedelmanto Thank you for providing your input. Your feedback and points are very helpful. Our team will take this into account when finding and implementing a fix for this.

Can you please share an example (like a playground link or search ID) where you are seeing incorrect results for non multi city trips? This might help in investigating this issue further.

sonika-serpapi avatar Feb 20 '25 01:02 sonika-serpapi

@sonika-serpapi I've been testing but haven't been able to replicate the incorrect results for non-multi-city searches. The rest still holds, but I'll update here if I come across the issue again for non-multi-city.

Stedelmanto avatar Feb 25 '25 14:02 Stedelmanto

I came across an interesting result I wanted to share.

I know that Google's search algorithm sometimes ignores certain routes when optimizing searches. Here’s what I found:

When I search for a multi-city itinerary: GRU → DFW → LAX The following flight appears (Search ID: 67c393bb599d681389f6c943) at a price of $303.

Image

However, when I expand the same search by adding more airports: GRU → DFW → LAX/ORD/IAD/IAH (Search ID: 67c396163d251083fa8dcd60), SERP does not return the same $303 flight found in the "simpler" original search.

At first, I thought this was due to Google's optimization algorithm overlooking that route when having multiple arrival airports. But after manually checking the Google Flights link that SERP returns for the second search, I found that it does display the same $303 flight - meaning that serp is the one not retrieving that flight. Not sure if having multiple arrival/departure airports somehow causing this.

google flights link associated with 1st search:

google flights link associated with 2nd search:

Stedelmanto avatar Mar 01 '25 23:03 Stedelmanto

HI, @Stedelmanto. Thank you for sharing your findings. We'll take it intro consideration. cc @zyc9012 for visibility.

hilmanski avatar Mar 02 '25 21:03 hilmanski

A potential customer reported this.

Inspect

However, I'm able to see, even though only one time, that Google Flights itself returned a similar result as we did. So it could just be the behavior of Google Flights itself.

First try, got similar result

Image

2nd try, got more results

Image

Intercom

hilmanski avatar Mar 11 '25 02:03 hilmanski

The customer above also reported another similar issue:

Inspect

Our API response: Image

Google Flights page has a lot more airline options:

Image

sonika-serpapi avatar Mar 13 '25 21:03 sonika-serpapi

Received another report of this. The customer noted an airline that appeared in results on actual Google Flights, but not through our API. Their original request didn't include deep_search, however I tried adding deep_search=true and got the same results.

The customer was also searching manually from Colombia with COP as the currency, but with US localization through our API. I tried both US and Colombian localization params in our API, and results were the same aside from the change in currency.

Actual Google Flights:

Image

Our results:

Image

Inspect USD Inspect COP

Intercom

alexbarron avatar Apr 02 '25 15:04 alexbarron

Received another potential report of this. In this case, searching in Google Flights in the browser returns two results, but our API returns empty:

Playground | Inspector | Intercom

schaferyan avatar Apr 21 '25 18:04 schaferyan

This morning a potential customer reached out after creating this issue.

After some further investigation, it seems that there is some strange behaviour on Google Flights' end, where the prices for Air India are not being displayed on initial load. However, after interacting with the UI and toggling between flight dates, the previously-searched flight will now have the price displayed (while the flight for the next day shows: "Price unavailable" until reload).

I have captured this behaviour in the following gif:

Image

Our API does not return the price information for Air India flights, as a result.

Playground | Inspector | Intercom

oceansize avatar May 02 '25 12:05 oceansize

Are there any updates or estimates on when this will be fixed? Noticed #2680 was opened and might be tangentially related.

Unfortunately I will need to pause my SERP subscription because of this issue - for my specific use case the scraping becomes useless with the bug described in this ticket.

Stedelmanto avatar May 11 '25 15:05 Stedelmanto

Hi @Stedelmanto , unfortunately, we don't have any ETA to share. We can totally understand if you want to pause your subscription first, just let us know via [email protected].

We'll also reach out once we've deployed a fix for this issue.

hilmanski avatar May 11 '25 23:05 hilmanski

We've released a fix for this. deep_search parameter works now.

SerpApi search:

Image

Google Flights search:

Image

zyc9012 avatar May 14 '25 10:05 zyc9012

@Stedelmanto tagging you for visibility. I hope the fix works on your end as well. Thank you very much for your patience.

hilmanski avatar May 14 '25 22:05 hilmanski