serpapi / public-roadmap

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

[Google Flight API] Issues with airline filtering #1645

Closed corear closed 3 weeks ago

corear commented 1 month ago

Two issues I've just noticed when adding both include_airlines and exclude_airlines parameters to Google Flight API requests:

  1. Adding any of the 3 suggested alliances resulted in the following error being shown and the search not executing:
    {
    "error":
    "`include_airlines`: "ONEWORLD" is not a 2-character IATA code consisting of either two uppercase letters or one uppercase letter and one digit."
    }
  2. Adding any airline to the filter looks for flights with ONLY that airline, not flights apart of their ecosystem (for example, a search for Delta flights on Google Flights returns some results mixed in with Air France flights, while applying that same filter on the playground would return 0 flights) Google Flights: image

    SerpApi Playground:

    image
zyc9012 commented 4 weeks ago

Thank you for your report @corear. We are looking into it.

marm123 commented 4 weeks ago

Thank you for opening the thread @corear ! While we're still investigating the first issue you reported, it looks like in the 2nd issue you used an incorrect IATA code for Delta. According to Airline and Airport Code Search, the correct code is DL, not DA. Please check the screenshot below:

image

Checking the Playground with DL, it looks like there are results returned for these parameters, similar to how Google Flights displays them:

Playground:

image

Google Flights:

image

Let me know if that solves the 2nd issue.

corear commented 3 weeks ago

@marm123 Thanks for the quick response! I tried to use "Delta" in the second screenshot because nothing was returning for "DL", but it looks like results are returning today for each airline code, so no worries on the 2nd issue!

zyc9012 commented 3 weeks ago

We've released a fix for this.

Now using alliances STAR_ALLIANCE, SKYTEAM and ONEWORLD won't show error.

image