National Weather Service

БЕЗКОШТОВНО
(Ким) API Guy | Оновлено 4 days ago | Weather
Популярність

9.5 / 10

Затримки

214ms

Рівень обслуговування

100%

Health Check

N/A

README

API Reference
We are excited to announce a brand new API to provide forecast data for your applications. This new design is a significant change with easier to navigate data to enrich your application. The new API is now separate from the forecast website. The new website will only return HTML for viewing within a browser. Additional security measures will be implemented to prevent improper usage of the website to ingest forecast data. The new website is now a lightweight presentation view that uses the same API to display the forecast. This same data will be available to you through the API.

Content Negotiation
The API will use Accept headers to modify the response returned. See the FAQ tab for more information. Parameters include:
Version of the API, defaults to the oldest
Format of the response, default in specifications
An example of the Accept header would be "Accept: application/vnd.noaa.dwml+xml;version=1"
Authentication
A User Agent will still be required to identify your application. This string can be anything, and the more unique to your application the less likely it will be affected by a security event. If you include contact information (website or email), we can contact you if your string is associated to a security event. This will be replaced with an API key in the future.
Endpoints
The API is located at: https://api.weather.gov

Endpoints typically have a GeoJSON default format and additional formats may be requested using the request header. For example, to request DWML formatting for the point forecast at http://api.weather.gov/point/XXX,XXX/forecast, set the accept header to “application/vnd.noaa.dwml+xml.” Use the reference below to determine what formats are available for each endpoint.

Here are the full string formats for the shorthand in the references:

GeoJSON: application/geo+json
JSON-LD: application/ld+json
DWML: application/vnd.noaa.dwml+xml
OXML: application/vnd.noaa.obs+xml
CAP: application/cap+xml
ATOM: application/atom+xml
Endpoint Formats Details
/gridpoints/{wfo}/{x},{y} GeoJSON (default)
JSON-LD
Raw (commonly referred to as “gridded”) data provided by the Weather Office. Every forecast request will use this data to build the forecast response. The grid for a given location is determined by the “property.forecastGridData” property in the /points/{lat},{lon} endpoint.

Values
wfo: a weather office id
x: the grid x coordinate
y: the grid y coordinate
Example
/gridpoints/EAX/40,48

/points/{point} GeoJSON (default)
JSON-LD
Metadata about a point. This is the primary endpoint for forecast information for a location. It contains linked data for the forecast, the hourly forecast, observation and other information.

Values
point: EPSG:4326 latitude, EPSG:4326 longitude
Example
/points/39.0693,-94.6716

/points/{point}/forecast GeoJSON (default)
JSON-LD
DWML
Forecast data for a point. The DWML format is a temporary format to aid transition and will be sunset at a later date. This response is derrived from the /gridpoints endpoint and is intentionally less structured. If more structure is required, developers should use the /gridpoints endpoint directly.

Values
point: EPSG:4326 latitude, EPSG:4326 longitude
Example
/points/39.0693,-94.6716/forecast

/points/{point}/forecast/hourly GeoJSON (default)
JSON-LD
Hourly forecast data for a point. This response is derrived from the /gridpoints endpoint and is intentionally less structured. If more structure is required, developers should use the /gridpoints endpoint directly.

Values
point: EPSG:4326 latitude, EPSG:4326 longitude
Example
/points/39.0693,-94.6716/forecast/hourly

/points/{point}/stations GeoJSON (default)
JSON-LD
Stations nearest to a point in order of distance.

Values
point: EPSG:4326 latitude, EPSG:4326 longitude
Example
/points/39.0693,-94.6716/stations

/stations GeoJSON (default)
JSON-LD
A list of stations and station metadata that can be filtered by parameters. If no parameters are provided, then all stations are returned. This list is not configured by field offices and only returns active stations.

Values
none

Parameters
id, Station Id (comma-separated list of station ids)
state, State code (comma-separated list of US state abbreviations)
limit, Limit (an integer)
Example
/stations?limit=10 states=KS,MO

/stations/{stationId} GeoJSON (default)
JSON-LD
Metadata about a station. Similar to /stations endpoint with id parameter.

Values
stationId: the id of a station from the /points/{point}/stations endpoint
Example
/stations/KMKC

/stations/{stationId}/observations GeoJSON (default)
JSON-LD
A list of observations for a station.

NOTE! The API uses MADIS to provide observation data. The observation may be delayed while MADIS completes quality checks of the data. To limit the delay, the API is provided with incremental updates with various levels of checked data, and the API will return the variation of the observation with the most checked data. It is possible that no data is provided on the first variation, or that no data is checked on the first variation. It is up to the consumer to determine if the quality of data is appropriate. If not, the previous observation can be requested, or the next nearest station can be used. The API returns the state of the data for each value in the response, where “Z” (or “null”) is for not checked (and may never be for some values) and “V” for checked. Please refer to MADIS for complete documentation on their data quality process.

Values
stationId: a valid station id (e.g. as provided by the /points/{point}/stations endpoint)
Parameters
start, Start time (ISO8601DateTime)
end, End time (ISO8601DateTime)
limit, Limit (an integer)
Example
/stations/KMKC/observations

