{"openapi":"3.1.0","info":{"title":"Atmy air quality API for agents","version":"1.6","summary":"Current and daily PM2.5 for cities, from public and citizen sensor networks after the Atmy Data Hub quality check, with the weather Atmy collected for each city.","description":"Read-only, no key. Cities: /air-quality, /ranking, /cities. Single sensors of Sensor.Community, AirGradient and Atmy (not PurpleAir): /networks, /sensors, /sensors/current, readings raw, 5-minute and hourly, and means across up to 100 sensors; each sensor carries its quality check and a rating 0–10. Values are approximate: low-cost optical sensors, not official monitoring. A city's sensors are those the Data Hub assigns to it that pass its nightly quality check; a value needs sensors at four places 500 m apart. \"now\" is the mean of the latest reading of each sensor (at most 60 minutes old), rebuilt every 15 minutes; \"completed_day\" and \"history\" are the Data Hub's daily means of the completed UTC day (sensors with at least 12 valid hours). Categories use the US EPA 2024 PM2.5 breakpoints. Attribute as \"Atmy (atmy.ai)\". Rate limit: 60 requests per minute per IP. The same data is available as an MCP server at https://api.atmy.ai/mcp (Streamable HTTP, no key). Weather (\"weather\" blocks) comes only from the readings Atmy already stores for its cities several times a day since 2026-01-19 (OpenWeatherMap to 2026-07-08, CC BY-SA 4.0; Open-Meteo from 2026-07-09, CC BY 4.0): credit them as in weather_attribution. Days are UTC; readings are instants, so days have no precipitation sum.","contact":{"url":"https://atmy.ai/"},"license":{"name":"Atmy data terms","url":"https://atmy.ai/legal/data/"}},"externalDocs":{"description":"Documentation with examples, in 17 languages","url":"https://atmy.ai/air-quality/api/"},"paths":{"/air-quality/current":{"get":{"operationId":"getCurrentAirQuality","summary":"Air quality in a city now and on the last completed day","description":"Find the city by name (any of 17 languages), slug or id, or by coordinates (the nearest city with an Atmy summary within 50 km).","parameters":[{"$ref":"#/components/parameters/city"},{"$ref":"#/components/parameters/country"},{"name":"lat","in":"query","schema":{"type":"number","minimum":-90,"maximum":90},"description":"Latitude, with lon, instead of city."},{"name":"lon","in":"query","schema":{"type":"number","minimum":-180,"maximum":180},"description":"Longitude, with lat."},{"$ref":"#/components/parameters/lang"}],"responses":{"200":{"description":"The city, its current value and its completed day.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Current"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"}}}},"/air-quality/history":{"get":{"operationId":"getDailyAirQuality","summary":"Daily PM2.5 of a city: the last days or any period since 2017, at most 400 days per request","parameters":[{"$ref":"#/components/parameters/city"},{"$ref":"#/components/parameters/country"},{"name":"days","in":"query","description":"How many days back from the last completed day; ignored with from/to.","schema":{"type":"integer","minimum":1,"maximum":400,"default":30}},{"name":"from","in":"query","description":"First day (UTC), 2017-01-01 or later.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"Last day (UTC); default the last completed day. from..to spans at most 400 days.","schema":{"type":"string","format":"date"}},{"$ref":"#/components/parameters/lang"}],"responses":{"200":{"description":"Daily means; a day without enough sensors is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/History"}}}},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}}}},"/air-quality/history/monthly":{"get":{"operationId":"getMonthlyAirQualityHistory","summary":"The whole measurement history of a city by month, with yearly means and record months and days","parameters":[{"$ref":"#/components/parameters/city"},{"$ref":"#/components/parameters/country"},{"$ref":"#/components/parameters/lang"}],"responses":{"200":{"description":"Monthly means since measurements began.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonthlyHistory"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/cities":{"get":{"operationId":"listCities","summary":"Cities with an Atmy summary","parameters":[{"$ref":"#/components/parameters/country"},{"$ref":"#/components/parameters/lang"},{"name":"q","in":"query","description":"Keep the cities whose name in any site language, or slug, contains this text.","schema":{"type":"string"}}],"responses":{"200":{"description":"The cities, their pages and current endpoints."}}}},"/air-quality/forecast":{"get":{"operationId":"getCityForecast","summary":"Weather and the pollution accumulation index of a city for the next hours (up to 72)","description":"From the Atmy agent hourly facts. accumulation_risk 0-100: how strongly the weather keeps particles near the ground. A weather estimate, not a PM2.5 forecast.","parameters":[{"$ref":"#/components/parameters/city"},{"$ref":"#/components/parameters/country"},{"name":"hours","in":"query","schema":{"type":"integer","minimum":1,"maximum":72,"default":24}},{"$ref":"#/components/parameters/lang"}],"responses":{"200":{"description":"Hourly rows from now on.","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}},"/ranking":{"get":{"operationId":"getCountryRanking","summary":"Cities of a country ranked by daily PM2.5 for the last completed day (Data Hub)","parameters":[{"name":"country","in":"query","required":true,"description":"Country name in any site language or ISO code.","schema":{"type":"string"}},{"name":"order","in":"query","schema":{"type":"string","enum":["most_polluted","cleanest"],"default":"most_polluted"}},{"name":"settlements","in":"query","schema":{"type":"string","enum":["cities","all"],"default":"cities"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":10}},{"$ref":"#/components/parameters/lang"}],"responses":{"200":{"description":"Ranked cities.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/open-data":{"get":{"operationId":"getOpenDataIndex","summary":"Open data: daily PM2.5 of every city since 2017 as CSV files under the ODbL 1.0 — license, attribution, sources and file list","responses":{"200":{"description":"The index: license, provider, attribution, sources, columns and files with size and sha256.","content":{"application/json":{"schema":{"type":"object"}}}},"503":{"$ref":"#/components/responses/Error"}}}},"/open-data/download":{"get":{"operationId":"downloadOpenData","summary":"One city's daily PM2.5 and weather for a period as a CSV download (ODbL 1.0; PurpleAir not included)","parameters":[{"$ref":"#/components/parameters/city"},{"$ref":"#/components/parameters/country"},{"name":"from","in":"query","description":"First day (UTC), 2017-01-01 or later; default 2017-01-01.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","description":"Last day (UTC); default the last completed day.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"CSV: date, city_id, city_slug, city, country, pm25, sensors, source_daily_sensors, temperature_c, temperature_min_c, temperature_max_c, humidity_percent, pressure_hpa, wind_m_s, wind_gust_max_m_s, clouds_percent (weather empty before 2026-01-19).","content":{"text/csv":{"schema":{"type":"string"}}}},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}}}},"/open-data/{path}":{"get":{"operationId":"getOpenDataFile","summary":"One open data file: daily/YYYY.csv, cities.csv or README.md","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","example":"daily/2025.csv"}}],"responses":{"200":{"description":"The file (CSV or Markdown).","content":{"text/csv":{"schema":{"type":"string"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/networks":{"get":{"operationId":"listNetworks","summary":"Sensor networks","description":"The networks of this API with their number of sensors, how many pass the quality check, their license and links. PurpleAir is not included.","responses":{"200":{"description":"networks.","content":{"application/json":{"schema":{"type":"object","properties":{"networks":{"type":"array","items":{"$ref":"#/components/schemas/Network"}}}}}}},"429":{"description":"Over 60 requests a minute from this IP address; see Retry-After."}}}},"/networks/{network}/sensors":{"get":{"operationId":"listNetworkSensors","summary":"Sensors of one network","description":"Every Atmy sensor except PurpleAir (its terms do not allow redistribution). Sensors that fail the quality check are included, marked with quality.pm_eligible=false and the reasons. quality.rating is the overall score 0–10 of the last checked day (null before the first check), quality.rating_7d the mean of the last 7 days: sort=rating lists the most reliable sensors first.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["sensor_community","airgradient","atmy"]}},{"name":"city","in":"query","description":"City id or slug (country/city), as in /cities.","schema":{"type":"string"},"example":"serbia/belgrade"},{"name":"country","in":"query","description":"Country slug, the first part of a city slug.","schema":{"type":"string"},"example":"serbia"},{"name":"bbox","in":"query","description":"min_lon,min_lat,max_lon,max_lat; at most 100 square degrees.","schema":{"type":"string"}},{"name":"lat","in":"query","description":"With lon: sensors within radius_km.","schema":{"type":"number"}},{"name":"lon","in":"query","description":"With lat.","schema":{"type":"number"}},{"name":"radius_km","in":"query","description":"Default 5, at most 50.","schema":{"type":"number","default":5,"maximum":50}},{"name":"quality","in":"query","description":"all (default) or passed: only sensors that pass the quality check.","schema":{"type":"string","enum":["all","passed"],"default":"all"}},{"name":"min_rating","in":"query","description":"Only sensors with at least this rating (0–10) on their last checked day.","schema":{"type":"number","minimum":0,"maximum":10}},{"name":"sort","in":"query","description":"id (default) or rating: the best rating of the last checked day first, then the 7-day mean.","schema":{"type":"string","enum":["id","rating"],"default":"id"}},{"name":"page","in":"query","description":"From 1.","schema":{"type":"integer","default":1,"minimum":1}},{"name":"limit","in":"query","description":"Sensors a page, at most 500.","schema":{"type":"integer","default":100,"minimum":1,"maximum":500}}],"responses":{"200":{"description":"total, page, limit, sensors.","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"sensors":{"type":"array","items":{"$ref":"#/components/schemas/Sensor"}}}}}}},"429":{"description":"Over 60 requests a minute from this IP address; see Retry-After."}}}},"/networks/{network}/sensors/current":{"get":{"operationId":"currentNetworkSensors","summary":"The current reading of every sensor of one network","description":"The latest reading of the last 24 hours of every sensor (not PurpleAir), compact, with its quality status and rating; rebuilt once a minute. Sensors without a reading in the last 24 hours are left out. Each answer also carries schema_version (the format of the answers, as in the city endpoints; v1 in the URL is the version of the paths) and fields: units, how missing values, means, times and the quality marking are meant. A measurement the device did not report, or one outside physical limits (pressure 300–1100 hPa, humidity 0–100 %, temperature −70…70 °C, PM 0–550 µg/m³), is left out, not null; select sensors by quality.pm_eligible.","parameters":[{"name":"network","in":"path","required":true,"schema":{"type":"string","enum":["sensor_community","airgradient","atmy"]}},{"name":"quality","in":"query","description":"all (default) or passed.","schema":{"type":"string","enum":["all","passed"],"default":"all"}},{"name":"min_rating","in":"query","description":"Only sensors with at least this rating (0–10).","schema":{"type":"number","minimum":0,"maximum":10}},{"name":"bbox","in":"query","description":"min_lon,min_lat,max_lon,max_lat.","schema":{"type":"string"}},{"name":"max_age_minutes","in":"query","description":"Only readings at most this many minutes old (1–1440; default: the last 24 hours).","schema":{"type":"integer","minimum":1,"maximum":1440}}],"responses":{"200":{"description":"schema_version, generated_at, max_age_minutes, readings_since, count, sensors, fields, attribution, terms.","content":{"application/json":{"schema":{"type":"object","properties":{"generated_at":{"type":"string","format":"date-time"},"count":{"type":"integer"},"sensors":{"type":"array","items":{"$ref":"#/components/schemas/SensorCurrent"}},"schema_version":{"type":"string"},"max_age_minutes":{"type":"integer"},"readings_since":{"type":"string","format":"date-time"},"fields":{"type":"object","description":"units, missing, values, time, quality, history, not_included."}}}}}},"400":{"description":"Malformed filter (invalid_network, invalid_quality, invalid_rating, invalid_bbox, invalid_max_age)."},"429":{"description":"Over 60 requests a minute from this IP address; see Retry-After."}}}},"/sensors":{"get":{"operationId":"listSensors","summary":"Sensors with their latest reading, quality check and rating","description":"Every Atmy sensor except PurpleAir (its terms do not allow redistribution). Sensors that fail the quality check are included, marked with quality.pm_eligible=false and the reasons. quality.rating is the overall score 0–10 of the last checked day (null before the first check), quality.rating_7d the mean of the last 7 days: sort=rating lists the most reliable sensors first.","parameters":[{"name":"city","in":"query","description":"City id or slug (country/city), as in /cities.","schema":{"type":"string"},"example":"serbia/belgrade"},{"name":"country","in":"query","description":"Country slug, the first part of a city slug.","schema":{"type":"string"},"example":"serbia"},{"name":"bbox","in":"query","description":"min_lon,min_lat,max_lon,max_lat; at most 100 square degrees.","schema":{"type":"string"}},{"name":"lat","in":"query","description":"With lon: sensors within radius_km.","schema":{"type":"number"}},{"name":"lon","in":"query","description":"With lat.","schema":{"type":"number"}},{"name":"radius_km","in":"query","description":"Default 5, at most 50.","schema":{"type":"number","default":5,"maximum":50}},{"name":"network","in":"query","description":"sensor_community, airgradient or atmy.","schema":{"type":"string","enum":["sensor_community","airgradient","atmy"]}},{"name":"quality","in":"query","description":"all (default) or passed: only sensors that pass the quality check.","schema":{"type":"string","enum":["all","passed"],"default":"all"}},{"name":"min_rating","in":"query","description":"Only sensors with at least this rating (0–10) on their last checked day.","schema":{"type":"number","minimum":0,"maximum":10}},{"name":"sort","in":"query","description":"id (default) or rating: the best rating of the last checked day first, then the 7-day mean.","schema":{"type":"string","enum":["id","rating"],"default":"id"}},{"name":"page","in":"query","description":"From 1.","schema":{"type":"integer","default":1,"minimum":1}},{"name":"limit","in":"query","description":"Sensors a page, at most 500.","schema":{"type":"integer","default":100,"minimum":1,"maximum":500}}],"responses":{"200":{"description":"total, page, limit, sensors.","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"},"sensors":{"type":"array","items":{"$ref":"#/components/schemas/Sensor"}}}}}}},"429":{"description":"Over 60 requests a minute from this IP address; see Retry-After."}}}},"/sensors/current":{"get":{"operationId":"currentSensors","summary":"The current reading of every sensor in one request","description":"The latest reading of the last 24 hours of every sensor (not PurpleAir), compact, with its quality status and rating; rebuilt once a minute. Sensors without a reading in the last 24 hours are left out. Each answer also carries schema_version (the format of the answers, as in the city endpoints; v1 in the URL is the version of the paths) and fields: units, how missing values, means, times and the quality marking are meant. A measurement the device did not report, or one outside physical limits (pressure 300–1100 hPa, humidity 0–100 %, temperature −70…70 °C, PM 0–550 µg/m³), is left out, not null; select sensors by quality.pm_eligible.","parameters":[{"name":"network","in":"query","description":"sensor_community, airgradient or atmy.","schema":{"type":"string","enum":["sensor_community","airgradient","atmy"]}},{"name":"quality","in":"query","description":"all (default) or passed.","schema":{"type":"string","enum":["all","passed"],"default":"all"}},{"name":"min_rating","in":"query","description":"Only sensors with at least this rating (0–10).","schema":{"type":"number","minimum":0,"maximum":10}},{"name":"bbox","in":"query","description":"min_lon,min_lat,max_lon,max_lat.","schema":{"type":"string"}},{"name":"max_age_minutes","in":"query","description":"Only readings at most this many minutes old (1–1440; default: the last 24 hours).","schema":{"type":"integer","minimum":1,"maximum":1440}}],"responses":{"200":{"description":"schema_version, generated_at, max_age_minutes, readings_since, count, sensors, fields, attribution, terms.","content":{"application/json":{"schema":{"type":"object","properties":{"generated_at":{"type":"string","format":"date-time"},"count":{"type":"integer"},"sensors":{"type":"array","items":{"$ref":"#/components/schemas/SensorCurrent"}},"schema_version":{"type":"string"},"max_age_minutes":{"type":"integer"},"readings_since":{"type":"string","format":"date-time"},"fields":{"type":"object","description":"units, missing, values, time, quality, history, not_included."}}}}}},"400":{"description":"Malformed filter (invalid_network, invalid_quality, invalid_rating, invalid_bbox, invalid_max_age)."},"429":{"description":"Over 60 requests a minute from this IP address; see Retry-After."}}}},"/sensors/readings":{"get":{"operationId":"getGroupReadings","summary":"Means across a group of sensors","description":"The mean of up to 100 sensors per 5 minutes, hour or UTC day. Each sensor counts once per bucket (the mean of its own readings first); \"sensors\" is how many had readings in the bucket. Windows as for one sensor: 5min the last 31 days, at most 7 days a request; hour the last 366 days, at most 92 days; day the last 366 days, at most 92 days a request for a group. Default: the last 24 hours, hourly.","parameters":[{"name":"ids","in":"query","description":"Comma-separated sensor ids, 1 to 100.","schema":{"type":"string"},"required":true,"example":"41504,41752,43057"},{"name":"interval","in":"query","description":"5min, hour or day.","schema":{"type":"string","enum":["5min","hour","day"],"default":"hour"}},{"name":"from","in":"query","description":"ISO 8601 or Unix seconds.","schema":{"type":"string"}},{"name":"to","in":"query","description":"ISO 8601 or Unix seconds; default now.","schema":{"type":"string"}}],"responses":{"200":{"description":"sensor_ids, interval, from, to, readings.","content":{"application/json":{"schema":{"type":"object","properties":{"sensor_ids":{"type":"array","items":{"type":"integer"}},"readings":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/SensorReading"},{"type":"object","properties":{"sensors":{"type":"integer","description":"Sensors with readings in the bucket."},"readings":{"type":"integer"}}}]}}}}}}},"400":{"description":"Malformed ids, interval or period."},"404":{"description":"Some of the ids are not sensors of this API."},"429":{"description":"Over 60 requests a minute from this IP address; see Retry-After."}}}},"/sensors/{id}":{"get":{"operationId":"getSensor","summary":"One sensor","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The sensor."},"404":{"description":"No such sensor."},"429":{"description":"Over 60 requests a minute from this IP address; see Retry-After."}}}},"/sensors/{id}/readings":{"get":{"operationId":"getSensorReadings","summary":"Readings of one sensor","description":"interval=raw: every reading, the last 31 days, at most 7 days a request (default: the last 24 hours). interval=5min: 5-minute means with the count of readings, the same windows. interval=hour: hourly means with the count of readings, the last 366 days, at most 92 days a request. interval=day: daily means of UTC days with the count of readings and that day's quality check (status, pm_eligible, rating), the last 366 days, a year a request (default: the last 30 days). Times are UTC.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"from","in":"query","description":"ISO 8601 or Unix seconds.","schema":{"type":"string"}},{"name":"to","in":"query","description":"ISO 8601 or Unix seconds; default now.","schema":{"type":"string"}},{"name":"interval","in":"query","description":"raw, 5min, hour or day.","schema":{"type":"string","enum":["raw","5min","hour","day"],"default":"raw"}}],"responses":{"200":{"description":"sensor_id, interval, from, to, readings.","content":{"application/json":{"schema":{"type":"object","properties":{"readings":{"type":"array","items":{"$ref":"#/components/schemas/SensorReading"}}}}}}},"400":{"description":"Period too long, too old or malformed."},"404":{"description":"No such sensor."},"429":{"description":"Over 60 requests a minute from this IP address; see Retry-After."}}}}},"components":{"parameters":{"city":{"name":"city","in":"query","schema":{"type":"string"},"examples":{"name":{"value":"Krasnoyarsk"},"slug":{"value":"russia/krasnoyarsk"},"localName":{"value":"Красноярск"}},"description":"City name in any site language, slug (country/city or city) or id."},"country":{"name":"country","in":"query","schema":{"type":"string"},"description":"Country name or slug to tell cities with one name apart."},"lang":{"name":"lang","in":"query","schema":{"type":"string","enum":["en","ru","de","fr","es","it","pt-BR","pl","cs","hu","ro","bg","sr","id","hi","ja","zh"],"default":"en"},"description":"Language of names and of the page link."}},"responses":{"Error":{"description":"error.code: city_required, invalid_coordinates, unknown_city, no_summary (a town of the base without an Atmy summary: place, its single sensors and next steps; air-quality/current answers it with status 200 and now.status no_summary), no_city_nearby, ambiguous_city (with candidates), not_available, no_history, invalid_date, invalid_range or range_too_long.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"candidates":{"type":"array","items":{"type":"object"}}}}}}}}}},"schemas":{"Category":{"type":"object","properties":{"scale":{"const":"US_EPA_2024"},"level":{"type":"string","enum":["good","moderate","unhealthy_for_sensitive_groups","unhealthy","very_unhealthy","hazardous"]}}},"City":{"type":"object","properties":{"id":{"type":"integer"},"slug":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"},"timezone":{"type":"string"},"center":{"type":"object","properties":{"lat":{"type":"number"},"lon":{"type":"number"}}},"distance_km":{"type":"number"},"page":{"type":"string","format":"uri"}}},"Current":{"type":"object","properties":{"city":{"$ref":"#/components/schemas/City"},"now":{"type":"object","description":"status current: the latest readings; stale: no fresh readings from enough places (no values).","properties":{"status":{"type":"string","enum":["current","stale"]},"pm25":{"type":"number"},"median":{"type":"number"},"min":{"type":"number"},"max":{"type":"number"},"unit":{"const":"ug/m3"},"category":{"$ref":"#/components/schemas/Category"},"sensors":{"type":"integer"},"updated_at":{"type":"string","format":"date-time"}}},"completed_day":{"type":["object","null"],"description":"The Data Hub's mean of the last completed UTC day; null when the city had too few sensors.","properties":{"date":{"type":"string","format":"date"},"pm25":{"type":"number"},"sensors":{"type":"integer"},"category":{"$ref":"#/components/schemas/Category"},"weather":{"$ref":"#/components/schemas/WeatherDay"}}},"attribution":{"type":"string"},"weather":{"$ref":"#/components/schemas/WeatherNow"},"weather_attribution":{"type":"string"}}},"History":{"type":"object","properties":{"city":{"$ref":"#/components/schemas/City"},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"pm25":{"type":"number"},"sensors":{"type":"integer"},"level":{"type":"string"},"source_daily_sensors":{"type":"integer","description":"Present when this many sensors count by the daily mean of their network, where no hourly readings were kept."},"weather":{"$ref":"#/components/schemas/WeatherDay","description":"Present from 2026-01-19 on days with stored weather."}}}},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"available_since":{"type":"string","format":"date"},"weather_since":{"type":"string","format":"date"},"weather_notes":{"type":"string"},"weather_attribution":{"type":"string"}}},"MonthlyHistory":{"type":"object","properties":{"city":{"$ref":"#/components/schemas/City"},"notes":{"type":"string"},"since":{"type":"string","description":"First month with a value, YYYY-MM"},"months":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string","description":"YYYY-MM"},"pm25":{"type":"number"},"sensors":{"type":"integer"},"days_with_data":{"type":"integer"},"days":{"type":"integer"},"source_daily_days":{"type":"integer","description":"Days whose value includes daily means of the network (no hourly readings kept)."},"weather":{"$ref":"#/components/schemas/WeatherDay","description":"The month's weather, from 2026-01."}}}},"years":{"type":"array","items":{"type":"object","properties":{"year":{"type":"string"},"pm25":{"type":"number"},"months":{"type":"integer"},"complete":{"type":"boolean","description":"All 12 months have data on at least half of their days; only complete years compare as a whole."}}}},"dirtiest_months":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string","description":"YYYY-MM"},"pm25":{"type":"number"},"sensors":{"type":"integer"},"days_with_data":{"type":"integer"},"days":{"type":"integer"},"source_daily_days":{"type":"integer","description":"Days whose value includes daily means of the network (no hourly readings kept)."}}}},"cleanest_months":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string","description":"YYYY-MM"},"pm25":{"type":"number"},"sensors":{"type":"integer"},"days_with_data":{"type":"integer"},"days":{"type":"integer"},"source_daily_days":{"type":"integer","description":"Days whose value includes daily means of the network (no hourly readings kept)."}}}},"dirtiest_days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"pm25":{"type":"number"},"sensors":{"type":"integer"},"source_daily_sensors":{"type":"integer"}}}},"cleanest_days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"pm25":{"type":"number"},"sensors":{"type":"integer"},"source_daily_sensors":{"type":"integer"}}}},"weather_since":{"type":"string","format":"date"},"weather_attribution":{"type":"string"}}},"WeatherNow":{"type":["object","null"],"description":"The weather now: the city agent's hourly reading, or the latest stored reading at most 7 hours old; null when there is none.","properties":{"observed_at":{"type":"string","format":"date-time"},"temperature_c":{"type":"number","description":"Air temperature, °C"},"feels_like_c":{"type":"number","description":"Apparent temperature, °C"},"humidity_percent":{"type":"integer","description":"Relative humidity, %"},"pressure_hpa":{"type":"integer","description":"Sea-level pressure, hPa"},"wind_m_s":{"type":"number","description":"Wind speed, m/s"},"wind_gust_m_s":{"type":"number","description":"Gusts, m/s"},"wind_direction_deg":{"type":"integer","description":"Wind direction, degrees"},"clouds_percent":{"type":"integer","description":"Cloud cover, %"},"precipitation_mm":{"type":"number","description":"Precipitation at the reading, mm"},"condition":{"type":"string","enum":["clear","partly_cloudy","cloudy","fog","rain","snow","thunderstorm"]}}},"WeatherDay":{"type":"object","description":"Means of the readings Atmy stored for the city in the period (UTC); the lowest and highest temperature the provider reported.","properties":{"temperature_c":{"type":"number","description":"Mean temperature, °C"},"temperature_min_c":{"type":"number","description":"Lowest temperature, °C"},"temperature_max_c":{"type":"number","description":"Highest temperature, °C"},"humidity_percent":{"type":"integer","description":"Mean relative humidity, %"},"pressure_hpa":{"type":"integer","description":"Mean sea-level pressure, hPa"},"wind_m_s":{"type":"number","description":"Mean wind speed, m/s"},"wind_gust_max_m_s":{"type":"number","description":"Strongest gust, m/s"},"clouds_percent":{"type":"integer","description":"Mean cloud cover, %"},"observations":{"type":"integer","description":"Readings behind the values"}}},"SensorReading":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"pm1":{"type":"number","description":"µg/m³"},"pm25":{"type":"number","description":"µg/m³"},"pm10":{"type":"number","description":"µg/m³"},"temperature_c":{"type":"number"},"humidity_percent":{"type":"number"},"pressure_hpa":{"type":"number"},"tvoc":{"type":"number","description":"as the device reports it"},"no2":{"type":"number"},"o3":{"type":"number"},"so2":{"type":"number"},"co":{"type":"number"}},"description":"Channels the sensor does not report are left out. Raw values as the device sent them, not corrected."},"Sensor":{"type":"object","properties":{"id":{"type":"integer"},"uuid":{"type":"string"},"name":{"type":"string"},"network":{"type":"string","enum":["Sensor.Community","AirGradient","Atmy","Other"]},"network_id":{"type":["string","null"],"enum":["sensor_community","airgradient","atmy",null],"description":"The network slug of /networks."},"license":{"type":["string","null"],"description":"The network's own terms; credit the network."},"location":{"type":"object","properties":{"lat":{"type":["number","null"]},"lon":{"type":["number","null"]}}},"city":{"type":["object","null"],"properties":{"id":{"type":"integer"},"slug":{"type":"string"},"name":{"type":"string"},"country":{"type":"string"}}},"quality":{"type":"object","description":"The nightly quality check of the last completed day. pm_eligible=false: Atmy leaves the sensor out of city values, and the map hides it while its Data quality switch is on.","properties":{"status":{"type":"string","enum":["good","degraded","bad","unknown"]},"date":{"type":["string","null"]},"pm_eligible":{"type":"boolean"},"rating":{"type":["integer","null"],"minimum":0,"maximum":10,"description":"Overall score 0–10 of the last checked day (PM 50 %, transmission 30 %, temperature and humidity 20 %); null before the first check."},"rating_7d":{"type":["number","null"],"description":"Mean overall score of the checked days among the last 7."},"scores":{"type":["object","null"],"description":"Component scores 0–10 of the last checked day.","properties":{"pm":{"type":"integer"},"transport":{"type":"integer"},"meteo":{"type":"integer"}}},"reasons":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"}}}}}},"latest":{"oneOf":[{"$ref":"#/components/schemas/SensorReading"},{"type":"null"}],"description":"The latest reading of the last 24 hours."}}},"SensorCurrent":{"type":"object","description":"One sensor of /sensors/current: its latest reading (fields of SensorReading) with its quality.","allOf":[{"$ref":"#/components/schemas/SensorReading"},{"type":"object","properties":{"id":{"type":"integer"},"network_id":{"type":["string","null"]},"lat":{"type":["number","null"]},"lon":{"type":["number","null"]},"city":{"type":["string","null"],"description":"City slug."},"quality":{"type":"object","properties":{"status":{"type":"string"},"pm_eligible":{"type":"boolean"},"rating":{"type":["integer","null"]}}}}}]},"Network":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"license":{"type":"string"},"sensors":{"type":"integer"},"passed":{"type":"integer","description":"Sensors that pass the quality check."},"links":{"type":"object","properties":{"sensors":{"type":"string"},"current":{"type":"string"}}}}}}},"servers":[{"url":"https://api.atmy.ai/v1"}]}