Skip to content

Instantly share code, notes, and snippets.

@miqui
Created February 5, 2018 03:27
Show Gist options
  • Save miqui/96c7170e97d773e0615db7b8bfa4b87e to your computer and use it in GitHub Desktop.
Save miqui/96c7170e97d773e0615db7b8bfa4b87e to your computer and use it in GitHub Desktop.
weather gov api swagger openapi
swagger: '2.0'
info:
title: weather.gov API
description: |
# 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.
version: 1.0.0
host: api.weather.gov
schemes:
- https
paths:
/alerts:
get:
parameters:
- name: active
in: query
description: Active alerts
type: boolean
- name: start
in: query
description: Start time
type: string
format: date-time
- name: end
in: query
description: End time
type: string
format: date-time
- name: status
in: query
description: 'Status (actual, exercise, system, test, draft)'
type: array
collectionFormat: csv
items:
type: string
enum:
- actual
- exercise
- system
- test
- draft
- name: message_type
in: query
description: 'Message type (alert, update, cancel)'
type: array
collectionFormat: csv
items:
type: string
enum:
- alert
- update
- cancel
- name: event
in: query
description: Event name
type: array
collectionFormat: csv
items:
type: string
format: '^[A-Za-z0-9 ]+$'
- name: code
in: query
description: Event code
type: array
collectionFormat: csv
items:
type: string
format: '^\w{3}$'
- name: region_type
in: query
description: Region type (land or marine)
type: string
enum:
- land
- marine
- name: point
in: query
description: 'Point (latitude,longitude)'
type: string
format: '^(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)$'
- name: region
in: query
description: Region code
type: array
collectionFormat: csv
items:
type: string
enum:
- AR
- CR
- ER
- PR
- SR
- WR
- AL
- AT
- GL
- GM
- PA
- PI
- name: state
in: query
description: State/marine area code
type: array
collectionFormat: csv
items:
type: string
enum:
- AL
- AK
- AS
- AR
- AZ
- CA
- CO
- CT
- DE
- DC
- FL
- GA
- GU
- HI
- ID
- IL
- IN
- IA
- KS
- KY
- LA
- ME
- MD
- MA
- MI
- MN
- MS
- MO
- MT
- NE
- NV
- NH
- NJ
- NM
- NY
- NC
- ND
- OH
- OK
- OR
- PA
- PR
- RI
- SC
- SD
- TN
- TX
- UT
- VT
- VI
- VA
- WA
- WV
- WI
- WY
- name: zone
in: query
description: Zone ID (forecast or county)
type: array
collectionFormat: csv
items:
type: string
format: '^\w{2}[CZ]\d{3}$'
- name: urgency
in: query
description: 'Urgency (immediate, expected, future, past, unknown)'
type: array
collectionFormat: csv
items:
type: string
enum:
- unknown
- past
- future
- expected
- immediate
- name: severity
in: query
description: 'Severity (extreme, severe, moderate, minor, unknown)'
type: array
collectionFormat: csv
items:
type: string
enum:
- unknown
- minor
- moderate
- severe
- extreme
- name: certainty
in: query
description: 'Certainty (observed, likely, possible, unlikely, unknown)'
type: array
collectionFormat: csv
items:
type: string
enum:
- unknown
- unlikely
- possible
- likely
- observed
- name: limit
in: query
description: Limit
type: integer
minimum: 1
maximum: 500
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
/alerts/active:
get:
parameters:
- name: status
in: query
description: 'Status (actual, exercise, system, test, draft)'
type: array
collectionFormat: csv
items:
type: string
enum:
- actual
- exercise
- system
- test
- draft
- name: message_type
in: query
description: 'Message type (alert, update, cancel)'
type: array
collectionFormat: csv
items:
type: string
enum:
- alert
- update
- cancel
- name: event
in: query
description: Event name
type: array
collectionFormat: csv
items:
type: string
format: '^[A-Za-z0-9 ]+$'
- name: code
in: query
description: Event code
type: array
collectionFormat: csv
items:
type: string
format: '^\w{3}$'
- name: region_type
in: query
description: Region type (land or marine)
type: string
enum:
- land
- marine
- name: point
in: query
description: 'Point (latitude,longitude)'
type: string
format: '^(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)$'
- name: region
in: query
description: Region code
type: array
collectionFormat: csv
items:
type: string
enum:
- AR
- CR
- ER
- PR
- SR
- WR
- AL
- AT
- GL
- GM
- PA
- PI
- name: state
in: query
description: State/marine area code
type: array
collectionFormat: csv
items:
type: string
enum:
- AL
- AK
- AS
- AR
- AZ
- CA
- CO
- CT
- DE
- DC
- FL
- GA
- GU
- HI
- ID
- IL
- IN
- IA
- KS
- KY
- LA
- ME
- MD
- MA
- MI
- MN
- MS
- MO
- MT
- NE
- NV
- NH
- NJ
- NM
- NY
- NC
- ND
- OH
- OK
- OR
- PA
- PR
- RI
- SC
- SD
- TN
- TX
- UT
- VT
- VI
- VA
- WA
- WV
- WI
- WY
- name: zone
in: query
description: Zone ID (forecast or county)
type: array
collectionFormat: csv
items:
type: string
format: '^\w{2}[CZ]\d{3}$'
- name: urgency
in: query
description: 'Urgency (immediate, expected, future, past, unknown)'
type: array
collectionFormat: csv
items:
type: string
enum:
- unknown
- past
- future
- expected
- immediate
- name: severity
in: query
description: 'Severity (extreme, severe, moderate, minor, unknown)'
type: array
collectionFormat: csv
items:
type: string
enum:
- unknown
- minor
- moderate
- severe
- extreme
- name: certainty
in: query
description: 'Certainty (observed, likely, possible, unlikely, unknown)'
type: array
collectionFormat: csv
items:
type: string
enum:
- unknown
- unlikely
- possible
- likely
- observed
- name: limit
in: query
description: Limit
type: integer
minimum: 1
maximum: 500
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/alerts/{id}':
get:
parameters:
- name: id
in: path
required: true
type: string
format: '^(?:\w+-)+(?:\d+-?)+$'
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
/alerts/types:
get:
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
/alerts/active/count:
get:
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/alerts/active/zone/{zoneId}':
get:
parameters:
- name: zoneId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/alerts/active/area/{area}':
get:
parameters:
- name: area
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/alerts/active/region/{region}':
get:
parameters:
- name: region
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
/glossary:
get:
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/gridpoints/{wfo}/{x},{y}':
get:
parameters:
- name: wfo
in: path
required: true
type: string
format: '^\w{3}$'
- name: x
in: path
required: true
type: integer
minimum: 0
- name: 'y'
in: path
required: true
type: integer
minimum: 0
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/gridpoints/{wfo}/{x},{y}/forecast':
get:
parameters:
- name: wfo
in: path
required: true
type: string
format: '^\w{3}$'
- name: x
in: path
required: true
type: integer
minimum: 0
- name: 'y'
in: path
required: true
type: integer
minimum: 0
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/gridpoints/{wfo}/{x},{y}/forecast/hourly':
get:
parameters:
- name: wfo
in: path
required: true
type: string
format: '^\w{3}$'
- name: x
in: path
required: true
type: integer
minimum: 0
- name: 'y'
in: path
required: true
type: integer
minimum: 0
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/gridpoints/{wfo}/{x},{y}/stations':
get:
parameters:
- name: wfo
in: path
required: true
type: string
format: '^\w{3}$'
- name: x
in: path
required: true
type: integer
minimum: 0
- name: 'y'
in: path
required: true
type: integer
minimum: 0
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/icons/{set}/{timeOfDay}/{first}/{second}':
get:
parameters:
- name: set
in: path
required: true
type: string
- name: timeOfDay
in: path
required: true
type: string
- name: first
in: path
required: true
type: string
- name: second
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
/icons:
get:
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/thumbnails/satellite/{area}':
get:
parameters:
- name: area
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/stations/{stationId}/observations':
get:
parameters:
- name: stationId
in: path
required: true
type: string
- name: station
in: query
description: Station ID
type: array
collectionFormat: csv
items:
type: string
- name: start
in: query
description: Start date/time
type: string
format: date-time
- name: end
in: query
description: End date/time
type: string
format: date-time
- name: limit
in: query
description: Limit
type: integer
minimum: 1
maximum: 500
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/stations/{stationId}/observations/{recordId}':
get:
parameters:
- name: stationId
in: path
required: true
type: string
- name: recordId
in: path
required: true
type: string
- name: require_qc
in: query
description: Require QC
type: boolean
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
/stations:
get:
parameters:
- name: id
in: query
description: State abbreviation
type: array
collectionFormat: csv
items:
type: string
- name: state
in: query
description: State/marine area code
type: array
collectionFormat: csv
items:
type: string
enum:
- AL
- AK
- AS
- AR
- AZ
- CA
- CO
- CT
- DE
- DC
- FL
- GA
- GU
- HI
- ID
- IL
- IN
- IA
- KS
- KY
- LA
- ME
- MD
- MA
- MI
- MN
- MS
- MO
- MT
- NE
- NV
- NH
- NJ
- NM
- NY
- NC
- ND
- OH
- OK
- OR
- PA
- PR
- RI
- SC
- SD
- TN
- TX
- UT
- VT
- VI
- VA
- WA
- WV
- WI
- WY
- name: limit
in: query
description: Limit
type: integer
minimum: 1
maximum: 500
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
/stations/radar:
get:
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/stations/radar/{stationId}':
get:
parameters:
- name: stationId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/stations/{stationId}':
get:
parameters:
- name: stationId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/offices/{officeId}/config':
get:
parameters:
- name: officeId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/offices/{officeId}':
get:
parameters:
- name: officeId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/offices/{officeId}/headlines/{headlineId}':
get:
parameters:
- name: officeId
in: path
required: true
type: string
- name: headlineId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/offices/{officeId}/headlines':
get:
parameters:
- name: officeId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/points/{point}':
get:
parameters:
- name: point
in: path
required: true
type: string
format: '^(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)$'
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/points/{point}/stations':
get:
parameters:
- name: point
in: path
required: true
type: string
format: '^(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)$'
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/points/{point}/forecast':
get:
parameters:
- name: point
in: path
required: true
type: string
format: '^(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)$'
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/points/{point}/forecast/hourly':
get:
parameters:
- name: point
in: path
required: true
type: string
format: '^(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)$'
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
/products:
get:
parameters:
- name: location
in: query
description: Location id
type: array
collectionFormat: csv
items:
type: string
- name: start
in: query
description: Start time
type: string
format: date-time
- name: end
in: query
description: End time
type: string
format: date-time
- name: office
in: query
description: Issuing office
type: array
collectionFormat: csv
items:
type: string
format: '^\w{4}$'
- name: wmoid
in: query
description: WMO id code
type: array
collectionFormat: csv
items:
type: string
format: '^[A-Z]{4}\d{2}$'
- name: type
in: query
description: Product code
type: array
collectionFormat: csv
items:
type: string
format: '^\w{3}$'
- name: limit
in: query
description: Limit
type: integer
minimum: 1
maximum: 500
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
/products/locations:
get:
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
/products/types:
get:
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/products/{productId}':
get:
parameters:
- name: productId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/products/types/{typeId}':
get:
parameters:
- name: typeId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/products/types/{typeId}/locations':
get:
parameters:
- name: typeId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/products/locations/{locationId}/types':
get:
parameters:
- name: locationId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/products/types/{typeId}/locations/{locationId}':
get:
parameters:
- name: typeId
in: path
required: true
type: string
- name: locationId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/zones/cg/{zoneId}':
get:
parameters:
- name: zoneId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
/zones/cg:
get:
parameters:
- name: id
in: query
description: USCG zone ID
type: array
collectionFormat: csv
items:
type: string
format: '^\d{7}$'
- name: area
in: query
description: Atlantic or Pacific area
type: string
enum:
- atlantic
- pacific
- name: point
in: query
description: 'Point (latitude,longitude)'
type: string
format: '^(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)$'
- name: include_geometry
in: query
description: Include geometry in results (true/false)
type: boolean
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/zones/{type}':
get:
parameters:
- name: type
in: path
required: true
type: string
enum:
- land
- marine
- forecast
- public
- coastal
- offshore
- fire
- county
- name: id
in: query
description: Zone ID (forecast or county)
type: array
collectionFormat: csv
items:
type: string
format: '^\w{2}[CZ]\d{3}$'
- name: state
in: query
description: State/marine area code
type: array
collectionFormat: csv
items:
type: string
enum:
- AL
- AK
- AS
- AR
- AZ
- CA
- CO
- CT
- DE
- DC
- FL
- GA
- GU
- HI
- ID
- IL
- IN
- IA
- KS
- KY
- LA
- ME
- MD
- MA
- MI
- MN
- MS
- MO
- MT
- NE
- NV
- NH
- NJ
- NM
- NY
- NC
- ND
- OH
- OK
- OR
- PA
- PR
- RI
- SC
- SD
- TN
- TX
- UT
- VT
- VI
- VA
- WA
- WV
- WI
- WY
- name: region
in: query
description: Region code
type: array
collectionFormat: csv
items:
type: string
enum:
- AR
- CR
- ER
- PR
- SR
- WR
- AL
- AT
- GL
- GM
- PA
- PI
- name: type
in: query
description: Zone type
type: array
collectionFormat: csv
items:
type: string
enum:
- land
- marine
- forecast
- public
- coastal
- offshore
- fire
- county
- name: point
in: query
description: 'Point (latitude,longitude)'
type: string
format: '^(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)$'
- name: include_geometry
in: query
description: Include geometry in results (true/false)
type: boolean
- name: effective
in: query
description: Effective date/time
type: string
format: date-time
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/zones/{type}/{zoneId}':
get:
parameters:
- name: type
in: path
required: true
type: string
enum:
- forecast
- county
- fire
- cg
- name: zoneId
in: path
required: true
type: string
- name: effective
in: query
description: Effective date/time
type: string
format: date-time
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/zones/{type}/{zoneId}/forecast':
get:
parameters:
- name: type
in: path
required: true
type: string
- name: zoneId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/zones/forecast/{zoneId}/observations':
get:
parameters:
- name: zoneId
in: path
required: true
type: string
- name: start
in: query
description: Start date/time
type: string
format: date-time
- name: end
in: query
description: End date/time
type: string
format: date-time
- name: limit
in: query
description: Limit
type: integer
minimum: 1
maximum: 500
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
'/zones/forecast/{zoneId}/stations':
get:
parameters:
- name: zoneId
in: path
required: true
type: string
produces:
- application/ld+json
- application/geo+json
responses:
'200':
description: success
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment