openapi: 3.0.1
info:
title: Weatherbit - Interactive Swagger UI Documentation 16 Day / Daily Forecast Historical Air Quality 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: Historical Air Quality
paths:
/history/airquality:
get:
tags:
- Historical Air Quality
summary: Weatherbit Returns 72 Hours of Historical Air Quality Conditions - Given a Geolocation.
description: Returns historical air quality conditions. See https://www.weatherbit.io/api for API specific rate limits.
parameters:
- name: lat
in: query
description: Latitude component of location.
schema:
type: number
format: double
example: 92.56
- name: lon
in: query
description: Longitude component of location.
schema:
type: number
format: double
example: 53.13
- 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
responses:
'200':
description: Historical air quality conditions
content:
application/json:
schema:
$ref: '#/components/schemas/AQCurrentGroup'
default:
description: No Data.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
components:
schemas:
AQCurrent:
type: object
properties:
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
AQCurrentGroup:
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/AQCurrent'