开发者

API 参考

读数

单个传感器的历史——原始、5 分钟、每小时或每日——以及一组传感器的平均值。

传感器读数

GEThttps://api.atmy.ai/v1/sensors/{id}/readings

最近 31 天的原始读数或 5 分钟平均值(interval=5min,每次最多 7 天),或最近 366 天的小时平均值(interval=hour,每次最多 92 天),或带每日质量检查的日平均值(interval=day,每次最多一年)

路径参数

id string 必填

传感器 id,与传感器列表中一致。

查询参数

interval string 可选

raw、5min、hour 或 day。

默认值: raw

from string 可选

开始,ISO 8601 或 Unix 秒,UTC。

to string 可选

结束,ISO 8601 或 Unix 秒,UTC;默认现在。

GET/sensors/41504/readings?interval=day
curl "https://api.atmy.ai/v1/sensors/41504/readings?interval=day"
200响应
{
  "api_version": "2.0",
  "sensor_id": 41504,
  "interval": "day",
  "from": "2026-10-24T00:00:00+00:00",
  "to": "2026-10-26T00:00:00+00:00",
  "readings": [
    {
      "time": "2026-10-24T00:00:00+00:00",
      "readings": 96,
      "pm1": 21.26,
      "pm25": 32.51,
      "pm10": 36.47,
      "temperature_c": 17.01,
      "humidity_percent": 44.66,
      "quality": {
        "status": "good",
        "pm_eligible": true,
        "rating": 10
      }
    },
    {
      "time": "2026-10-25T00:00:00+00:00",
      "readings": 96,
      "pm1": 35.5,
      "pm25": 59.98,
      "pm10": 71.05,
      "temperature_c": 14.87,
      "humidity_percent": 55.7,
      "quality": {
        "status": "good",
        "pm_eligible": true,
        "rating": 10
      }
    }
  ],
  "attribution": "Sensor data: Atmy (atmy.ai), from the networks named in each sensor's \"network\", under that network's license.",
  "terms": "https://atmy.ai/legal/data/"
}

一组传感器的平均值

GEThttps://api.atmy.ai/v1/sensors/readings

最多 100 个传感器(ids=1,2,3)每 5 分钟或每小时的平均值,每个传感器只计一次,按天(interval=day)每次最多 92 天

查询参数

ids string 必填

以逗号分隔的传感器 id,1 到 100 个。

interval string 可选

5min、hour 或 day。

默认值: hour

from string 可选

开始,ISO 8601 或 Unix 秒,UTC。

to string 可选

结束,ISO 8601 或 Unix 秒,UTC;默认现在。

GET/sensors/readings?ids=41504,41752,43057&interval=hour
curl "https://api.atmy.ai/v1/sensors/readings?ids=41504,41752,43057&interval=hour"
200响应
{
  "api_version": "2.0",
  "sensor_ids": [
    41504,
    41752,
    43057
  ],
  "interval": "hour",
  "from": "2026-10-26T00:00:00+00:00",
  "to": "2026-10-26T02:00:00+00:00",
  "readings": [
    {
      "time": "2026-10-26T00:00:00+00:00",
      "sensors": 3,
      "readings": 12,
      "pm1": 41.04,
      "pm25": 68.88,
      "pm10": 81.14,
      "temperature_c": 15.53,
      "humidity_percent": 54.33,
      "tvoc": 279.55
    },
    {
      "time": "2026-10-26T01:00:00+00:00",
      "sensors": 3,
      "readings": 12,
      "pm1": 37.93,
      "pm25": 62.65,
      "pm10": 76.3,
      "temperature_c": 15.55,
      "humidity_percent": 55.33,
      "tvoc": 178.2
    }
  ],
  "attribution": "Sensor data: Atmy (atmy.ai), from the networks named in each sensor's \"network\", under that network's license.",
  "terms": "https://atmy.ai/legal/data/"
}