FX-Port API
FlightsFlight Search

POST /api/v1/get_flights

Search for flights across one, several, or every enabled supplier. Start here, then expand the examples by route, passenger, filter, supplier, or itinerary type.

Search available flight offers across one, several, or every enabled supplier. Results are grouped under suppliers[]; each supplier has its own searchId and offer list.

Permission: Read

Save the supplier-level searchId. Pass suppliers[n].searchId to price_flight and book_flight — never the top-level requestId.

Request fields

Route

FieldTypeRequiredDescription
originstringYes¹Departure IATA code (ALG, CAI, LHR)
destinationstringYes¹Arrival IATA code
departure_datestringYes¹YYYY-MM-DD
return_datestringNoAdd for a round trip
segmentsarrayNo²Exactly two open-jaw legs: { origin, destination, date }
¹ Simple one-way/round-trip only. ² Use exactly two segments for open-jaw.

Passengers and cabin

FieldTypeRequiredDescription
passengersobjectYesCounts and age arrays; see Flight passengers & ages
cabin_classstringNoeconomy (default), premium_economy, business, first, any

Filters

FieldTypeDescription
directbooleantrue → non-stop offers only (alias: nonstop)
refundablebooleantrue → refundable offers only when supported
checked_bagsbooleantrue → offers that include checked baggage
max_pricenumberMaximum total price in the agency currency
included_airlinesstring[]Strict airline allow-list
excluded_airlinesstring[]Strict airline block-list
preferred_airlinesstring[]Prioritise these carriers without a strict allow-list
from_ccstringOrigin market, ISO 3166-1 alpha-2
to_ccstringDestination market, ISO 3166-1 alpha-2
flexiblebooleanRequest flexible dates from capable suppliers; regular offers still return

Supplier selection

FieldTypeBehaviour
(omit selectors)Recommended. FX-Port selects compatible enabled suppliers automatically.
supplier_idstringAdvanced: restrict the search to one exact supplier ID.
supplier_idsstring[]Advanced: restrict the search to an exact supplier set.

Usually, omit all supplier fields and let FX-Port manage selection. For the special case “use exactly 2 of our 5 suppliers”, send supplier_ids: ["supplier_a", "supplier_b"]. The backend calls enabled suppliers in parallel. Unknown, disabled, or flexible-incompatible strict selections return HTTP 400. Traveler-incompatible suppliers are skipped silently; HTTP 400 is returned only when no selected supplier remains compatible.

Examples by category

Minimal request

curl --request POST \
  --url https://api.fx-port.com/api/v1/get_flights \
  --header 'Authorization: Bearer fxp_live_YOUR_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "origin": "ALG",
    "destination": "CDG",
    "departure_date": "2026-09-15",
    "cabin_class": "economy",
    "passengers": { "adults": 1 }
  }'

Response essentials

{
  "success": true,
  "suppliers": [
    {
      "success": true,
      "searchId": "fs_9fa52bad-a7be-42aa-9ad6-d3f9fa642dc3",
      "supportHold": true,
      "results": {
        "totalOffers": 12,
        "offers": [
          {
            "id": "fx_offer_a1b2c3d4",
            "pricing": {
              "supplierCurrency": "DZD",
              "agencyCurrency": "DZD",
              "basePrice": 18800.0,
              "taxesAndFees": 9726.17,
              "agencyCommission": 0.0,
              "finalPrice": 28526.17,
              "b2bPrice": 28526.17
            }
          }
        ]
      },
      "meta": {
        "supplierId": "amadeus_aqc_dz_1",
        "supplierName": "Amadeus Algeria",
        "processingTime": 1.32
      }
    }
  ]
}

Save these values

ValueLocationUsed by
searchIdsuppliers[n].searchIdRequired price_flight.search_id, then booking
offer idsuppliers[n].results.offers[m].idRequired price_flight.offer_id, then booking
supportHoldSupplier and priced offerUse hold only when still true after pricing

On this page