/stations/{stationId}/observations/current GeoJSON (default)
JSON-LD
OXML
The most current observation for a station. Due to a legacy requirement, this endpoint will support XML for the near future when using the Accept header. It is highly recommend that applications update to the JSON format.

NOTE! See note in /stations/{stationId}/observations for important details on observation data.

Values
stationId: Station Id (e.g. as provided by the /points/{point}/stations endpoint)
Example
/stations/KMKC/observations/current

/stations/{stationId}/observations/{recordId} GeoJSON (default)
JSON-LD
Data for a specific observation.

NOTE! See note in /stations/{stationId}/observations for important details on observation data.

Values
stationsId: Station id
recordId, Record Id (ISO8601DateTime)
Example
/stations/KMKC/observations/2017-01-04T18:54:00+00:00

/products/{productId} JSON-LD
Data of a product.

Values
productId: an id provided by from another /product endpoint
Example
/product/NWS-IDP-PROD-2202326-2064512 (this id is likely now an expired product)

/products/types JSON-LD
A list of product types with an active product

Values
none

Example
/products/types

/products/types/{typeId} JSON-LD
A list of producuts by type.

Values
typeId: an id of a valid product type
Example
/products/types/AFD

/products/types/{typeId}/locations JSON-LD
A list of locations that have issues products for a type.

Values
typeId: an id of a valid product type (list forthcoming)
Example
/products/types/AFD/locations

/products/types/{typeId}/locations/{locationId} JSON-LD
A product for a location that has issued a product for a specific type.

Values
typeId: an id of a valid product type
locationId: an id of a valid location (list forthcoming)
Example
/products/types/AFD/locations/EAX

/products/locations JSON-LD
A list of locations with active products.

Values
none

Example
/products/locations

/products/locations/{locationId}/types JSON-LD
A list of active products by type for a specific location.

Values
locationId: an id of a valid location
Example
/products/locations/EAX/types

/offices/{officeId} JSON-LD
Metadata about a Weather Office.

Values
officeId: a weather office id
Example
/offices/EAX

/zones/{type}/{zoneId} GeoJSON (default)
JSON-LD
Metadata for a zone.

Values
type: a valid zone type (list forthcoming)
zoneId: a zone id (list forthcoming)
Example
/zones/forecast/MOZ028

/zones/{type}/{zoneId}/forecast GeoJSON (default)
JSON-LD
Forecast data for zone.

Values
type: a valid zone type (list forthcoming)
zoneId: a zone id (list forthcoming)
Example
/zones/forecast/MOZ028/forecast

/alerts?{parameters} JSON-LD (default)
ATOM
A list of alerts that can be filtered by parameters. If no parameters are provided, then all alerts are returned. The ATOM format returns items in CAP-ATOM.

Values
none

Parameters
active, Active alerts (1 or 0)
start, Start time (ISO8601DateTime)
end, End time (ISO8601DateTime)
status, Event status (alert, update, cancel)
type, Event type (list forthcoming)
zone_type, Zone type (land or marine)
point, Point (latitude,longitude)
region, Region code (list forthcoming)
state, State/marine code (list forthcoming)
zone, Zone Id (forecast or county, list forthcoming)
urgency, Urgency (expected, immediate)
severity, Severity (minor, moderate, severe)
certainty, Certainty (likely, observed)
limit, Limit (an integer)
Example
/alerts?active=1

/alerts/active JSON-LD (default)
ATOM
A list of active alerts that can be filtered by parameters. Uses same parameters as the /alerts endpoint, but sets “active” parameter to 1 and ignores “start” and “end” parameters. The ATOM format returns items in CAP-ATOM.

Values
none

Example
/alerts/active

/alerts/{alertId} JSON-LD (default)
CAP
A specific alert by id provided by a search or list.

Values
alertId: an active alert id provided by another endpoint
Example
/alerts/NWS-IDP-PROD-2202530-2064731

/alerts/active/count JSON-LD (default)
A list of active counts for regions, areas and zones. A list of these items forthcoming.

Values
none

Example
/alerts/active/count

/alerts/active/zone/{zoneId} JSON-LD (default)
ATOM
A list of active alerts by zone id. The ATOM format returns items in CAP-ATOM.

Values
zoneId: a valid zone, see list in counts endpoint
Example
/alerts/active/zone/ILZ081

/alerts/active/area/{area} JSON-LD (default)
ATOM
A list of active alerts by area. The ATOM format returns items in CAP-ATOM.

Values
area: a valid area, see list in counts endpoint
Example
/alerts/active/area/KS

/alerts/active/region/{region} JSON-LD (default)
ATOM
A list of active alerts by region. The ATOM format returns items in CAP-ATOM.

Values
area: a valid region, see list in counts endpoint
Example
/alerts/active/region/GL

Відстежувачі: 45
Ресурси:
Веб-сайт продукту
Створювач API:
Rapid account: API Guy
API Guy
theapiguy
Увійти в «Ставки по API»
Рейтинг: 3.5 - Голосів: 2