This API is to get a METAR combined with airport, weather station and runway information all at the same time.
Usage
https://api.metar-taf.com/metar
?api_key=YOUR_API_KEY
&v=2.3
&locale=nl-NL
&id=LEMD
Parameters
Provide these parameters when you make the call to the METAR endpoint:
Name | Type | Description | Example | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
api_key |
string |
Your API key. Refer to the getting started section for how to obtain one. |
|
||||||||||||||||||
id (optional) |
string |
ICAO code of the airport to query. Note that either an airport ID or latitude/longitude is mandatory. If you specify a latitude and longitude, this parameter will be ignored. |
EHTX
|
||||||||||||||||||
latitude (optional) |
float |
Decimal latitude of the location you want to query. we will select the nearest METAR. Unit: degrees |
40.49528
|
||||||||||||||||||
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:
|
nl-NL
|
||||||||||||||||||
longitude (optional) |
float |
Decimal longitude of the location you want to query, we will select the nearest METAR. Unit: degrees |
-3.56009
|
||||||||||||||||||
station_id (optional) |
string |
ICAO code of the weather station. If not specified, we'll get the weather from the nearest airport with METAR. If you specify a latitude and longitude, this parameter will be ignored. |
EHKD
|
||||||||||||||||||
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
|
||||||||||||||||||
time (optional) |
string |
To get a historical METAR, provide a time in ISO 8601 format. We will select the first METAR before this time. Leave this parameter empty to get the current METAR. See also: https://https://en.wikipedia.o.. |
2024-09-13T17:20:20Z
|
||||||||||||||||||
v |
string |
API version: provide the current version, which is |
2.3
|
Examples
- Get current weather information of Texel International Airport (EHTX):
https://api.metar-taf.com/metar
?api_key=YOUR_API_KEY
&v=2.3
&locale=nl-NL
&id=EHTX - Get current weather information of Texel International Airport (EHTX), use the weather information of Vlieland Heliport (EHVL) instead of EHKD and combine it with the runway information for EHTX:
https://api.metar-taf.com/metar
?api_key=YOUR_API_KEY
&v=2.3
&locale=nl-NL
&id=EHTX
&station_id=EHVL - Get the nearest METAR report for position 40.59528, -3.46009 on
2024-09-12 17:20:20 UTC.
https://api.metar-taf.com/metar
?api_key=YOUR_API_KEY
&v=2.3
&locale=nl-NL
&latitude=40.59528
&longitude=-3.46009
&time=2024-09-12T17:20:20Z
Response
A JSON object with the requested information is returned. The result is grouped in a couple of sections:
metar | Last METAR data, raw and decoded |
airport | Information about the airport, including timezone and latitude/longitude |
station | Airport information of the weather station (if different from airport) |
stations | List of alternatives for this weather station: nearby airports with METAR and/or TAF |
runways |
Runways of the requested airport with the crosswind data. Crosswind data is calculated using the airport\'s own METAR or the nearest available station. |
METAR
Name | Type | Description | Example | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cavok |
boolean |
If ceiling and visibility are OK (CAVOK). This means there are no clouds below 5000 ft or the MSA (minimum safe altitude), whichever is higher. This also means that no cumulonimbus or towering cumulus clouds have been observed and the visibility is 10 kilomters or more. Also, there can't be fog, precipitation nor other significant weather. |
true
false
|
|||||||||||||||||||||||||||||||||||||||
ceiling |
int |
Observed ceiling. For ceiling we use the lowest cloud layer that is broken, overcast or when there is a vertical visibility reported. Unit: feet |
null
3000
|
|||||||||||||||||||||||||||||||||||||||
ceiling_color |
string(7) |
Color to use for a graphical presentation of the ceiling. 6 character hexadecimal preded by a hash sign. |
#28a745
|
|||||||||||||||||||||||||||||||||||||||
clouds |
CloudLayer[] |
Array with all reported cloud layers. |
|
|||||||||||||||||||||||||||||||||||||||
code |
string |
Flight rules category. Possible values are:
|
VFR
|
|||||||||||||||||||||||||||||||||||||||
code_color |
string(7) |
Color to use for a graphical presentation of the flight rules category. 6 character hexadecimal preded by a hash sign. |
#28a745
|
|||||||||||||||||||||||||||||||||||||||
colour_state |
string |
Colour state. Used by some military airport. Translated according to the locale. If the airport is closed, Black will be added. Possible values for the colors are:
|
Groen
Blauw/Zwart
|
|||||||||||||||||||||||||||||||||||||||
dewpoint |
int |
Dewpoint Unit: degrees Celsius |
11
-3
|
|||||||||||||||||||||||||||||||||||||||
dewpoint_exact (optional) |
int |
Some METARs provide an exact dewpoint in the remarks, you can find it in this variable. Note that it is in tenths of degrees Celsius. So 113 means 11.3°C. If not available, null is provided. Unit: tenths of degrees Celsius |
113
|
|||||||||||||||||||||||||||||||||||||||
humidity |
int |
Relative Humidity. Calculated from temperature and dewpoint. If available, Unit: percentage |
10
98
|
|||||||||||||||||||||||||||||||||||||||
is_day |
boolean |
Indicates whether it was day or night at the obervation time of the METAR at the airport you requested. |
false
true
|
|||||||||||||||||||||||||||||||||||||||
observed |
int |
Observation timestamp. UTC time in seconds since Unix epoch. Unit: seconds |
1644848700
|
|||||||||||||||||||||||||||||||||||||||
qnh |
int |
Altimeter setting: air pressure calculated back to mean sea level according to the standard atmosphere. Unit: hectopascal |
997
1013
|
|||||||||||||||||||||||||||||||||||||||
raw |
string |
Raw METAR data, not decoded |
METAR EHAM
|
|||||||||||||||||||||||||||||||||||||||
recent_weather_report (optional) |
string |
Report of recent weather in human language. Same as |
Lichte regen
|
|||||||||||||||||||||||||||||||||||||||
remarks |
string[] |
Array of strings in the requested language. Every element represents one part of the remarks section in the METAR. |
Temperature is
Automatic weather station
|
|||||||||||||||||||||||||||||||||||||||
runway_condition |
RunwayCondition[] |
Array with all reported runway conditions. |
|
|||||||||||||||||||||||||||||||||||||||
runway_visibility |
RunwayVisibility[] |
Array with all reported runway visual ranges. |
|
|||||||||||||||||||||||||||||||||||||||
snoclo |
boolean |
Whether the airport is closed due to snow (SNOCLO). |
false
true
|
|||||||||||||||||||||||||||||||||||||||
station_id |
string |
ICAO code of the reporting weather station. |
LEMD
|
|||||||||||||||||||||||||||||||||||||||
sunrise |
int |
Timestamp of sunrise at the requested airport on the day of the METAR observation. UTC time in seconds since Unix epoch. Unit: seconds |
1644821896
|
|||||||||||||||||||||||||||||||||||||||
sunset |
int |
Timestamp of sunset at the requested airport on the day of the METAR observation. UTC time in seconds since Unix epoch. Unit: seconds |
1644857513
|
|||||||||||||||||||||||||||||||||||||||
temperature |
int |
Temperature Unit: degrees Celsius |
3
32
|
|||||||||||||||||||||||||||||||||||||||
temperature_exact (optional) |
int |
Some METARs provide an exact temperature in the remarks, you can find it in this variable. Note that it is in tenths of degrees Celsius. So 113 means 11.3°C. If not available, null is provided. Unit: tenths of degrees Celsius |
113
|
|||||||||||||||||||||||||||||||||||||||
trends |
MetarTrend[] |
Array with all reported trends. |
|
|||||||||||||||||||||||||||||||||||||||
vertical_visibility (optional) |
int |
Vertical visibility, if applicable. Unit: feet |
100
null
|
|||||||||||||||||||||||||||||||||||||||
visibility |
int |
Current visibility. Unit: meters |
10000
3500
|
|||||||||||||||||||||||||||||||||||||||
visibility_color |
string(7) |
Color to use for a graphical presentation of the visibility. 6 character hexadecimal preded by a hash sign. |
#28a745
|
|||||||||||||||||||||||||||||||||||||||
visibility_min (optional) |
int |
Reported minimum visibility. Use with Unit: meters |
3000
null
|
|||||||||||||||||||||||||||||||||||||||
visibility_min_direction (optional) |
string |
Direction in which the minimum visibility is reported. Use with Unit: meters |
N
NE
null
|
|||||||||||||||||||||||||||||||||||||||
visibility_sign |
string(1) |
If the visibility is the distance reported in visibility or may be less or more. For example: visibility
|
M
P
null
|
|||||||||||||||||||||||||||||||||||||||
weather |
string |
Weather report in normal language, translated according to locale. If there is no significant weather (fog, precipitation) it will indicate the maximum cloud coverage. |
Licht bewolkt
Zware regen
|
|||||||||||||||||||||||||||||||||||||||
weather_image |
string |
Image to use for indicating significant weather and cloud base. Possible values are:
|
rain
overcast
|
|||||||||||||||||||||||||||||||||||||||
weather_report (optional) |
string |
Weather report in human language. Same as |
Zware regen
|
|||||||||||||||||||||||||||||||||||||||
wind_color |
string(7) |
Color to use for a graphical presentation of the wind speed including gusts. 6 character hexadecimal preded by a hash sign.
Other than for example the |
#28a745
|
|||||||||||||||||||||||||||||||||||||||
wind_dir |
int |
Wind direction, magnetic heading from 0 to 360. -1 if the wind is variable. An empty value means it is not provided. 90 means the wind is from direction east. Unit: degrees |
270
-1
|
|||||||||||||||||||||||||||||||||||||||
wind_dir_max (optional) |
int |
If reported, the wind varies between wind_dir_min and wind_dir_max. Magnetic heading from 0 to 360. Unit: degrees |
290
null
|
|||||||||||||||||||||||||||||||||||||||
wind_dir_min (optional) |
int |
If reported, the wind varies between wind_dir_min and wind_dir_max. Magnetic heading from 0 to 360. Unit: degrees |
220
null
|
|||||||||||||||||||||||||||||||||||||||
wind_gust |
int |
Wind gust speed. Should only be reported if it's 10 knots more than the average wind speed. Unit: knots |
22
|
|||||||||||||||||||||||||||||||||||||||
wind_speed |
int |
Average wind speed Unit: knots |
12
0
|
|||||||||||||||||||||||||||||||||||||||
ws_all |
boolean |
Windshear is reported at all runways. |
true
|
|||||||||||||||||||||||||||||||||||||||
ws_runways |
string[] |
Windshear is reported at certain runways. Array of strings with runway names. |
04
27L
|
Runways
The Runway section contains an array of Runway objects:
Name | Type | Description | Example |
---|---|---|---|
hdg_h |
int |
Second magnetic heading. The side with the highest heading or south. Unit: degrees |
232
|
hdg_l |
int |
First magnetic heading. The side with the lowest heading or north. Unit: degrees |
52
|
hwnd |
int |
Headwind for this runway. Given the average wind speed in the current METAR. As we select the side with headwind, this value is always positive. Unit: knots |
8
|
id_h |
string |
Second identifier of the runway. The side with the highest heading or south. Combine |
23R
|
id_l |
string |
First identifier of this runway. The side with the lowest heading or north. Combine |
5L
|
in_use |
string |
Identifier of the side that is in use. We select the side with headwind. Equals |
5L
|
xwnd |
int |
Crosswind for this runway, given the average wind speed in the current METAR. The side with headwind is used as reference (see Unit: knots |
-4.1
|
Airport
Contains information about the requested airport
Name | Type | Description | Example | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
admin1 |
string |
Name of the primary administrative division. A primary administrative division is a state in the United States, a region in Spain, province in The Netherlands, etc. If available, the name is translated according to the locale. |
Florida
|
||||||||||||||||||||||
admin2 (optional) |
string |
Name of the secondary administrative division, if available. A secondary administrative division is a county in the United States, a province in Spain, municipality in The Netherlands, etc. If available, the name is translated according to the locale. |
Orange county
|
||||||||||||||||||||||
city_name |
string |
Name of the nearest city. If there is a town nearby with the same name as the airport, this will be used. Otherwise we take the nearest town with a population of more than 20.000. If available, the name is translated according to the locale. |
Barajas de Madrid
|
||||||||||||||||||||||
country_id |
string(2) |
ISO 3166-1 country code. See also: https://en.wikipedia.org/wiki/.. |
ES
NL
|
||||||||||||||||||||||
country_name |
string |
Name of the country. If available, the name is translated according to the locale. |
Spanje
|
||||||||||||||||||||||
elevation |
int |
Airport elevation above mean sea level. Unit: feet |
1998
|
||||||||||||||||||||||
fir (optional) |
string(4) |
Flight Information Region. Useful for getting regional NOTAMs. For most airports in larger countries, there is no value for the FIR. |
EHAA
|
||||||||||||||||||||||
iata (optional) |
string(3) |
3-digit IATA code of this airport, if available |
MAD
LAX
|
||||||||||||||||||||||
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 |
Official airport name |
Hilversum Aerodrome
|
||||||||||||||||||||||
name_translated |
string |
Airport name translated according to locale. Same as |
Vliegveld Hilversum
|
||||||||||||||||||||||
taf |
boolean |
Whether the airport has published a TAF recently. |
false
|
||||||||||||||||||||||
timezone |
int |
Difference from UTC in seconds. Positive numbers are timezones east of London. E.g. 3600 is UTC+1 hour. Unit: seconds |
7200
|
||||||||||||||||||||||
type |
int |
Airport type and size. Possible values are:
|
13
|
Station
When the requested airport doesn't have it's own METAR, we'll choose the nearest available airport with weather information. In that case, the Station section will be filled with the airport details in the same format as above. The following fields are added:
Name | Type | Description | Example |
---|---|---|---|
bearing |
int |
Direction from airport to the weather station. A bearing of 180 means the weather station is directly south of the airport. Unit: degrees |
180
|
distance |
int |
Distance between the airport and the weather station. Unit: kilometers |
22
|
Stations
In the response you get a list of nearby airports with METAR. You can use the list to give your visitors some alternatives. Each item in the list will contain:
Name | Type | Description | Example |
---|---|---|---|
id |
string |
ICAO code of the airport |
LEMD
|
name |
string |
Name of the airport. |
Luchthaven Madrid-Barajas
|
taf |
boolean |
The airport published a TAF recently. |
true
|
Trend
Contains information about weather trends.
Name | Type | Description | Example | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cavok |
boolean |
Ceiling and visibility are OK (CAVOK). This means there are no clouds below 5000 ft or the MSA (minimum safe altitude), whichever is higher. This also means that no cumulonimbus or towering cumulus clouds have been observed and the visibility is 10 kilomters or more. Also, there can't be fog, precipitation nor other significant weather. |
true
false
|
||||||||||||
clouds |
CloudLayer[] |
Array with cloud layers. |
|
||||||||||||
flag (optional) |
string |
Type of trend. Possible values are:
|
TEMPO
|
||||||||||||
from (optional) |
int |
Start of the period in seconds since Unix epoch |
1726248020
|
||||||||||||
present_weather_report (optional) |
string |
Weather report in human language. This will only provide significant weather and no cloud information. |
Zware regen
|
||||||||||||
probability (optional) |
int |
Chance that it will take place in percent. Can be either null, 30 or 40. Events with a probability smaller than 30% are not included as trend. If no probability given (null), the chance is presumed greater than 40%. |
30
|
||||||||||||
to |
int |
End of the period in seconds since Unix epoch Unit: seconds |
1726251620
|
||||||||||||
visibility (optional) |
int |
Visibility Unit: meters |
10000
3500
|
||||||||||||
wind_dir (optional) |
int |
Wind direction in degrees or -1 if variable Unit: degrees |
130
|
||||||||||||
wind_dir_max (optional) |
int |
If reported, the wind varies between wind_dir_min and wind_dir_max. Magnetic heading from 0 to 360. Unit: degrees |
290
null
|
||||||||||||
wind_dir_min (optional) |
int |
If reported, the wind varies between wind_dir_min and wind_dir_max. Magnetic heading from 0 to 360. Unit: degrees |
220
null
|
||||||||||||
wind_gust (optional) |
int |
Wind gust speed. Will usually only be reported if it's 10 knots more than the average wind speed. Unit: knots |
12
0
|
||||||||||||
wind_speed (optional) |
int |
Average wind speed Unit: knots |
12
0
|
CloudLayer
Contains information about the cloud layers.
Name | Type | Description | Example | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
amount |
string |
Amount of clouds observed.
|
FEW
|
||||||||||||||||||||
height |
int |
Height of the cloud base AGL. Unit: feet |
1200
|
||||||||||||||||||||
id |
int |
Number of the cloud layer. 0 is the lowest reported cloud layer. |
0
|
||||||||||||||||||||
report |
string |
Human readable report for this cloud layer, translated according to locale. |
Few clouds at 1200 feet
|
RunwayCondition
Has information about the runway conditions at the reporting airport (weather station). Note that if the weather station is another airport, these values are not useful.
Name | Type | Description | Example |
---|---|---|---|
id |
string |
Applicable runway ID. Note that you can't neccessarily match these with the ID's provided in the Runway object. The identifier might have changed. |
5L
|
text |
string |
Description of the runway condition, human readable and translated according to the specified locale. |
RunwayVisibility
Has information about visibility per runway at the reporting airport (weather station). Note that if the weather station is another airport, these values are not useful.
Name | Type | Description | Example | ||||||
---|---|---|---|---|---|---|---|---|---|
id |
string |
Applicable runway ID. Note that you can't neccessarily match these with the ID's provided in the Runway object. The identifier might have changed. |
5L
|
||||||
max |
int |
Maximum value. The value varies between Unit: meters or feet |
3500
|
||||||
min |
int |
Minimum value. The value varies between Unit: meters or feet |
2500
|
||||||
prefix |
string |
Visibility prefix. A
|
P
|
||||||
trend |
string |
Trend of the visibility.
|
U
|
||||||
value |
int |
Visibility value Unit: meters or feet |
3000
|