HOMR provides a web service that you can use to get station metadata in JSON format. This page
documents the URL formats used to get the data you want. All calls to the web service should
be GET requests. The WADL for this web service can be
found here:
All queries, if they find one or more stations, will return a JSON object with the property
stationCollection, which contains a
definitions section and a stations
section. definitions contains the same information for each request: descriptive information
about the fields that can be found in a station metadata entry. stations
contains the list of stations that matched your search query. Each entry in the stations
list has an ncdcStnId, and other properties such as
names and location, depending on
what information is available for that station.
Note that very broad searches - e.g. for an entire state or network - will take a very long
time to return. Consider using the headersOnly=true
argument (documented below) when making these kinds of requests.
The base URL for the web service is located here:
If you know the unique NCDC Station ID of the station you are looking for, you can request it directly:
This will give you only the most recent values for each field. You can get the entire
station history by adding date=all:
Other date options include single points in time and date ranges:
If you do not know exactly which station you are looking for, or you only know the qualified ID,
you can use the search function with various parameters:
qid
qid=[COOP|FAA|GHCND|ICAO|NCDCSTNID|NWSLI|TRANS|WBAN|WMO]?:[a-z0-9]*
Any fully qualified ID such as
COOP:046742. When used with
qidMod, can contain partial station ID's. Either the network
or ID number may be omitted.
qidMod
qidMod=[is|starts|ends|contains]
Specifies how the ID portion of the
qid parameter should be
applied within the search. If a
qid is passed but the
qidMod
parameter is not used,
qidMod is assumed to be
IS.
state
state=[A-Z]{2}
Two-letter code for US states, Canadian provinces, and other Island areas.
country
country=[A-Z]+
See
here for a list of valid country names.
name
name=[0-9A-Z]+
Searches on any type of name we have for the station.
nameMod
nameMod=[is|starts|ends|contains]
Specifies how the
name parameter should be applied within the search.
If a
name is passed
but the
nameMod parameter is not used,
nameMod is assumed to be
IS.
platform (aka network)
platform=[ASOS|USCRN|USHCN|NEXRAD|AL USRCRN|USRCRN|COOP]
Limit the search to stations of a certain platform/network type.
date
date=[YYYY-MM-DD|all]
Limits values to only those that occurred on a specific date. Alternatively,
date=all will return all values for matched stations. If this
field is omitted, the search will return only the most recent values for each field.
begindate/enddate
begindate=[YYYY-MM-DD]&enddate=[YYYY-MM-DD]
Limits values to only those that occurred within a date range.
headersOnly
headersOnly=true
Returns only minimal information for each station found (NCDC Station ID, Preferred Name, Station Begin Date, and Station End Date), but
is much quicker than a full query. If you are performing a search that returns a large number of stations and intend to choose only
one from that list to examine in detail,
headersOnly may give you enough information to find the NCDC Station ID for the station that you
actually want.
phrData
phrData=false
The HOMR web service now includes PHR (element-level) data when available, in an
elements
section. Because of how this data is structured,
it can substantially increase the size of any result which includes it. If you don't need this data you can omit
it by including
phrData=false. If the parameter is not set, it will default to
phrData=true.
definitions
definitions=false
The HOMR web service includes a list of
definitions with every result.
These are meant to serve as a reference for some of the more cryptic variable values, and are identical for every request.
You can omit these from your result by setting
definitions=false.