# Searching airports

## Search for airports using a text query or additional options and filters.

<mark style="color:blue;">`GET`</mark> `https://api.aviowiki.com/airports/search`

This endpoint allows you to conduct an airport search using a free-text query string. It further allows to restrict the search results to certain locations based on filters passed as query parameters.

#### Query Parameters

| Name                | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| query               | String  | The query string (name, city etc.) you want to look for.                                                                                                                                                                                                                                                                                                                                              |
| page                | Number  | The page number for pagination, starting from `0` to indicate the first page. Default: `0`                                                                                                                                                                                                                                                                                                            |
| size                | Number  | The number of results in a page, for pagination. Default: `10`                                                                                                                                                                                                                                                                                                                                        |
| types               | List    | <p>A comma-separated list of <a href="#undefined">airport</a> types to return. Possible options are <code>AIRPORT</code>, <code>HELIPORT</code>, <code>AIRSTRIP</code>, <code>WATER</code>.</p><p>If set it limits the returned locations to those with matching types in the <code>type</code> field.</p>                                                                                            |
| accepts             | List    | <p>A comma-separated list of the accepted types of traffic. Possible options are <code>SCHEDULED</code>, <code>NON\_SCHEDULED</code>, <code>GENERAL\_AVIATION</code>, <code>TRAINING</code>, <code>BUSINESS\_AVIATION</code>, <code>MILITARY</code>, <code>HELICOPTER</code>.</p><p>If set it limits the returned locations to those with matching types in the <code>accessibleFor</code> field.</p> |
| requiresPermission  | Boolean | <p>If set to <code>true</code>, returns locations that have any value in <code>nonScheduledPermission</code> except for <code>NONE</code> or <code>null</code>.</p><p>If set to <code>false</code>, returns location that have only <code>NONE</code> or <code>null</code> as <code>nonScheduledPermission</code>.</p>                                                                                |
| isVfr               | Boolean | <p>If set to <code>true</code>, returns locations that allow VFR traffic.</p><p>If set to <code>false</code>, returns locations that </p>                                                                                                                                                                                                                                                             |
| regions             | List    |                                                                                                                                                                                                                                                                                                                                                                                                       |
| country             | String  |                                                                                                                                                                                                                                                                                                                                                                                                       |
| countries           | List    |                                                                                                                                                                                                                                                                                                                                                                                                       |
| governingDistrict   | String  |                                                                                                                                                                                                                                                                                                                                                                                                       |
| minimumRunwayLength | Double  | <p>Minimum runway TORA the returned airports need to have. <br>If set, it limits the returned locations to those that have at least one runway with TORA at least <code>minimumRunwayLength</code>.</p>                                                                                                                                                                                               |
| maximumRunwayLength | Double  | <p>Maximum TORA the returned airports need to have. <br>If set, it limits the returned locations to those that's runways have TORA at most <code>maximumRunwayLength</code>.</p>                                                                                                                                                                                                                      |
| minimumRunwayWidth  | Double  | <p>Minimum runway width the returned airports need to have. <br>If set, it limits the returned locations to those that have at least one runway with width at least <code>minimumRunwayWidth</code>.</p>                                                                                                                                                                                              |
| maximumElevation    | Double  | <p>Maximum elevation the returned airports need to have.<br>If set, it limits the returned locations to those that have elevation at most <code>maximumElevation</code>.</p>                                                                                                                                                                                                                          |
| latitude            | Double  | Latitude of the reference point to search locations around.                                                                                                                                                                                                                                                                                                                                           |
| longitude           | Double  | Longitude of the reference point to search locations around.                                                                                                                                                                                                                                                                                                                                          |
| distance            | Double  | Maximum great circle distance in kilometers the returned locations need to be from the reference point set by the `latitude` and `longitude` parameters. Default: `100`                                                                                                                                                                                                                               |

#### Headers

| Name                                            | Type   | Description                              |
| ----------------------------------------------- | ------ | ---------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | An API Token using Bearer authorization. |

{% tabs %}
{% tab title="200: OK Paginated airport list" %}
Detailed properties of the pagination can be found at [Pagination](/conventions/pagination.md).&#x20;

