Time Machine for Weather

Platform: API iOS Android

Get the last 10 days of weather history data.

Let’s say, today is December 30, you can get historical data from Dec. 20 to Dec. 29.

QWeather also provides historical reanalysis weather data from 2000 to present. If you need long time historical weather data data, please provide the following information to sales@qweather.com.

  • Company name
  • Contact information
  • City or coordinates
  • Date range

Request URL

https://api.qweather.com/v7/historical/weather?{QueryParams}

Request parameters

All parameters are separated by &. If no optional parameters are set, the default value will be used.

  • location(required)The location to be queried, only support LocationID and LocationID can be obtained by GeoAPI. For example: location=101010100
  • date(required)Set the date, up to the most recent 10 days. The date format is yyyyMMdd. Example: date=20200531
  • key(required)API authentication key, please refer to How To Get Your Key. Support Signature Authentication. Example: key=12334567890ABC
  • langMulti-language setting, please see Language to find out how our multi-language works and how to set up.
  • unitSet weather data unit, the available value are unit=m for metric(default) and unit=i for imperial. See more about Unit.

Request Example

Historical weather data for Beijing, replace “date=20200725” with the last 10 days.

curl -L -X GET --compressed 'https://api.qweather.com/v7/historical/weather?location=101010100&date=20200725&key=YOUR_KEY'

Response

The response is in JSON format and is Gzip compressed.

