# Get the most searched airports

> The most searched airports, for the first suggestions of an empty search box before the user types anything.

Endpoint: `GET /flights/top-airports`

Source: https://fx-port.com/docs/api/top-airports

`GET /api/v1/flights/top-airports`

No API key is needed to call this endpoint.

No key is needed. `airport_type` chooses the ranking: `from` for departure airports (the default) or `to` for arrival airports. Add `market_region`, a country code, to rank for one market. Each airport has the fields of the airport lookup plus `popularity_score`, `popularity_scopes` (the `locale` and `global` scores), `recent_score` and `last_seen_day`. Without a key `environment` is always `live`.

## Request

### Query parameters

- `airport_type` (string, optional): `from` for departure airports or `to` for arrival airports. One of `from`, `to`. Default `from`.
- `locale` (string, optional): The language of the names, read as for the airport lookup. Default `en`.
- `limit` (integer, optional): How many airports, 1 to 10. Between 1 and 10. Default `5`.
- `market_region` (string, optional): A country or region code (`DZ`, `FR`): ranks the airports for one market first. Also accepted as `market_country`.

### Example request

```bash
curl 'https://api.fx-port.com/api/v1/flights/top-airports?airport_type=to&locale=en&limit=1'
```

## Response

### 200: The airports and what the ranking used.

- `environment` (string): The environment of the key that made the call: `sandbox` for fxp_test_ keys, `live` for fxp_live_ keys. Present in every JSON body. One of `sandbox`, `live`.
- `airports` (array of object): The most searched airports, most searched first. Each record has the fields of an airport plus `payload_locale`, `popularity_score`, `popularity_scopes` (`locale` and `global`), `recent_score` and `last_seen_day`.
  - `ap` (string): The IATA code: use it as `origin` or `destination` in a search.
  - `airportname` (string): The airport name in the requested locale.
  - `cityname` (string): City and country in the requested locale.
  - `cityonly` (string): The city alone.
  - `cc` (string): ISO 3166-1 alpha-2 country code.
  - `country` (string): The country name.
  - `timezone` (string): The IANA time zone.
  - `utc` (string): The UTC offset at the time of the query.
  - `lat` (number): Latitude.
  - `lng` (number): Longitude.
  - `displayname` (string): A full label for a result list.
  - `shortdisplayname` (string): A short label for the selected value.
  - `loctype` (string): `ap` for an airport, `city` for a city.
  - `isMetroOnly` (boolean): `true` for a city code that stands for all the airports of a city (`PAR`): valid as an `origin` or `destination`.
- `context` (object): What the ranking used.
  - `locale` (string): The language of the names, normalised.
  - `airport_type` (string): Which ranking was used. One of `from`, `to`.
  - `agency_id` (string, nullable): An internal ranking scope of FX-Port's own apps: `null` in your answers.
  - `market_region` (string, nullable): The `market_region` you sent, in upper case; `null` when you sent none.

```json
{
  "environment": "live",
  "airports": [
    {
      "ap": "JED",
      "airportname": "King Abdulaziz Intl",
      "cityname": "Jeddah, Saudi Arabia",
      "cityonly": "Jeddah",
      "cc": "SA",
      "country": "Saudi Arabia",
      "timezone": "Asia/Riyadh",
      "utc": "+03:00",
      "lat": 21.66982,
      "lng": 39.15052,
      "displayname": "King Abdulaziz Intl, Jeddah, Saudi Arabia, (JED)",
      "shortdisplayname": "Jeddah, Saudi Arabia (JED)",
      "loctype": "ap",
      "isMetroOnly": false,
      "payload_locale": "en",
      "popularity_score": 366.667,
      "popularity_scopes": {
        "locale": 25.54597518549043,
        "global": 97.28943021306868
      },
      "recent_score": 242,
      "last_seen_day": "2026-11-01"
    }
  ],
  "context": {
    "locale": "en",
    "airport_type": "to",
    "agency_id": null,
    "market_region": null
  }
}
```

## Errors

| Status | Code | Example message |
| --- | --- | --- |
| 422 | `validation_error` | Input should be 'from' or 'to' |

See [Errors](https://fx-port.com/docs/errors.md) for every code and how to react.

## Related guides

- [Search airports](https://fx-port.com/docs/flights/airports.md#top-airports)