Properties of the contained airports:

{% tabs %}
{% tab title="Response properties" %}

{% endtab %}

{% tab title="Example response" %}

```
{
	"page": {
		"number": 0,
		"size": 10,
		"totalPages": 1,
		"totalResults": 1
	},
	"content": [
		{
			"name": "John F. Kennedy International ",
			"country": {
				"iso2": "US",
				"iso3": "USA",
				"isoNumeric": 840,
				"name": "United States",
				"officialName": "United States of America",
				"localIdentifierName": null
			},
			"timeZone": "America/New_York",
			"aid": "APT-KS1J-8E0L",
			"coordinates": {
				"latitude": 40.6399278,
				"longitude": -73.7786944
			},
			"icao": "KJFK",
			"iata": "JFK",
			"localIdentifier": "JFK",
			"servedCityGoverningDistrict": {
				"code": "US-NY",
				"name": "New York",
				"administrativeType": "State"
			},
			"servedCity": "New York",
			"elevation": 3.96,
			"longestRunwayLength": 3800.25,
			"widestRunwayWidth": 60.96,
			"openingIndicator": "OPEN",
			"icon": "CIVIL",
			"distanceFromSearchCoordinates": null,
			"operationalStatus": null
		}
	]
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="403: Forbidden No API token was provided or it was invalid." %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

<table data-header-hidden><thead><tr><th width="228.87373263824156">Property</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Property</td><td>Type</td><td>Description</td></tr><tr><td><code>aid</code></td><td>String</td><td><a href="/pages/-MSK0yT0xbFHC0I8opdb">Aviowiki ID</a> of the airport, with <code>APT</code> as namespace</td></tr><tr><td><code>name</code></td><td>String</td><td>The name of the airport. This should be the official name of the airport written in Latin characters.</td></tr><tr><td><code>country</code></td><td><a href="/pages/-MUP3Jkil0DeGQKvY9rY">Country</a></td><td>A <a href="/pages/-MUP3Jkil0DeGQKvY9rY">Country</a> object which represents the country at which an airport is located.</td></tr><tr><td><code>timeZone</code></td><td>String</td><td>The time-zone of the airfield as noted in the <a href="https://en.wikipedia.org/wiki/Tz_database">IANA Time Zone Database</a>.<br>Defaults to <code>null</code> when this information is not available.</td></tr><tr><td><code>coordinates</code></td><td><a href="/pages/-MUP3HHnqurT_QdZAc3T">Coordinates</a></td><td> <a href="/pages/-MUP3HHnqurT_QdZAc3T">Coordinates</a> object which represents the location of the <a href="https://en.wikipedia.org/wiki/Airport_reference_point">Aerodrome Reference Point</a>.<br>Defaults to <code>null</code> if the information is not known.</td></tr><tr><td><code>icao</code></td><td>String</td><td>A string with the 4-letters ICAO code of the airport, or <code>null</code> if none is assigned</td></tr><tr><td><code>iata</code></td><td>String</td><td>A string with the 3-letters IATA code of the airport, or <code>null</code> if none is assigned.</td></tr><tr><td><code>localIdentifier</code></td><td>String</td><td>An identifier issued by the local authority, which is not recognised as an official ICAO or IATA code.<br>The name of the code for each country can be found in <code>Country.localIdentifierName</code></td></tr><tr><td><code>servedCityGoverningDistrict</code></td><td><a href="/pages/-MUP3MbAxRd8xQy0tsME">Governing District</a></td><td><p>A <a href="/pages/-MUP3MbAxRd8xQy0tsME">Governing District</a> object indicating the Governing District of the <code>servedCity</code>.</p><p></p><p>Defaults to <code>null</code> when the information is not known.</p></td></tr><tr><td><code>servedCity</code></td><td>String</td><td><p>A string containing the name of the city served by the airport.</p><p><br>Defaults to <code>null</code> when the information is not known.</p></td></tr><tr><td><code>elevation</code></td><td>Decimal</td><td>A decimal number representing the elevation of the airport expressed in meters. Two decimal positions are provided, for precise conversion to feet.<br><br>Defaults to <code>null</code> when the information is not known.</td></tr><tr><td><code>longestRunwayLength</code></td><td>Decimal</td><td>Longest runway length expressed in meters with precision up to two decimal positions.<br><br>Defaults to <code>null</code> when this information is not available.</td></tr><tr><td><code>widestRunwayWidth</code></td><td>Decimal</td><td>The widest runway width expressed in meters with precision up to two decimal positions.<br><br>Defaults to <code>null</code> when this information is not available.</td></tr><tr><td><code>openingIndicator</code></td><td>String</td><td>Opening indicator flag taking into consideration the 4 types of airport availability. For details see <a href="/pages/-MUP3E2gh6HIUla58k7Q#the-openingindicator-flag">opening indicator</a> section.<br>Available values: <code>OPEN</code>, <code>SEE_TIMES</code>, <code>CLOSED</code>, <code>UNKNOWN</code><br><br>Defaults to <code>null</code> when this information is not available.</td></tr><tr><td><code>distanceFromSearchCoordinates</code></td><td>Decimal</td><td>Distance from the search coordinates given in the query expressed in kilometers with precision up to two decimal positions.<br><br>Defaults to <code>null</code> when no search coordinates were given in the query.</td></tr><tr><td><code>operationalStatus</code></td><td>String</td><td>Worst criticality of the valid <a href="/pages/-MUP3f-B0M6hQRc-XTlO">operational notes</a> for the airport. Available values: <br><code>INFORMATION_ONLY</code>, <code>OPERATIONALLY_RELEVANT</code><em>,</em> <code>OPERATIONALLY_CRITICAL</code><br><br>Defaults to <code>null</code> when no operational notes are present for the airport.</td></tr></tbody></table>

## Retrieve random airports

<mark style="color:blue;">`GET`</mark> `https://api.aviowiki.com/airports/search/random`