{
  "code": "200",
  "fxLink": "http://hfx.link/2ax6",
  "weatherDaily": {
    "date": "2020-07-25",
    "sunrise": "05:08",
    "sunset": "19:33",
    "moonrise": "09:54",
    "moonset": "22:40",
    "moonPhase": "峨眉月",
    "tempMax": "33",
    "tempMin": "23",
    "humidity": "52",
    "precip": "0.0",
    "pressure": "1000"
  },
  "weatherHourly": [
    {
      "time": "2020-07-25 00:00",
      "temp": "28",
      "icon": "100",
      "text": "晴",
      "precip": "0.0",
      "wind360": "246",
      "windDir": "西南风",
      "windScale": "2",
      "windSpeed": "8",
      "humidity": "49",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 01:00",
      "temp": "27",
      "icon": "101",
      "text": "多云",
      "precip": "0.0",
      "wind360": "350",
      "windDir": "北风",
      "windScale": "1",
      "windSpeed": "4",
      "humidity": "57",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 02:00",
      "temp": "25",
      "icon": "100",
      "text": "晴",
      "precip": "0.0",
      "wind360": "175",
      "windDir": "南风",
      "windScale": "2",
      "windSpeed": "7",
      "humidity": "63",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 03:00",
      "temp": "25",
      "icon": "104",
      "text": "阴",
      "precip": "0.0",
      "wind360": "359",
      "windDir": "北风",
      "windScale": "1",
      "windSpeed": "5",
      "humidity": "68",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 04:00",
      "temp": "23",
      "icon": "100",
      "text": "晴",
      "precip": "0.0",
      "wind360": "126",
      "windDir": "东南风",
      "windScale": "1",
      "windSpeed": "3",
      "humidity": "73",
      "pressure": "1000"
    },
    {
      "time": "2020-07-25 05:00",
      "temp": "23",
      "icon": "100",
      "text": "晴",
      "precip": "0.0",
      "wind360": "166",
      "windDir": "东南风",
      "windScale": "1",
      "windSpeed": "4",
      "humidity": "76",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 06:00",
      "temp": "23",
      "icon": "100",
      "text": "晴",
      "precip": "0.0",
      "wind360": "69",
      "windDir": "东北风",
      "windScale": "1",
      "windSpeed": "2",
      "humidity": "75",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 07:00",
      "temp": "26",
      "icon": "104",
      "text": "阴",
      "precip": "0.0",
      "wind360": "358",
      "windDir": "北风",
      "windScale": "1",
      "windSpeed": "4",
      "humidity": "71",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 08:00",
      "temp": "28",
      "icon": "104",
      "text": "阴",
      "precip": "0.0",
      "wind360": "189",
      "windDir": "南风",
      "windScale": "1",
      "windSpeed": "3",
      "humidity": "57",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 09:00",
      "temp": "30",
      "icon": "104",
      "text": "阴",
      "precip": "0.0",
      "wind360": "350",
      "windDir": "北风",
      "windScale": "1",
      "windSpeed": "3",
      "humidity": "48",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 10:00",
      "temp": "32",
      "icon": "104",
      "text": "阴",
      "precip": "0.0",
      "wind360": "180",
      "windDir": "南风",
      "windScale": "1",
      "windSpeed": "2",
      "humidity": "48",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 11:00",
      "temp": "33",
      "icon": "101",
      "text": "多云",
      "precip": "0.0",
      "wind360": "177",
      "windDir": "南风",
      "windScale": "2",
      "windSpeed": "6",
      "humidity": "40",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 12:00",
      "temp": "32",
      "icon": "101",
      "text": "多云",
      "precip": "0.0",
      "wind360": "222",
      "windDir": "西南风",
      "windScale": "2",
      "windSpeed": "10",
      "humidity": "39",
      "pressure": "1001"
    },
    {
      "time": "2020-07-25 13:00",
      "temp": "32",
      "icon": "101",
      "text": "多云",
      "precip": "0.0",
      "wind360": "187",
      "windDir": "南风",
      "windScale": "2",
      "windSpeed": "10",
      "humidity": "40",
      "pressure": "1000"
    },
    {
      "time": "2020-07-25 14:00",
      "temp": "33",
      "icon": "101",
      "text": "多云",
      "precip": "0.0",
      "wind360": "266",
      "windDir": "西风",
      "windScale": "2",
      "windSpeed": "9",
      "humidity": "36",
      "pressure": "1000"
    },
    {
      "time": "2020-07-25 15:00",
      "temp": "32",
      "icon": "101",
      "text": "多云",
      "precip": "0.0",
      "wind360": "183",
      "windDir": "南风",
      "windScale": "1",
      "windSpeed": "2",
      "humidity": "39",
      "pressure": "1000"
    },
    {
      "time": "2020-07-25 16:00",
      "temp": "32",
      "icon": "101",
      "text": "多云",
      "precip": "0.0",
      "wind360": "189",
      "windDir": "南风",
      "windScale": "1",
      "windSpeed": "4",
      "humidity": "39",
      "pressure": "999"
    },
    {
      "time": "2020-07-25 17:00",
      "temp": "32",
      "icon": "101",
      "text": "多云",
      "precip": "0.0",
      "wind360": "173",
      "windDir": "南风",
      "windScale": "1",
      "windSpeed": "5",
      "humidity": "42",
      "pressure": "999"
    },
    {
      "time": "2020-07-25 18:00",
      "temp": "32",
      "icon": "101",
      "text": "多云",
      "precip": "0.0",
      "wind360": "173",
      "windDir": "南风",
      "windScale": "2",
      "windSpeed": "9",
      "humidity": "39",
      "pressure": "999"
    },
    {
      "time": "2020-07-25 19:00",
      "temp": "31",
      "icon": "101",
      "text": "多云",
      "precip": "0.0",
      "wind360": "185",
      "windDir": "南风",
      "windScale": "1",
      "windSpeed": "4",
      "humidity": "46",
      "pressure": "999"
    },
    {
      "time": "2020-07-25 20:00",
      "temp": "30",
      "icon": "104",
      "text": "阴",
      "precip": "0.0",
      "wind360": "185",
      "windDir": "南风",
      "windScale": "2",
      "windSpeed": "8",
      "humidity": "44",
      "pressure": "999"
    },
    {
      "time": "2020-07-25 21:00",
      "temp": "29",
      "icon": "104",
      "text": "阴",
      "precip": "0.0",
      "wind360": "208",
      "windDir": "西南风",
      "windScale": "2",
      "windSpeed": "7",
      "humidity": "52",
      "pressure": "1000"
    },
    {
      "time": "2020-07-25 22:00",
      "temp": "29",
      "icon": "104",
      "text": "阴",
      "precip": "0.0",
      "wind360": "188",
      "windDir": "南风",
      "windScale": "2",
      "windSpeed": "7",
      "humidity": "57",
      "pressure": "1000"
    },
    {
      "time": "2020-07-25 23:00",
      "temp": "28",
      "icon": "104",
      "text": "阴",
      "precip": "0.0",
      "wind360": "180",
      "windDir": "南风",
      "windScale": "1",
      "windSpeed": "5",
      "humidity": "61",
      "pressure": "1000"
    }
  ],
  "refer": {
    "sources": [
      "QWeather"
    ],
    "license": [
      "QWeather Developers License"
    ]
  }
}
  • code See Status Code
  • fxLink Responsive web page of this data, for embedded in website or APP
  • weatherDaily.date Date
  • weatherDaily.sunrise Sunrise time. Maybe null in high latitude area
  • weatherDaily.sunset Sunset time. Maybe null in high latitude area
  • weatherDaily.moonrise Moonrise time of current day. Maybe null
  • weatherDaily.moonset Moonset time of current day. Maybe null
  • weatherDaily.moonPhase Moon phase name
  • weatherDaily.tempMax The highest temperature of the day
  • weatherDaily.tempMin The lowest temperature of the day
  • weatherDaily.precip Estimated total precipitation for the day
  • weatherDaily.pressure Atmospheric pressure, hPa
  • weatherDaily.humidity Hourly relative humidity in percent
  • weatherHourly.time Time of the day
  • weatherHourly.temp Hourly temperature
  • weatherHourly.icon Icon code for hourly weather conditions of the day. See also QWeather Icons
  • weatherHourly.text Hourly weather condition
  • weatherHourly.wind360 Hourly wind direction in azimuth degree
  • weatherHourly.windDir Hourly wind direction
  • weatherHourly.windScale Hourly wind scale
  • weatherHourly.windSpeed Hourly wind speed, KM/H
  • weatherHourly.humidity Hourly relative humidity in percent
  • weatherHourly.precip Hourly accumulated precipitation
  • weatherHourly.pressure Atmospheric pressure, hPa
  • refer.sources Data source and other statements, may be null
  • refer.license Data license, may be null