Use this endpoint to get a list of all available airports worldwide or in a specific country. The output will give you airport ID's, names, locations and if a METAR and/or TAF was reported recently.
Use the METAR endpoint if you need more details for each airport, for example runway information.
Usage
https://api.metar-taf.com/airports
?api_key=YOUR_API_KEY
&v=2.3
&locale=de-DE
&country_id=NL
Parameters
Provide these parameters when you make the call to this endpoint:
Name | Type | Description | Example | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
admin1_id (optional) |
string(64) |
Only get the airports in a specific administrative division. Go to a country page to see its administrative divisions and their IDs. See also: https://metar-taf.com/de/count.. |
ES.29
|
||||||||||||||||||
api_key |
string |
Your API key. Refer to the getting started section for how to obtain one. |
|
||||||||||||||||||
country_id (optional) |
string(2) |
Only get the airports of a specified country. Provide its ISO 3166-1 country code. See also: https://en.wikipedia.org/wiki/.. |
ES
|
||||||||||||||||||
has_metar (optional) |
int |
Return only airports with a recent METAR. Note that this value may change. Airports may not report outside their business hours and won't show as having a METAR.
|
1
|
||||||||||||||||||
has_taf (optional) |
int |
Return only airports with a recent TAF. Note that this value may change. Airports may not report outside their business hours and won't show as having a TAF.
|
1
|
||||||||||||||||||
locale |
string |
Airports, cities and other string data is available in multiple languages. For example, LEMD is "Madrid–Barajas Airport" in English, but "Luchthaven Madrid-Barajas" in Dutch. With the locale parameter you can request in which language you want to have the result. Note that this setting has no effect on the notations or units. Available locales are:
|
de-DE
|
||||||||||||||||||
offset (optional) |
string |
Skip this number of results. Per request we return a maximum of 1000 results. To get all the results, call the API with offset=0, offset=1000, offset=2000, etc. |
0
1000
2000
|
||||||||||||||||||
test |
int |
Format the response with every variable on a new line. This makes is easier to see all date while you are building your application.
|
1
|
||||||||||||||||||
translate (optional) |
int |
Get translated names of the airports, according to the
|
1
|
||||||||||||||||||
v |
string |
API version: provide the current version, which is |
2.3
|
Examples
- Get all airports in Niederlande (NL):
https://api.metar-taf.com/airports
?api_key=YOUR_API_KEY
&v=2.3
&locale=de-DE
&country_id=NL - Get the 3rd page of airports, worldwide:
https://api.metar-taf.com/airports
?api_key=YOUR_API_KEY
&v=2.3
&locale=de-DE
&offset=2000
Response
A JSON object with the requested information is returned. The result is grouped in a couple of sections:
pagination | Pagination stats, to help you manage get multiple pages of results |
airports | Actual list of airports |
Pagination
Name | Type | Description | Example |
---|---|---|---|
from |
int |
Serial number of the first result, zero-based. This is the offset you specified in the request. |
2000
|
results |
int |
Number of results in this response. If lower than 1000, you know this was the last page. |
1000
|
to |
int |
Serial number of the last result, zero-based. This is the offset plus the number of results minus one. |
2999
|
Airports
Name | Type | Description | Example |
---|---|---|---|
country_id (optional) |
string(2) |
ISO 3166-1 country code. If you only requested airports from a specified country, this value is omitted. See also: https://en.wikipedia.org/wiki/.. |
ES
NL
|
id |
string |
ICAO code of this airport. May also be a combination of country code and a number |
LEMD
EHTX
ES-0071
|
lat |
float |
Latitude of the airport. Decimal from -90 (south) to 90 (north). Unit: degrees |
40.49528
|
lng |
float |
Longitude of the airport. Decimal from -180 (west) to 180 (east). Unit: degrees |
-3.56009
|
metar |
boolean |
Whether the airport has published a METAR recently. |
true
|
name |
string |
Airport name |
Adolfo Suárez Madrid-Barajas Airport
|
taf |
boolean |
Whether the airport has published a TAF recently. |
false
|