#### Query Parameters

| Name | Type   | Description                                                                     |
| ---- | ------ | ------------------------------------------------------------------------------- |
| page | Number | The page number for pagination, starting from \`0\` to indicate the first page. |
| size | Number | The number of results in a page, for pagination                                 |

#### Headers

| Name          | Type   | Description                              |
| ------------- | ------ | ---------------------------------------- |
| Authorization | String | An API Token using Bearer authorization. |

{% tabs %}
{% tab title="200: OK Paginated airport list" %}
{% tabs %}
{% tab title="Response properties" %}

{% endtab %}

{% tab title="Example response" %}

```
{
	"page": {
		"number": 0,
		"size": 1,
		"totalPages": 10000,
		"totalResults": 10000
	},
	"content": [
		{
			"name": "Rundu Airport",
			"country": {
				"iso2": "NA",
				"iso3": "NAM",
				"isoNumeric": 516,
				"name": "Namibia",
				"officialName": "Republic of Namibia",
				"localIdentifierName": null
			},
			"timeZone": "Africa/Windhoek",
			"aid": "APT-NYRI-716E",
			"coordinates": {
				"latitude": -17.9561111,
				"longitude": 19.7205556
			},
			"icao": "FYRU",
			"iata": "NDU",
			"localIdentifier": null,
			"servedCityGoverningDistrict": null,
			"servedCity": null,
			"aid": "APT-NYRI-716E",
			"elevation": 1106.0,
			"longestRunwayLength": 3354.0,
			"widestRunwayWidth": 30.0,
			"openingIndicator": "UNKNOWN",
			"icon": "OTHER",
			"distanceFromSearchCoordinates": null,
			"operationalStatus": null
		}
	]
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="403: Forbidden No API token was provided or it was invalid." %}

{% endtab %}
{% endtabs %}

