Skip to content

[Google Flights API] Empty results returned for second leg of flights when non stop option is chosen and selected flight from previous leg has a layover #2322

@sonika-serpapi

Description

@sonika-serpapi

The next leg options are shown empty when stops are set to Nonstop only - 1 and the selected flight for the previous leg has a layover.

When the departure_token for these layover flights is used to get the next leg along with the stops set to non stop, it results in empty results via our API, even though Google Flights actually shows flight availability for the next leg.

This is probably why for some departure tokens, I am able to see next leg availability, but not for others.

Search one: https://serpapi.com/searches/67899651bb5bfc810cd3d601/inspect
[Or see playground 1]
Image

From this first search we get the departure token:
WyJDalJJVkcxQldWQnNlVGhVWW10QlFWaG1jWGRDUnkwdExTMHRMUzB0TFMxMmRIVjRPVUZCUVVGQlIyVktiR3hKUkZOR2NtTkJFZzA1U3pFd01qbDhPVXN4TURJeUdnc0lsTThDRUFJYUExVlRSRGdjY0pUUEFnPT0iLFtbIkJPUyIsIjIwMjUtMDEtMTkiLCJTTEsiLG51bGwsIjlLIiwiMTAyOSJdLFsiU0xLIiwiMjAyNS0wMS0xOSIsIkpGSyIsbnVsbCwiOUsiLCIxMDIyIl1dXQ==

Then run search number 2 with the departure token above and stops set to Nonstop only - 1.
https://serpapi.com/searches/6789965206e745868ce7f1c7/inspect
[Or see playground 2]
Image

This results in empty results even though Google has results available.
Google results:
https://www.google.com/travel/flights/search?tfs=CBwQAhprEgoyMDI1LTAxLTE5IiAKA0JPUxIKMjAyNS0wMS0xORoDU0xLKgI5SzIEMTAyOSIgCgNTTEsSCjIwMjUtMDEtMTkaA0pGSyoCOUsyBDEwMjJqBwgBEgNCT1NqBwgBEgNEQ0FyBwgBEgNKRksaHhIKMjAyNS0wMS0yMGoHCAESA0pGS3IHCAESA0xBWBonEgoyMDI1LTAxLTI4agcIARIDTEFYcgcIARIDU0ZPcgcIARIDQUJMQAFIAXABggELCP___________wGYAQM&tfu=CnhDalJJZFMxSmFqWkhNRUZLZUd0QlFXWmFjWGRDUnkwdExTMHRMUzB0Y0dwaWFXd3hNRUZCUVVGQlIyVktiM3BGVEdRMFdXdEJFZzA1U3pFd01qbDhPVXN4TURJeUdnc0lsTThDRUFJYUExVlRSRGdjY0pUUEFnPT0SAggAIgA&hl=en&gl=us&curr=USD

Image

Public links: Playground 1 | Playground 2

This issue seems specific to Non stop flights, 1 stop of fewer, and other options for stops seem to be working fine.

Internal links: Intercom | Search Inspect 1 | Search Inspect 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions