> For the complete documentation index, see [llms.txt](https://doc.duaer.com/zh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/zh/getting-started/weather-history.md).

# 在 Duaer 里查历史天气

在 Duaer 里：任意地点自 1940 年以来的历史天气：按日或按月给出平均、最高、最低气温与降水，数据来自 Open-Meteo 再分析档案。一次成功查询用 1 额度。
## 能拿到什么

Duaer 数据市场里的「历史天气」：任意地点自 1940 年以来的历史天气：按日或按月给出平均、最高、最低气温与降水，数据来自 Open-Meteo 再分析档案。查到结果时用 1 额度，结果交给数字组织的下一个节点。

从节点创建器选 Duaer 数据 → 历史天气，或打开 [数据市场](/zh/getting-started/data-market.md)。相关：[天气预报](/zh/getting-started/weather.md)、[河流流量](/zh/getting-started/river-flow.md)。

## 适合做什么

- 把某个季节或月份与往年对比，或用天气解释销量、产量的变化。
- 为现场考察、收获或施工计划做一张逐月气候表。

## 在画布里检索

1. 打开节点创建器，选 Duaer 数据 → Weather history。
2. 填 Place（或 Latitude + Longitude）、From 与 To（YYYY-MM-DD，范围不超过十年）；Step 可选 day 或 month。
3. Limit 默认 10，最大 20。执行。

查到结果才扣 1 额度；没有结果、输入有误或上游失败都不扣。

## 用 API 调用

- GET https://api.duaer.com/v1/data/weather-history?place=Beijing&from=2024-01-01&to=2024-12-31&step=month
- Authorization: Bearer <Duaer key>

下方是与数据市场「复制技能」相同的英文技能，含参数、示例与返回字段。

## 调用技能（英文）

与数据市场「复制技能」一致。

```
---
name: duaer-weather-history
description: >-
  Duaer Weather history. Past weather back to 1940 for any place: daily or monthly mean, high, low, and rainfall from the Open-Meteo reanalysis archive.
  One successful search uses 1 Duaer credit.
---

# Duaer Weather history

Duaer Weather history returns past daily or monthly weather for a place from the Open-Meteo historical archive (ERA5 reanalysis). Use `step=month` to fold a year or more into twelve readable rows.

## When to use

- Compare a season or a month with past years, or explain a sales or yield change by weather.
- Build a monthly climate table for a site before a visit, a harvest, or a construction plan.

## When not to use

- The next days. Use https://skills.duaer.com/weather.md.
- Recent days: the archive lags about five days behind today.

## Call

`GET https://api.duaer.com/v1/data/weather-history?place=Beijing&from=2024-01-01&to=2024-12-31&step=month`

Header: `Authorization: Bearer <Duaer key>`

Use an account key or a model API key.

Get a Duaer key: https://skills.duaer.com/keys.md

## Parameters

Provide `place`, or `latitude` and `longitude`, plus `from` and `to`.

- `place` — City or place name. Leave empty when you enter latitude and longitude.
- `latitude` — Optional. Decimal degrees from -90 to 90. Use with longitude instead of a place.
- `longitude` — Optional. Decimal degrees from -180 to 180.
- `from` — First day, YYYY-MM-DD. The archive starts in 1940.
- `to` — Last day, YYYY-MM-DD. Recent days appear after about five days.
- `step` — Optional. day or month. Month sums rain and averages temperature. Default day.
- `limit` — Optional. Rows to return, from 1 to 20. Default 10.

## Examples

- `GET https://api.duaer.com/v1/data/weather-history?place=Beijing&from=2024-01-01&to=2024-12-31&step=month` — monthly climate for 2024.
- `GET https://api.duaer.com/v1/data/weather-history?latitude=40.7&longitude=-74&from=2012-10-27&to=2012-10-31` — daily rows around a storm.

## Result

The response is `{ "items": [...] }`. Each item has `source`, `title`, `url`, and `summary`, plus:

- `place`, `latitude`, `longitude` — where the rows are for.
- `period` — YYYY-MM-DD for daily rows or YYYY-MM for monthly rows.
- `step` — day or month.
- `days` — days folded into the row.
- `temperatureMean`, `temperatureMax`, `temperatureMin` — °C. Monthly rows average the means and keep the extreme high and low.
- `precipitationMm` — total rain or snow water in mm.

Fields without a value are left out.

## Credits

A search that returns at least one row uses 1 credit.
An empty search, a search that finds nothing, or a failed search uses 0.
Wrong input returns 400 with a message and uses 0.
No remaining credits returns 402 and does not search.
A missing key returns 401.

## Related

- https://skills.duaer.com/weather.md — Duaer Weather forecast
- https://skills.duaer.com/river-flow.md — Duaer River flow

```
## Questions

### Duaer 的历史天气检索扣多少额度？

查到结果时扣 1 额度；没有结果或出错不扣。

### Duaer 历史天气能查多早？

Duaer 历史天气最早到 1940 年，最新约为五天前；一次最多查十年。

## 相关

- [在 Duaer 里查天气预报](https://doc.duaer.com/zh/getting-started/weather.md)
- [在 Duaer 里查河流流量](https://doc.duaer.com/zh/getting-started/river-flow.md)

