{"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":"/","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/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","produces":["application/json"],"parameters":[{"name":"lat","in":"query","description":"Latitude","required":true,"type":"number","default":50.062006,"allowEmptyValue":false,"format":"double"},{"name":"lng","in":"query","description":"Longitude","required":true,"type":"number","default":19.940984,"allowEmptyValue":false,"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,"allowEmptyValue":false,"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,"allowEmptyValue":false,"format":"int32"}],"responses":{"200":{"description":"List of Installations","schema":{"type":"array","items":{"$ref":"#/definitions/Installation"}}}},"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","produces":["application/json"],"parameters":[{"name":"installationId","in":"path","description":"Installation ID","required":true,"type":"integer","default":204,"allowEmptyValue":false,"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","description":"url pointing to installation replacement"}}},"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"],"parameters":[{"name":"indexType","in":"query","description":"Select index which should be returned in response","required":false,"type":"string","default":"AIRLY_CAQI","allowEmptyValue":false,"enum":["AIRLY_CAQI","CAQI","PIJP"]},{"name":"installationId","in":"query","description":"AirlyInstallation ID","required":true,"type":"integer","default":204,"allowEmptyValue":false,"format":"int32"}],"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","description":"url pointing to measurements of the installation replacement"}}},"404":{"description":"No Installation was found by the given id"}},"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_1","produces":["application/json"],"parameters":[{"name":"indexType","in":"query","description":"Select index which should be returned in response","required":false,"type":"string","default":"AIRLY_CAQI","allowEmptyValue":false,"enum":["AIRLY_CAQI","CAQI","PIJP"]},{"name":"lat","in":"query","description":"Latitude","required":true,"type":"number","default":50.062006,"allowEmptyValue":false,"format":"double"},{"name":"lng","in":"query","description":"Longitude","required":true,"type":"number","default":19.940984,"allowEmptyValue":false,"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,"allowEmptyValue":false,"format":"double"}],"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"],"parameters":[{"name":"indexType","in":"query","description":"Select index which should be returned in response","required":false,"type":"string","default":"AIRLY_CAQI","allowEmptyValue":false,"enum":["AIRLY_CAQI","CAQI","PIJP"]},{"name":"lat","in":"query","description":"Latitude","required":true,"type":"number","default":50.062006,"allowEmptyValue":false,"format":"double"},{"name":"lng","in":"query","description":"Longitude","required":true,"type":"number","default":19.940984,"allowEmptyValue":false,"format":"double"}],"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","produces":["application/json"],"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","produces":["application/json"],"responses":{"200":{"description":"List of MeasurementTypes","schema":{"type":"array","items":{"$ref":"#/definitions/MeasurementType"}}}},"security":[{"apikey":[]}]}}},"securityDefinitions":{"apikey":{"type":"apiKey","name":"apikey","in":"header"}},"definitions":{"Address":{"type":"object","properties":{"country":{"type":"string"},"city":{"type":"string"},"street":{"type":"string"},"number":{"type":"string"},"displayAddress1":{"type":"string"},"displayAddress2":{"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"},"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"}},"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"}}},"title":"AveragedValues"},"Coordinates":{"type":"object","required":["latitude","longitude"],"properties":{"latitude":{"type":"number","format":"double","example":50.062006},"longitude":{"type":"number","format":"double","example":19.940984}},"title":"Coordinates"},"Index":{"type":"object","properties":{"name":{"type":"string","example":"CAQI","description":"Name of this index"},"value":{"type":"number","format":"double","example":2.0,"description":"Index numerical value"},"level":{"type":"string","example":"MEDIUM","description":"Index level name"},"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)"},"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"}},"title":"Index"},"IndexLevel":{"type":"object","properties":{"minValue":{"type":"number","format":"double","example":0.0,"description":"Minimum index value for this level"},"maxValue":{"type":"number","format":"double","example":25.0,"description":"Maximum index value for this level"},"values":{"type":"string","example":"0-25","description":"Values range for this index level"},"level":{"type":"string","example":"LOW","description":"Name of this index level"},"description":{"type":"string","example":"Air is quite good","description":"Text describing this index level"},"color":{"type":"string","example":"#00FF00","description":"Color representing this index level, given by hexadecimal css-style triplet"}},"title":"IndexLevel"},"IndexType":{"type":"object","properties":{"name":{"type":"string","example":"CAQI","description":"Name of this index"},"levels":{"type":"array","description":"List of possible index levels","items":{"$ref":"#/definitions/IndexLevel"}}},"title":"IndexType"},"Installation":{"type":"object","required":["address","airly","elevation","id","location","sponsor"],"properties":{"id":{"type":"integer","format":"int32","description":"ID of the installation"},"location":{"description":"Location","$ref":"#/definitions/Coordinates"},"address":{"description":"Address","$ref":"#/definitions/Address"},"elevation":{"type":"number","format":"double","description":"Elevation"},"airly":{"type":"boolean","description":"Indicates if this is Airly sensor"},"sponsor":{"description":"Sponsor","$ref":"#/definitions/Sponsor"}},"title":"Installation"},"MeasurementType":{"type":"object","properties":{"name":{"type":"string","example":"PM10","description":"Identifier of this measurement type. Also used as 'name' identifier in 'measurements' API"},"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"},"unit":{"type":"string","example":"µg/m³","description":"Unit of this measurement type"}},"title":"MeasurementType"},"Measurements":{"type":"object","properties":{"current":{"$ref":"#/definitions/AveragedValues"},"history":{"type":"array","items":{"$ref":"#/definitions/AveragedValues"}},"forecast":{"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":{"id":{"type":"integer","format":"int32"},"name":{"type":"string"},"description":{"type":"string"},"logo":{"type":"string"},"link":{"type":"string"}},"title":"Sponsor"},"Standard":{"type":"object","properties":{"name":{"type":"string","example":"WHO","description":"Name of this standard"},"pollutant":{"type":"string","example":"PM10","description":"Pollutant described by this standard"},"limit":{"type":"number","format":"double","example":40.0,"description":"Limit value of the pollutant"},"percent":{"type":"number","format":"double","example":80.0,"description":"Pollutant measurement as percent of allowable limit"}},"title":"Standard"},"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"}}}