Getting Started with the Xeni Activities APIHow to Book an ActivityHow to Browse Activity Tags and CategoriesHow to Cancel an Activity BookingHow to Check Activity AvailabilityHow to Get Activity DetailsHow to Retrieve Activity Booking DetailsHow to Search for Activities with FiltersHow to Search for Activity DestinationsCar Rental API - Getting StartedCar Rental API - Understanding Response FieldsHow to Book a Car RentalHow to Get Rental Car Details and Equipment Add-OnsHow to Retrieve or Cancel a Car Rental BookingHow to Search for Available Rental CarsHow to Search for Pickup LocationsHow to Use Car Rental Search FiltersDeals API Best Practices for IntegrationDeals API Frequently Asked QuestionsGetting Started with the Xeni Deals APIDeals API Request Parameters and Headers ReferenceDeals API Supported Currencies and LocalizationHow to Display Deals in Your ApplicationHow to Fetch Hotel Deals by LocationFlights API Error Codes and TroubleshootingGetting Started with the Xeni Flights APIHow to Book a FlightHow to Check Flight Availability and PricingHow to Confirm or Cancel a Flight BookingHow to Retrieve Fare Rules for a FlightHow to Retrieve Flight Booking DetailsHow to Search for Airports Using AutocompleteHow to Search for FlightsHow to Use Flight Search Filters, Sorting, and PaginationHow to Check Room Availability and PricingHow to Filter Vacation Rental ResultsHow to Get Resort Property Details, Amenities, and AccessibilityHow to Hold and Confirm a Resort BookingHow to Release a Resort HoldHow to Retrieve Resort Booking DetailsHow to Search for Available ResortsHow to Search for Resort DestinationsHow to Search for Vacation Rental LocationsHow to Search for Vacation RentalsHow to Use Resort Search Filters and SortingGetting Started with the Xeni Resorts APIResorts API: Understanding Booking Statuses and PoliciesGetting Started with the Vacation Rentals APIVacation Rentals Frequently Asked QuestionsVacation Rentals Supported Property TypesUnderstanding Async Search for Vacation RentalsAuthentication & API SignaturesBooking Hotels — Direct API & SSO CheckoutError Handling, Rate Limits & Best PracticesGetting Started with the Xeni Hotels APIManaging Bookings: Status, Retrieval & CancellationPricing Confirmation & Token LifecycleRetrieving Hotel Details & Room AvailabilitySearching for Hotels: Locations, Filters & PaginationSearching for HotelsSession Management & Correlation IDsAPI authentication and getting your API keys

How to Search for Airports Using Autocomplete

Last updated: 2026-03-03

How to Search for Airports Using Autocomplete

The autocomplete endpoint is the first step in the Flights API booking flow. Use it to resolve airport names or IATA codes into structured airport data. The response headers include an x-correlation-id that you must capture and pass to all subsequent API calls.

Endpoint

GET /flights/api/v2/autocomplete?key={search_term}

Headers

HeaderRequiredDescription
x-api-keyYesYour API key.

Query Parameters

ParameterTypeRequiredDescription
keystringYesAirport name, city name, or IATA code to search for. Minimum 2 characters recommended.

Example Request

GET /flights/api/v2/autocomplete?key=SFO

Example Response

JSON
{
  "status": "success",
  "data": [
    {
      "airport_code": "SFO",
      "airport_name": "San Francisco International Airport",
      "city_code": "SFO",
      "city_name": "San Francisco",
      "country_code": "US",
      "country_name": "United States"
    }
  ],
  "message": "Airports retrieved successfully"
}

Response Fields

FieldTypeDescription
statusstringRequest status (success or error).
dataarrayList of matching airport objects.
data[].airportcodestringIATA airport code (e.g., SFO).
data[].airportnamestringFull airport name.
data[].citycodestringIATA city code.
data[].citynamestringCity name.
data[].countrycodestringISO country code.
data[].countrynamestringFull country name.
messagestringHuman-readable status message.

Capturing the Correlation ID

The autocomplete response includes an x-correlation-id in the response headers. You must capture this value and include it as a header in all subsequent requests (search, availability, fare rules, and booking).

Response Headers:
x-correlation-id: abc123-def456-ghi789

Store this value and pass it as:

x-correlation-id: abc123-def456-ghi789

in the headers of your next API call.

Error Responses

HTTP StatusDescription
400Invalid or missing key parameter.
500Internal server error. Retry the request or contact support.

Tips

  • Search by IATA code (e.g., SFO, LAX, BLR) for the most precise results.
  • Search by city name (e.g., San Francisco, London) to return all airports in that city.
  • The x-correlation-id is essential. Without it, the search endpoint will reject your request.

Next Steps

Was this article helpful?