DATE:
AUTHOR:
The Duffel team
API

You can now paginate through offers from a search instead of getting them all in one go

DATE:
AUTHOR: The Duffel team

When you search for flights by creating an offer request, we return all of the offers in the response. This can mean a very large response in some cases, with thousands of offers.

You can now choose to paginate through those offers, a few hundred at a time, instead of having one massive response.

To do this, you should specify the return_offers=false query string parameter when creating your offer request, and then you can use the "Get a list of offers" API, filtered by the offer_request_id, to see all of the offers returned by your search.

You can optionally sort these offers using the sort parameter, and specify the maximum number of stops you're willing to accept with the max_connections parameter.

This allows you to keep the response sizes smaller, and to manage your memory more efficiently.

Powered by LaunchNotes