OpenWeatherMap History API

Historical weather records by coordinate with hourly granularity.

Documentation

Specifications

Schemas & Data

Other Resources

🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/current-weather-example.json
🔗
GraphQL
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/graphql/openweathermap-graphql.md
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/forecast-five-day-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/one-call-current-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/air-pollution-current-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/geocoding-direct-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/history-city-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/statistical-month-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/accumulated-temperature-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/solar-irradiance-interval-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/road-risk-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/weather-stations-create-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/openweathermap/refs/heads/main/examples/weather-maps-tile-example.json

OpenAPI Specification

openweathermap-history-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: OpenWeatherMap Accumulated Parameters History API
  version: 2.5.0
  description: Returns accumulated temperature and accumulated precipitation totals over a user-specified historical time window. Targeted at agricultural and energy-sector applications. Available on Professional and Expert plans.
  contact:
    name: OpenWeather
    url: https://openweathermap.org/api/accumulated-parameters
  license:
    name: Creative Commons Attribution-ShareAlike 4.0 International
    url: https://creativecommons.org/licenses/by-sa/4.0/
servers:
- url: https://history.openweathermap.org/data/2.5/history
  description: Accumulated Parameters API base URL
security:
- appid: []
tags:
- name: History
  description: Historical weather records by coordinate with hourly granularity.
paths:
  /history/city:
    get:
      operationId: getHistoricalWeatherCity
      summary: Historical Hourly Weather By Coordinate
      description: Returns hourly historical weather records for the supplied latitude, longitude, and time window. Maximum request span on Professional and Expert plans is one week per call.
      tags:
      - History
      parameters:
      - name: lat
        in: query
        required: true
        description: Latitude in decimal degrees.
        schema:
          type: number
          format: float
      - name: lon
        in: query
        required: true
        description: Longitude in decimal degrees.
        schema:
          type: number
          format: float
      - name: type
        in: query
        required: true
        description: Granularity. Currently only `hour` is supported.
        schema:
          type: string
          enum:
          - hour
      - name: start
        in: query
        required: false
        description: Unix UTC start timestamp.
        schema:
          type: integer
          format: int64
      - name: end
        in: query
        required: false
        description: Unix UTC end timestamp. Alternative to `cnt`.
        schema:
          type: integer
          format: int64
      - name: cnt
        in: query
        required: false
        description: Number of hourly timestamps to return. Alternative to `end`.
        schema:
          type: integer
      - name: units
        in: query
        required: false
        schema:
          type: string
          enum:
          - standard
          - metric
          - imperial
      - name: appid
        in: query
        required: true
        description: OpenWeather API key.
        schema:
          type: string
      responses:
        '200':
          description: Historical weather response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricalWeatherResponse'
        '400':
          description: Invalid request parameters.
        '401':
          description: Unauthorized.
        '429':
          description: Too many requests.
components:
  schemas:
    HistoricalWeatherResponse:
      type: object
      properties:
        message:
          type: string
        cod:
          type: string
        city_id:
          type: integer
        calctime:
          type: number
          format: float
        list:
          type: array
          items:
            $ref: '#/components/schemas/HistoricalWeatherListItem'
    HistoricalWeatherListItem:
      type: object
      properties:
        dt:
          type: integer
          format: int64
        main:
          type: object
          properties:
            temp:
              type: number
              format: float
            feels_like:
              type: number
              format: float
            pressure:
              type: integer
            humidity:
              type: integer
            temp_min:
              type: number
              format: float
            temp_max:
              type: number
              format: float
            sea_level:
              type: integer
            grnd_level:
              type: integer
        wind:
          type: object
          properties:
            speed:
              type: number
              format: float
            deg:
              type: integer
        clouds:
          type: object
          properties:
            all:
              type: integer
        rain:
          type: object
          properties:
            1h:
              type: number
              format: float
            3h:
              type: number
              format: float
        snow:
          type: object
          properties:
            1h:
              type: number
              format: float
            3h:
              type: number
              format: float
        weather:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              main:
                type: string
              description:
                type: string
              icon:
                type: string
  securitySchemes:
    appid:
      type: apiKey
      in: query
      name: appid