openapi: 3.0.1
info:
title: Weatherbit - Interactive Swagger UI Documentation 16 Day / Daily Forecast Air Quality Forecast API
description: This an interactive version of the documentation for the Weatherbit API. The base URL for the API is [http://api.weatherbit.io/v2.0/](http://api.weatherbit.io/v2.0/) or [https://api.weatherbit.io/v2.0/](http://api.weatherbit.io/v2.0/). Below is the Swagger UI documentation for the API. All API requests require the `key` parameter. An Example for a 48 hour forecast for London, UK would be `http://api.weatherbit.io/v2.0/forecast/hourly?lat=51.5072`&`lon=-0.1276`. See our [Weather API description page](https://www.weatherbit.io/api) for the full documentation.
version: 2.0.0
servers:
- url: https://api.weatherbit.io/v2.0
- url: http://api.weatherbit.io/v2.0
tags:
- name: Air Quality Forecast
paths:
/forecast/airquality:
get:
tags:
- Air Quality Forecast
summary: Weatherbit Returns 72 Hour (hourly) Air Quality Forecast - Given a Geolocation.
description: Returns 72 hour (hourly) Air Quality forecast, where each point represents a one hour period.
parameters:
- name: lat
in: query
description: Latitude component of location.
schema:
type: number
format: double
example: 40.04
- name: lon
in: query
description: Longitude component of location.
schema:
type: number
format: double
example: 59.0
- name: city_id
in: query
description: 'City ID. Example: 4487042'
schema:
type: string
format: string
example: Kansas City
- name: city
in: query
description: City search.. Example - &city=Raleigh,NC or &city=Berlin,DE or city=Paris&country=FR
schema:
type: string
format: string
example: Kansas City
- name: postal_code
in: query
description: 'Postal Code. Example: 28546'
schema:
type: string
format: string
example: example-value
- name: country
in: query
description: Country Code (2 letter) - to be used with postal_code.
schema:
type: string
format: string
example: US
- name: key
in: query
description: Your registered API key.
required: true
schema:
type: string
format: string
example: abc123xyz
- name: hours
in: query
description: Number of hours to return.
schema:
type: integer
format: integer
example: 17
responses:
'200':
description: A forecast object.
content:
application/json:
schema:
$ref: '#/components/schemas/AQHourly'
default:
description: No Data.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
components:
schemas:
AQHourly:
type: object
properties:
city_name:
type: string
description: City Name
example: Raleigh
state_code:
type: string
description: State Abbreviation
example: NC
country_code:
type: string
description: Country Abbreviation
example: US
lat:
type: number
description: Latitude
example: 38.25
lon:
type: number
description: Longitude
example: -78.0
timezone:
type: string
description: Local IANA time zone
example: America/New_York
data:
type: array
items:
$ref: '#/components/schemas/AQHour'
AQHour:
type: object
properties:
ts:
type: number
description: Unix Timestamp
example: 1551718800
timestamp_local:
type: string
description: Timestamp in local time
example: 2019-03-04 12:00:00
timestamp_utc:
type: string
description: Timestamp UTC
example: 2019-03-04 17:00:00
aqi:
type: integer
description: Cloud cover as a percentage (%)
example: 100
so2:
type: number
description: Concentration of SO2 (µg/m³)
example: 50.0
no2:
type: number
description: Concentration of NO2 (µg/m³)
example: 25.0
o3:
type: number
description: Concentration of O3 (µg/m³)
example: 2.0
pm25:
type: number
description: Concentration of PM 2.5 (µg/m³)
example: 230.0
pm10:
type: number
description: Concentration of PM 10 (µg/m³)
example: 150.0
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string