Basic route examples
One-way, round-trip, direct-only and all-supplier flight searches, with real request and response examples.
Four common searches, each with its request and, where it teaches something, the real response. The full field reference of the response is in Search flights. All examples were run on the sandbox on 2026-11-01 and trimmed for length, not invented. Dates are examples: use a date from yesterday up to 365 days ahead.
One-way economy
curl https://api.fx-port.com/api/v1/get_flights \
-H "Authorization: Bearer fxp_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"origin": "ALG",
"destination": "ORY",
"departure_date": "2026-12-15",
"cabin_class": "economy",
"passengers": {
"adults": 1
}
}'A one-way search returns searchType: "ONE_WAY", and each offer has exactly one itinerary entry with direction: "outbound". Airports in the same city are separate codes: ALG to ORY and ALG to CDG are different searches. A city code searches all the airports of the city: ALG to PAR returned offers to both CDG and ORY from both sandbox suppliers.
Round-trip economy
Add return_date. The two dates must be in order (return_before_departure otherwise).
curl https://api.fx-port.com/api/v1/get_flights \
-H "Authorization: Bearer fxp_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"origin": "ALG",
"destination": "CDG",
"departure_date": "2026-12-15",
"return_date": "2026-12-22",
"cabin_class": "economy",
"passengers": {
"adults": 2
}
}'Response example
The search returns searchType: "ROUND_TRIP". Each offer has two itinerary entries (outbound and return), and travelerPricing has one entry per priced traveler: here two adults. This is one non-stop Duffel offer; the segments are shortened to the airports, times and flight (departure, arrival and flight are objects with more keys: see the full offer):
{
"id": "fx_offer_cbeb029c",
"pricing": {
"supplierCurrency": "USD",
"agencyCurrency": "DZD",
"basePrice": 52652.5,
"taxesAndFees": 16252.7,
"agencyCommission": 68.92,
"finalPrice": 68974.12,
"b2bPrice": 68905.2,
"additionalServices": []
},
"itinerary": [
{
"direction": "outbound",
"duration": "PT2H24M",
"stops": 0,
"segments": [
{
"departure": { "airportCode": "ALG", "datetime": "2026-12-15T10:50:00" },
"arrival": { "airportCode": "CDG", "datetime": "2026-12-15T13:14:00" },
"flight": { "carrierCode": "ZZ", "flightNumber": "7426" },
"cabin": "ECONOMY"
}
]
},
{
"direction": "return",
"duration": "PT2H24M",
"stops": 0,
"segments": [
{
"departure": { "airportCode": "CDG", "datetime": "2026-12-22T16:15:00" },
"arrival": { "airportCode": "ALG", "datetime": "2026-12-22T18:39:00" },
"flight": { "carrierCode": "ZZ", "flightNumber": "7426" },
"cabin": "ECONOMY"
}
]
}
],
"travelerPricing": [
{
"travelerId": "pas_0000BC0c76NFZS74iWWDfD",
"travelerType": "ADULT",
"price": { "supplierCurrency": "USD", "agencyCurrency": "DZD", "base": 26326.25, "total": 34487.06, "b2bPrice": 34452.6 }
},
{
"travelerId": "pas_0000BC0c76NbY8OejcgVCi",
"travelerType": "ADULT",
"price": { "supplierCurrency": "USD", "agencyCurrency": "DZD", "base": 26326.25, "total": 34487.06, "b2bPrice": 34452.6 }
}
]
}Each traveler's price.total adds up to the offer's pricing.finalPrice (34,487.06 × 2 = 68,974.12). The same route and dates for one adult returned 736 offers from two suppliers (265 from Amadeus Algeria, 471 from Duffel); with two adults on Duffel alone, 441.
A round trip is one booking and one fare: the offer prices both directions together. To combine two one-way fares, search twice and book twice.
Non-stop only
nonstop: true becomes a zero-stop filter at the supplier. Both sandbox suppliers honour it. (direct is the legacy name of the same field.)
curl https://api.fx-port.com/api/v1/get_flights \
-H "Authorization: Bearer fxp_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"origin": "ALG",
"destination": "ORY",
"departure_date": "2026-12-15",
"cabin_class": "economy",
"passengers": {
"adults": 1
},
"nonstop": true
}'Every returned offer has itinerary[n].stops: 0 in each direction, and results.totalOffers counts only non-stop offers: smaller than the same search without the filter. There is no way to ask for stops: 1 or stops: 2 with the fields above; filter itinerary[n].stops on your side.
Every compatible supplier
Omit every supplier selector. FX-Port selects the suppliers that can serve the route and the passenger mix, calls them in parallel and returns each answer under its own searchId. New suppliers join automatically when FX-Port enables them.
curl https://api.fx-port.com/api/v1/get_flights \
-H "Authorization: Bearer fxp_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"origin": "ALG",
"destination": "CDG",
"departure_date": "2026-12-15",
"return_date": "2026-12-22",
"cabin_class": "economy",
"passengers": {
"adults": 1
}
}'suppliers[] has one entry per supplier that answered: read suppliers[n].success and suppliers[n].meta.supplierId to see who returned offers for this route, dates and passengers, and failures[] for the ones that did not. On the sandbox this route calls amadeus_aqc_dz_1 (only because the route touches Algeria) and duffel_1; LHR to CDG calls Duffel alone. See Supplier selection.
Related
- Search flights: the fields and the response.
- Passengers and cabins, Filters and Open-jaw and multi-city.
- Streaming search results: the same search, supplier by supplier.