<table data-header-hidden><thead><tr><th width="228.87373263824156">Property</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>Property</td><td>Type</td><td>Description</td></tr><tr><td><code>name</code></td><td>String</td><td>The name of the airport. This should be the official name of the airport written in Latin characters.</td></tr><tr><td><code>country</code></td><td><a href="/pages/-MUP3Jkil0DeGQKvY9rY">Country</a></td><td>A <a href="/pages/-MUP3Jkil0DeGQKvY9rY">Country</a> object which represents the country at which an airport is located.</td></tr><tr><td><code>timeZone</code></td><td>String</td><td>The time-zone of the airfield as noted in the <a href="https://en.wikipedia.org/wiki/Tz_database">IANA Time Zone Database</a>.<br>Defaults to <code>null</code> when this information is not available.</td></tr><tr><td><code>aid</code></td><td>String</td><td><a href="/pages/-MSK0yT0xbFHC0I8opdb">Aviowiki ID</a> of the airport, with <code>APT</code> as namespace</td></tr><tr><td><code>coordinates</code></td><td><a href="/pages/-MUP3HHnqurT_QdZAc3T">Coordinates</a></td><td> <a href="/pages/-MUP3HHnqurT_QdZAc3T">Coordinates</a> object which represents the location of the <a href="https://en.wikipedia.org/wiki/Airport_reference_point">Aerodrome Reference Point</a>.<br>Defaults to <code>null</code> if the information is not known.</td></tr><tr><td><code>icao</code></td><td>String</td><td>A string with the 4-letters ICAO code of the airport, or <code>null</code> if none is assigned</td></tr><tr><td><code>iata</code></td><td>String</td><td>A string with the 3-letters IATA code of the airport, or <code>null</code> if none is assigned.</td></tr><tr><td><code>localIdentifier</code></td><td>String</td><td>An identifier issued by the local authority, which is not recognised as an official ICAO or IATA code.<br>The name of the code for each country can be found in <code>Country.localIdentifierName</code></td></tr><tr><td><code>servedCityGoverningDistrict</code></td><td><a href="/pages/-MUP3MbAxRd8xQy0tsME">Governing District</a></td><td><p>A <a href="/pages/-MUP3MbAxRd8xQy0tsME">Governing District</a> object indicating the Governing District of the <code>servedCity</code>.</p><p></p><p>Defaults to <code>null</code> when the information is not known.</p></td></tr><tr><td><code>servedCity</code></td><td>String</td><td><p>A string containing the name of the city served by the airport.</p><p><br>Defaults to <code>null</code> when the information is not known.</p></td></tr><tr><td><code>elevation</code></td><td>Decimal</td><td>A decimal number representing the elevation of the airport expressed in meters. Two decimal positions are provided, for precise conversion to feet.<br><br>Defaults to <code>null</code> when the information is not known.</td></tr><tr><td><code>longestRunwayLength</code></td><td>Decimal</td><td>Longest runway length expressed in meters with precision up to two decimal positions.<br><br>Defaults to <code>null</code> when this information is not available.</td></tr><tr><td><code>widestRunwayWidth</code></td><td>Decimal</td><td>The widest runway width expressed in meters with precision up to two decimal positions.<br><br>Defaults to <code>null</code> when this information is not available.</td></tr><tr><td><code>openingIndicator</code></td><td>String</td><td>Opening indicator flag taking into consideration the 4 types of airport availability. For details see <a href="/pages/-MUP3E2gh6HIUla58k7Q#the-openingindicator-flag">opening indicator</a> section.<br>Available values: <code>OPEN</code>, <code>SEE_TIMES</code>, <code>CLOSED</code>, <code>UNKNOWN</code><br><br>Defaults to <code>null</code> when this information is not available.</td></tr><tr><td><code>distanceFromSearchCoordinates</code></td><td>Decimal</td><td>Distance from the search coordinates given in the query expressed in kilometers with precision up to two decimal positions.<br><br>Defaults to <code>null</code> when no search coordinates were given in the query.</td></tr><tr><td><code>operationalStatus</code></td><td>String</td><td>Worst criticality of the valid <a href="/pages/-MUP3f-B0M6hQRc-XTlO">operational notes</a> for the airport. Available values: <br><code>INFORMATION_ONLY</code>, <code>OPERATIONALLY_RELEVANT</code><em>,</em> <code>OPERATIONALLY_CRITICAL</code><br><br>Defaults to <code>null</code> when no operational notes are present for the airport.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aviowiki.com/authenticated-endpoints/airport-endpoints/searching-airports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
