> ## Documentation Index
> Fetch the complete documentation index at: https://enhancedradar.com/docs/api/llms.txt
> Use this file to discover all available pages before exploring further.

# Search facilities

> Returns the airports, TRACONs, and centers that best match a code or name, best match first.

Returns the facilities that best match a code or name, best match first. Unlike [List facilities](https://enhancedradar.com/docs/api/docs/api/api-reference/facilities/list.md), it searches every facility we know about, including airports we do not cover, and returns no channels.

Accepts the `api:onboarding` permission as well as `api:read`.

## Query parameters

**q** `string` *required*

Text to match, at most 100 characters. Case-insensitive. Matches the start of an airport's ICAO, IATA, or FAA code, a TRACON or center code, or the start of any word in a facility's name or an airport's city.

Punctuation is ignored: apostrophes and periods are dropped, so `ohare` matches `O'Hare` and `st louis` matches `St. Louis`, and other punctuation separates words, so `wilkes barre` matches `Wilkes-Barre`.

**facility\_type** `string`

`airport`, `tracon`, or `center`. Only facilities of that type are returned.

**limit** `integer` (default: 10)

Number of results, 1 to 25.

## Response

**facilities** `array`

The matching facilities, best match first.

**facility**

**facility\_id** `string`

Unique id of the facility. Pass it as `facility_id`, or as `primary_airport_facility_id` when saving an onboarding profile.

**facility\_type** `string`

`airport`, `tracon`, or `center`.

**facility\_code** `string`

Airport display code such as `SFO`, or the TRACON or center code such as `N90` or `ZAU`.

**facility\_name** `string`

Name of the facility.

**airport\_municipality** `string | null`

The airport's city. `null` for TRACONs and centers, and for airports without one.

## Ranking

Results are ranked by how the query matched:

1. An exact ICAO, IATA, FAA, TRACON, or center code.
2. The start of an IATA, FAA, TRACON, or center code.
3. The start of any word in the facility's name, alternate name, or city.
4. The start of an ICAO code only.

Within each group, US facilities come before others, then large airports before medium and small ones. In group 3, a name or city that starts with the query then comes before one where a later word does, so `san francisco` returns San Francisco International before Oakland San Francisco Bay. Remaining ties are ordered by name.

New facilities can take up to 15 minutes to appear.

## Billing

Free. See [Pricing](https://enhancedradar.com/docs/api/docs/api/pricing.md).

```bash cURL theme={null}
curl -H "Authorization: Bearer $ER_API_KEY" \
  "https://api.enhancedradar.com/api/v0/facilities/search?q=san&facility_type=airport&limit=3"
```

```json 200 theme={null}
{
  "facilities": [
    {
      "facility_id": "3667d976-1566-4887-ae34-c024d92f46c7",
      "facility_type": "airport",
      "facility_code": "SFO",
      "facility_name": "San Francisco",
      "airport_municipality": "San Francisco, CA"
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.