The Location Service - Near API looks up valid Personal Weather Station (PWS) identifiers, Airports, Ski Resorts, or METAR Station Observations and distance information matching the request.
Airport: returns up to 10 airports nearest the requested location.
Observation: returns up to 10 METAR station observations nearest the requested location.
PWS: returns up to 10 Personal Weather Stations nearest the requested location.
Ski: returns up to 10 ski resorts nearest the requested location.
For details on appropriate header values as well as caching and expiration definitions, see the Weather Company Data API Common Usage Guide.
Required: geocode, format, product, apiKey
v3-location-nearhttps://api.weather.com/v3/location/near?geocode=33.74,-84.39&product=airport&format=json&apiKey=yourApiKey
Required: geocode, format, product, apiKey
v3-location-nearhttps://api.weather.com/v3/location/near?geocode=33.74,-84.39&product=observation&format=json&apiKey=yourApiKey
Required: geocode, format, product, apiKey
v3-location-nearhttps://api.weather.com/v3/location/near?geocode=33.74,-84.39&product=pws&format=json&apiKey=yourApiKey
Required: geocode, format, product, apiKey
v3-location-nearhttps://api.weather.com/v3/location/near?geocode=33.74,-84.39&product=ski&format=json&apiKey=yourApiKey
| Parameter | Value | Description |
|---|---|---|
apiKey |
yourApiKey |
The API Key used for access; usually customer specific. |
format |
json |
The format of the response. |
product |
airport | observation | pws | ski |
The identifier type used in the query. Valid values: airport, observation, pws, ski. |
geocode |
latitude,longitude |
WGS84 geocode coordinate (e.g. 34.063,-84.217). TWC uses valid latitude and longitude coordinates to identify locations worldwide. |
Field names are sorted alphabetically for presentation. This does not represent the sort order of the API response.
| Field | Description | Type | Range | Sample | Nulls |
|---|---|---|---|---|---|
location |
Object for location data. | [array] | |||
latitude |
Latitude of the requested location. | [decimal] | Any valid latitude value. | 33.638271 | N |
longitude |
Longitude of the requested location. | [decimal] | Any valid longitude value. | -84.429369 | N |
distanceKm |
Distance from requested location in kilometers. | [decimal] | 0.4 | Y | |
distanceMi |
Distance from requested location in miles. | [decimal] | 0.25 | Y | |
| Fields Unique to PWS | |||||
stationId |
The PWS station identifier. | [string] | KGAATLAN81 | Y | |
stationName |
The station name near the requested location. | [string] | Atlanta | N | |
partnerId |
For internal use only. | [string] | null | Y | |
qcStatus |
Quality control indicator: -1=not checked, 0=failed, 1=OK. | [string] | 1 | Y | |
updateTimeUtc |
Epoch time indicating the date of the last update received from the station. | [epoch] | 1557819905 | Y | |
| Fields Unique to Airport | |||||
airportName |
The airport names near the requested location. | [string] | Hartsfield-Jackson Intl | Y | |
iataCode |
IATA airport code of the requested location. | [string] | Any valid IATA code | ATL | Y |
icaoCode |
ICAO airport code of the requested location. | [string] | Any valid ICAO code | KATL | Y |
| Fields Unique to Ski Resorts | |||||
adminDistrictCode |
The state/region/district/province identifier code (ISO 3166-2 compliant). | [string] | Any valid state, region, district, or province code | GA | Y |
countryCode |
ISO country code. | [string] | Any valid ISO country code | US | Y |
ianaTimeZone |
The standard IANA Time Zone for the location requested. | [string] | Any valid IANA time zone | America/New_York | Y |
skiId |
The ski resort identifier near the requested location. | [string] | 347 | Y | |
skiName |
The ski resort name of the requested location. | [string] | Sapphire Valley | Y | |
{
"location": {
"latitude": ["33.9152806", "33.7791264", "33.8756111", "34.0131667", "33.6366996"],
"longitude": ["-84.5163528", "-84.521366", "-84.3019722", "-84.5970278", "-84.427864"],
"distanceKm": [5.91, 13.57, 14.68, 18.64, 28.33],
"distanceMi": [3.67, 8.43, 9.12, 11.58, 17.6],
"airportName": ["Dobbins Air", "Fulton County", "Dekalb-Peachtree", "Cobb County", "Hartsfield-Jackson Intl"],
"iataCode": ["MGE", "FTY", "PDK", "RYY", "ATL"],
"icaoCode": ["KMGE", "KFTY", "KPDK", "KRYY", "KATL"]
}
}
{
"location": {
"adminDistrictCode": [null, null, null, null, null],
"stationName": ["Aberdeen/Amory", "Columbus AFB", "Haleyville", "Columbus", "Jasper"],
"countryCode": ["US", "US", "US", "US", "US"],
"stationId": ["KM40", "KCBM", "K1M4", "KGTR", "KJFX"],
"ianaTimeZone": ["America/Chicago", "America/Chicago", "America/Chicago", "America/Chicago", "America/Chicago"],
"obsType": ["METAR", "METAR", "METAR", "METAR", "METAR"],
"latitude": [33.867, 33.65, 34.2833, 33.45, 33.9],
"longitude": [-88.483, -88.45, -87.6, -88.5833, -87.317],
"distanceKm": [36.46, 43.36, 62.07, 67.73, 71.34],
"distanceMi": [22.66, 26.94, 38.57, 42.09, 44.33]
}
}
{
"location": {
"stationName": ["Atlanta", "Atlanta", "Atlanta", "Forest Park"],
"stationId": ["KGAATLAN398", "KGAATLAN41", "KGAATLAN378", "KGAFORES2"],
"latitude": ["33.66058", "33.68513", "33.68098", "33.63761"],
"longitude": ["-84.46119", "-84.45192", "-84.48737", "-84.35225"],
"distanceKm": [3.4, 5.21, 6.71, 7.48],
"distanceMi": [2.11, 3.24, 4.17, 4.65],
"partnerId": [null, null, null, null],
"qcStatus": [1, 1, -1, -1],
"updateTimeUtc": [1557811139, 1557797749, null, null]
}
}
{
"location": {
"adminDistrictCode": ["NC", "NC", "TN"],
"countryCode": ["US", "US", "US"],
"distanceKm": [202.54, 246.66, 247.72],
"distanceMi": [125.85, 153.27, 153.92],
"ianaTimeZone": ["America/New_York", "America/New_York", "America/New_York"],
"latitude": ["35.089", "35.5621", "35.7231"],
"longitude": ["-83.097", "-83.0909", "-83.4802"],
"skiId": ["347", "103", "303"],
"skiName": ["Sapphire Valley", "Cataloochee Ski Area", "Ober Gatlinburg Ski Resort"]
}
}