{"swagger":"2.0","info":{"description":"Know what you breathe","version":"2.0","title":"Airly API","termsOfService":"https://airly.eu/API-TOS.pdf","contact":{"name":"Airly","url":"https://airly.eu/","email":"contact@airly.eu"}},"host":"airapi.airly.eu","basePath":"/docs/v2","tags":[{"name":"Installations","description":"operations returning sensor installation details"},{"name":"Measurements","description":"operations returning installation measurements"},{"name":"Meta","description":"operations returning various meta-data"}],"schemes":["https"],"paths":{"/v2/installations/location":{"get":{"tags":["Installations"],"summary":"Get Installation by LocationID","description":"Returns single Installation by the locationId query parameter","operationId":"byLocationIdUsingGET","produces":["application/json","application/msgpack","application/x-msgpack"],"parameters":[{"name":"locationId","in":"query","description":"Location ID","required":true,"type":"integer","format":"int32"}],"responses":{"200":{"description":"Installation's info with coordinates, address etc","schema":{"$ref":"#/definitions/Installation"}},"404":{"description":"There is no active installed Installation associated with given locationID"}},"security":[{"apikey":[]}]}},"/v2/installations/nearest":{"get":{"tags":["Installations"],"summary":"Get nearest installations by location","description":"Returns list of Installations given by location point, ordered by distance to that point, which are not further than 'maxDistanceKM'.\nReturns at most 'maxResults' items.\nIf no installation is found within 'maxDistanceKM' from the location point, returns empty list.","operationId":"nearestUsingGET_1","produces":["application/json","application/msgpack","application/x-msgpack"],"parameters":[{"name":"lat","in":"query","description":"Latitude","required":true,"type":"number","default":50.062006,"format":"double"},{"name":"lng","in":"query","description":"Longitude","required":true,"type":"number","default":19.940984,"format":"double"},{"name":"maxDistanceKM","in":"query","description":"Max distance in km. Negative values mean 'infinity' (no distance limit). Optional parameter, if omitted defaults to 3km.","required":false,"type":"number","default":3.0,"format":"double"},{"name":"maxResults","in":"query","description":"Max results to return. Negative values mean 'infinity' (no results limit). Optional parameter, if omitted defaults to 1 item.","required":false,"type":"integer","default":1,"format":"int32"}],"responses":{"200":{"description":"List of Installations","schema":{"type":"array","items":{"$ref":"#/definitions/Installation"}}}},"security":[{"apikey":[]}]}},"/v2/installations/sensor":{"get":{"tags":["Installations"],"summary":"Get Installation by SensorID","description":"Returns single Installation by the sensorId query parameter","operationId":"bySensorIdUsingGET","produces":["application/json","application/msgpack","application/x-msgpack"],"parameters":[{"name":"sensorId","in":"query","description":"Sensor ID","required":true,"type":"integer","format":"int32"}],"responses":{"200":{"description":"Installation's info with coordinates, address etc","schema":{"$ref":"#/definitions/Installation"}},"404":{"description":"There is no installed Installation associated with given sensorID"}},"security":[{"apikey":[]}]}},"/v2/installations/{installationId}":{"get":{"tags":["Installations"],"summary":"Get installation by id","description":"Returns single Installation given by the installationId path parameter","operationId":"byIdUsingGET_1","produces":["application/json","application/msgpack","application/x-msgpack"],"parameters":[{"name":"installationId","in":"path","description":"Installation ID","required":true,"type":"integer","default":204,"format":"int32"}],"responses":{"200":{"description":"Installation's info with coordinates, address etc","schema":{"$ref":"#/definitions/Installation"}},"301":{"description":"Installation was replaced by another installation in this location. Please follow redirect.","headers":{"Location":{"type":"string"}}},"404":{"description":"Installation not found"}},"security":[{"apikey":[]}]}},"/v2/measurements/installation":{"get":{"tags":["Measurements"],"summary":"Get measurements for installation","description":"Returns detailed measurements (current, historical and future) for an installation. \nHistory and forecast are in 1h timeframes for 24h in past and future, sorted in ascending order.\nReturns 404 in case installation doesn't exist.","operationId":"installationMeasurementsUsingGET","produces":["application/json","application/msgpack","application/x-msgpack"],"parameters":[{"name":"indexPollutant","in":"query","description":"Select pollutants which should be considered when calculating index value","required":false,"type":"array","items":{"type":"string","enum":["ALL","CO","NO2","O3","PM","PM10","PM25","SO2"]},"collectionFormat":"multi","default":"PM","enum":["ALL","CO","NO2","O3","PM","PM10","PM25","SO2"]},{"name":"indexType","in":"query","description":"Select index which should be returned in response","required":false,"type":"string","default":"AIRLY_CAQI","enum":["AIRLY_AQI","AIRLY_CAQI","AIRLY_DAQI","AIRLY_PIJP","AIRLY_US_AQI","CAQI","DAQI","MONGOLIAN_AQI","PIJP","US_AQI"]},{"name":"installationId","in":"query","description":"AirlyInstallation ID","required":true,"type":"integer","default":204,"format":"int32"},{"name":"standardType","in":"query","description":"Select standard which should be returned in response","required":false,"type":"string","default":"WHO","enum":["DEFRA","POLISH","WHO"]}],"responses":{"200":{"description":"Measurements of the Installation given by id","schema":{"$ref":"#/definitions/Measurements"}},"301":{"description":"Installation was replaced by another installation in this location. Please follow redirect.","headers":{"Location":{"type":"string"}}},"404":{"description":"No Installation was found by the given id"}},"security":[{"apikey":[]}]}},"/v2/measurements/location":{"get":{"tags":["Measurements"],"summary":"Get measurements for location","description":"Returns detailed measurements (current, historical and future) for an location. \nHistory and forecast are in 1h timeframes for 24h in past and future, sorted in ascending order.\nReturns 404 in case location doesn't exist.","operationId":"locationMeasurementsUsingGET","produces":["application/json","application/msgpack","application/x-msgpack"],"parameters":[{"name":"indexPollutant","in":"query","description":"Select pollutants which should be considered when calculating index value","required":false,"type":"array","items":{"type":"string","enum":["ALL","CO","NO2","O3","PM","PM10","PM25","SO2"]},"collectionFormat":"multi","default":"PM","enum":["ALL","CO","NO2","O3","PM","PM10","PM25","SO2"]},{"name":"indexType","in":"query","description":"Select index which should be returned in response","required":false,"type":"string","default":"AIRLY_CAQI","enum":["AIRLY_AQI","AIRLY_CAQI","AIRLY_DAQI","AIRLY_PIJP","AIRLY_US_AQI","CAQI","DAQI","MONGOLIAN_AQI","PIJP","US_AQI"]},{"name":"locationId","in":"query","description":"Location ID","required":true,"type":"integer","default":204,"format":"int32"},{"name":"standardType","in":"query","description":"Select standard which should be returned in response","required":false,"type":"string","default":"WHO","enum":["DEFRA","POLISH","WHO"]}],"responses":{"200":{"description":"Measurements of the Installation given by LocationId","schema":{"$ref":"#/definitions/Measurements"}},"404":{"description":"No Installation was found by the given LocationId"}},"security":[{"apikey":[]}]}},"/v2/measurements/nearest":{"get":{"tags":["Measurements"],"summary":"Get measurements from nearest installation","description":"Returns detailed measurements (current, historical and future) from the installation which is closest to a given point, but not further than specified distance limit (in km). \nHistory and forecast are in 1h timeframes for 24h in past and future, sorted in ascending order.\nReturns 404 in case no installation could be found within the given distance from point.","operationId":"nearestUsingGET_2","produces":["application/json","application/msgpack","application/x-msgpack"],"parameters":[{"name":"indexPollutant","in":"query","description":"Select pollutants which should be considered when calculating index value","required":false,"type":"array","items":{"type":"string","enum":["ALL","CO","NO2","O3","PM","PM10","PM25","SO2"]},"collectionFormat":"multi","default":"PM","enum":["ALL","CO","NO2","O3","PM","PM10","PM25","SO2"]},{"name":"indexType","in":"query","description":"Select index which should be returned in response","required":false,"type":"string","default":"AIRLY_CAQI","enum":["AIRLY_AQI","AIRLY_CAQI","AIRLY_DAQI","AIRLY_PIJP","AIRLY_US_AQI","CAQI","DAQI","MONGOLIAN_AQI","PIJP","US_AQI"]},{"name":"lat","in":"query","description":"Latitude","required":true,"type":"number","default":50.062006,"format":"double"},{"name":"lng","in":"query","description":"Longitude","required":true,"type":"number","default":19.940984,"format":"double"},{"name":"maxDistanceKM","in":"query","description":"Max distance in km. Negative values mean 'infinity' (no results limit). Optional parameter, if omitted defaults to 3km.","required":false,"type":"number","default":3.0,"format":"double"},{"name":"standardType","in":"query","description":"Select standard which should be returned in response","required":false,"type":"string","default":"WHO","enum":["DEFRA","POLISH","WHO"]}],"responses":{"200":{"description":"Measurements of the installation nearest to given point","schema":{"$ref":"#/definitions/Measurements"}},"404":{"description":"No installation was found within given distance from point"}},"security":[{"apikey":[]}]}},"/v2/measurements/point":{"get":{"tags":["Measurements"],"summary":"Get measurements for a point on map","description":"Returns detailed measurements (current, historical and future) for a map point, which can be interpolated from nearby installations. \nHistory and forecast are in 1h timeframes for 24h in past and future, sorted in ascending order.","operationId":"mapPointMeasurementsUsingGET","produces":["application/json","application/msgpack","application/x-msgpack"],"parameters":[{"name":"indexPollutant","in":"query","description":"Select pollutants which should be considered when calculating index value","required":false,"type":"array","items":{"type":"string","enum":["ALL","CO","NO2","O3","PM","PM10","PM25","SO2"]},"collectionFormat":"multi","default":"PM","enum":["ALL","CO","NO2","O3","PM","PM10","PM25","SO2"]},{"name":"indexType","in":"query","description":"Select index which should be returned in response","required":false,"type":"string","default":"AIRLY_CAQI","enum":["AIRLY_AQI","AIRLY_CAQI","AIRLY_DAQI","AIRLY_PIJP","AIRLY_US_AQI","CAQI","DAQI","MONGOLIAN_AQI","PIJP","US_AQI"]},{"name":"lat","in":"query","description":"Latitude","required":true,"type":"number","default":50.062006,"format":"double"},{"name":"lng","in":"query","description":"Longitude","required":true,"type":"number","default":19.940984,"format":"double"},{"name":"standardType","in":"query","description":"Select standard which should be returned in response","required":false,"type":"string","default":"WHO","enum":["DEFRA","POLISH","WHO"]}],"responses":{"200":{"description":"Point measurements interpolated from nearby Installations","schema":{"$ref":"#/definitions/Measurements"}}},"security":[{"apikey":[]}]}},"/v2/meta/indexes":{"get":{"tags":["Meta"],"summary":"Get index types","description":"Returns list of IndexTypes supported by the platform","operationId":"indexesUsingGET_1","produces":["application/json","application/msgpack","application/x-msgpack"],"responses":{"200":{"description":"List of IndexTypes","schema":{"type":"array","items":{"$ref":"#/definitions/IndexType"}}}},"security":[{"apikey":[]}]}},"/v2/meta/measurements":{"get":{"tags":["Meta"],"summary":"Get measurement types","description":"Returns list of MeasurementTypes supported by the platform","operationId":"measurementsUsingGET_1","produces":["application/json","application/msgpack","application/x-msgpack"],"responses":{"200":{"description":"List of MeasurementTypes","schema":{"type":"array","items":{"$ref":"#/definitions/MeasurementType"}}}},"security":[{"apikey":[]}]}},"/v2/meta/standards":{"get":{"tags":["Meta"],"summary":"Get standard types","description":"Returns list of StandardTypes supported by the platform","operationId":"standardsUsingGET_1","produces":["application/json","application/msgpack","application/x-msgpack"],"responses":{"200":{"description":"List of StandardTypes","schema":{"type":"array","items":{"type":"string","enum":["DEFRA","POLISH","WHO"]}}}},"security":[{"apikey":[]}]}}},"securityDefinitions":{"apikey":{"type":"apiKey","name":"apikey","in":"header"}},"definitions":{"Address":{"type":"object","properties":{"city":{"type":"string"},"country":{"type":"string"},"displayAddress1":{"type":"string"},"displayAddress2":{"type":"string"},"number":{"type":"string"},"street":{"type":"string"}},"title":"Address"},"AveragedValues":{"type":"object","properties":{"fromDateTime":{"type":"string","format":"date-time","example":"2018-01-30T15:00:00Z","description":"Left bound of the time period over which average measurements were calculated, inclusive, always UTC"},"indexes":{"type":"array","description":"List of indexes calculated from the values available. Indexes are defined by relevant national and international institutions, e.g. EU, GIOŚ or US EPA","items":{"$ref":"#/definitions/Index"}},"standards":{"type":"array","description":"List of 'standard' values, or 'limits' for pollutants that should not be exceeded over certain period of time. Limits are defined by relevant national and international institutions, like e.g. WHO or EPA. For each standard limit in this list there is also a corresponding measurement expressed as a percent value of the limit","items":{"$ref":"#/definitions/Standard"}},"tillDateTime":{"type":"string","format":"date-time","example":"2018-01-30T16:00:00Z","description":"Right bound of the time period over which average measurements were calculated, exclusive, always UTC"},"values":{"type":"array","description":"List of raw measurements, averaged over specified period. Measurement types available in this list depend on the capabilities of the queried installation, e.g. particulate matter (PM1, PM25, PM10), gases (CO, NO2, SO2, O3) or weather conditions (temperature, humidity, pressure)","items":{"$ref":"#/definitions/Value"}}},"title":"AveragedValues"},"Coordinates":{"type":"object","required":["latitude","longitude"],"properties":{"latitude":{"type":"number","format":"double","example":50.062006,"minimum":-90.0,"maximum":90.0,"exclusiveMinimum":false,"exclusiveMaximum":false},"longitude":{"type":"number","format":"double","example":19.940984,"minimum":-180.0,"maximum":180.0,"exclusiveMinimum":false,"exclusiveMaximum":false}},"title":"Coordinates"},"Index":{"type":"object","properties":{"advice":{"type":"string","example":"Don’t hesitate to go out today","description":"Piece of advice from Airly regarding air quality. Text translation is returned according to language specified in the request (English being default)"},"color":{"type":"string","example":"#00FF00","description":"Color representing this index level, given by hexadecimal css-style triplet"},"description":{"type":"string","example":"Great air here today!","description":"Text describing this air quality level. Text translation is returned according to language specified in the request (English being default)"},"level":{"type":"string","example":"MEDIUM","description":"Index level name"},"name":{"type":"string","example":"CAQI","description":"Name of this index"},"value":{"type":"number","format":"double","example":2.0,"description":"Index numerical value"}},"title":"Index"},"IndexLevel":{"type":"object","properties":{"color":{"type":"string","example":"#00FF00","description":"Color representing this index level, given by hexadecimal css-style triplet"},"description":{"type":"string","example":"Air is quite good","description":"Text describing this index level"},"level":{"type":"string","example":"LOW","description":"Name of this index level"},"maxValue":{"type":"number","format":"double","example":25.0,"description":"Maximum index value for this level"},"minValue":{"type":"number","format":"double","example":0.0,"description":"Minimum index value for this level"},"values":{"type":"string","example":"0-25","description":"Values range for this index level"}},"title":"IndexLevel"},"IndexType":{"type":"object","properties":{"levelClosedEnd":{"type":"string","example":"RIGHT","description":"Closed end for level ranges of this index","enum":["LEFT","RIGHT"]},"levels":{"type":"array","description":"List of possible index levels","items":{"$ref":"#/definitions/IndexLevel"}},"name":{"type":"string","example":"CAQI","description":"Name of this index"},"roundingMode":{"type":"string","example":"UP","description":"Rounding method for this  index","enum":["CEILING","DOWN","FLOOR","HALF_DOWN","HALF_EVEN","HALF_UP","UNNECESSARY","UP"]}},"title":"IndexType"},"Installation":{"type":"object","required":["address","airly","elevation","id","location","locationId","sponsor"],"properties":{"address":{"description":"Address","$ref":"#/definitions/Address"},"airly":{"type":"boolean","description":"Indicates if this is Airly sensor"},"elevation":{"type":"number","format":"double","description":"Elevation"},"id":{"type":"integer","format":"int32","description":"ID of the installation"},"location":{"description":"Location","$ref":"#/definitions/Coordinates"},"locationId":{"type":"integer","format":"int32","description":"ID of the location"},"sponsor":{"description":"Sponsor","$ref":"#/definitions/Sponsor"}},"title":"Installation"},"MeasurementType":{"type":"object","properties":{"label":{"type":"string","example":"Temperature","description":"Short name of this measurement type. This is a translated field and will contain value according to Access-Language header"},"name":{"type":"string","example":"PM10","description":"Identifier of this measurement type. Also used as 'name' identifier in 'measurements' API"},"unit":{"type":"string","example":"µg/m³","description":"Unit of this measurement type"}},"title":"MeasurementType"},"Measurements":{"type":"object","properties":{"current":{"$ref":"#/definitions/AveragedValues"},"forecast":{"type":"array","items":{"$ref":"#/definitions/AveragedValues"}},"history":{"type":"array","items":{"$ref":"#/definitions/AveragedValues"}}},"title":"Measurements","description":"Current, historical and future measurements.\n\nThe 'current' field contains average measurements calculated over a period of last 1 hour. \n\nThe 'history' field contains 24 average measurements calculated over periods of last 24 hours. \n\nThe 'forecast' field contains 24 future average measurements that we anticipate."},"Sponsor":{"type":"object","required":["id","logo","name"],"properties":{"description":{"type":"string"},"displayName":{"type":"string"},"id":{"type":"integer","format":"int32"},"link":{"type":"string"},"logo":{"type":"string"},"name":{"type":"string"}},"title":"Sponsor"},"Standard":{"type":"object","properties":{"averaging":{"type":"string","example":"24h","description":"Averaging period this standard is applied for"},"limit":{"type":"number","format":"double","example":40.0,"description":"Limit value of the pollutant"},"name":{"type":"string","example":"WHO","description":"Name of this standard"},"percent":{"type":"number","format":"double","example":80.0,"description":"Pollutant measurement as percent of allowable limit"},"pollutant":{"type":"string","example":"PM10","description":"Pollutant described by this standard"}},"title":"Standard"},"StandardLimit":{"type":"object","properties":{"limit":{"type":"number","format":"double","example":25.0,"description":"Pollutant concentration limit defined by the standard"},"name":{"type":"string","example":"PM10","description":"Identifier of this measurement type. Also used as 'name' identifier in 'measurements' API"}},"title":"StandardLimit"},"StandardType":{"type":"object","properties":{"name":{"type":"string","example":"WHO","description":"Name of this standard"},"roundingMode":{"type":"string","example":"CEILING","description":"Rounding method for this standard","enum":["CEILING","DOWN","FLOOR","HALF_DOWN","HALF_EVEN","HALF_UP","UNNECESSARY","UP"]},"standardLimits":{"type":"array","description":"List of standard limits defined by this standard","items":{"$ref":"#/definitions/StandardLimit"}}},"title":"StandardType"},"Value":{"type":"object","properties":{"name":{"type":"string","example":"PM10","description":"Name of this measurement"},"value":{"type":"number","format":"double","example":7.3,"description":"Value of this measurement"}},"title":"Value"}}}