Publishing API for Dylos and Shinyei sensors

Note. The content on this page is outdated.
For the most recent upload API document, go to https://aqicn.org/data-feed/upload-api/

If you have a Dylos or Shinyei sensor, and you would like to publish its data on the World Air Quality Index, then this page is for you. One of the easiest solution for uploading the Dylos data is to use the ready made scripts available on github. But if you need to brew your own system, or upload data from the Shinyei sensor, then you can use the APIs described on this page.

Note that this API specification is not final, but still on-going work, so if you meet any difficulty with the integration, just contact us to get the support.


--

API Endpoint

http://sensor.aqicn.org/

API Method: Uploading data

post /sensor/upload
Parameters
  • id: Sensor ID, eg dylos.test-sensor-id
  • key: Sensor password - optional, only if the sensor ID is 'locked'.
  • time: Sensor time, with timezone information, in ISO 8601 format- eg 2014/10/08 18:03:45 +0800
  • location: Sensor position (latitude, longitude) - optional only if correlation with BAM sensor is requested

  • data: Array, containing all the raw readings
    • type: Sensor data type. For now, can be "dylos-0.5", "dylos-2.5", "shinyei-pdp42ns-2.5u" or "shinyei-pdp42ns-1u".
    • unit: Sensor data unit. For now, can be "pc" (particule count) or "lpo" (low pulse occupancy).
    • value: Sensor data reading. eg 94948 or 0.374

    Notes
    1. The above parameters are encapsulated within the argument 'postdata' of the post request.
    2. The LPO value must be between 0 and 1. 0 Means transparent, 1 Opaque. For more information on how to extrac the LPO from the Shinyei sensor, please refer to this page: api/shinyei.
Example:
...
Return value:
  • result: Can be either ok or error.

    In case of ok result, the returned value will contain the sensor id as well as the upload data ids (for information purpose only).
    ...

    In case of error, the returned value will contain a description (field msg) and an error code (field ecode) which can be one of the following:

    • 101: There are missing arugments from the posted data. Minimum arguments are id, time and data.
    • 102: Key is not valid - the sensor is protected by password and the provided password is not correct.
    • 103: No data posted (i.e empty array or data is not an array).
    • 104: Unit, type of value information not available from the data field.
    • 105: Sensor type is unknown.
    • 106: The field value is not numeric.
    • 107: Time string can not be decode (is it ISO 8601 complaiant?)
    • 108: SQL query failed.
    ...

Example

 $ curl -i "http://sensor.aqicn.org/sensor/upload/" -d 'postdata={id:"dylos.test-sensor-id",time:"2014-10-16T19:20:31+08:00",data:[{type:"dylos-2.5",value:88,unit:"pc"}]}'

HTTP/1.1 200 OK
Date: Sun, 09 Nov 2014 08:28:34 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/json; charset=utf-8

{"result":"ok","sensorID":"588","dataids":[2825275]}


API Method: Getting the raw sensor data

get /sensor/download
Parameters
  • id: Sensor ID, eg dylos.test-sensor-id
  • callback: Optional JsonP callback (eg "foo").
Example :
 http://sensor.aqicn.org/sensor/download/?id=dylos.test-sensor-id&callback=foo 

Return value:
...

Example

 $ curl -i "http://sensor.aqicn.org/sensor/download/?id=dylos.test-sensor-id&callback=foo"

HTTP/1.1 200 OK
Date: Sun, 09 Nov 2014 08:42:12 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/json; charset=utf-8

{"id":"dylos.test-sensor-id","data":{"dylos-0.5":[{"time":"1413458432","value":"89"}],"dylos-2.5":[{"time":"1413458432","value":"89"},{"time":"1413458431","value":"88"}]}}


대기질 및 환경 오염 측정에 관하여 :

대기질 지수 단계에 대하여

AQI지수구분구간의미
0 - 50 좋음 대기오염 관련 질환자군에서도 영향이 유발되지 않을 수준
51 -100 보통 환자군에게 만성 노출시 경미한 영향이 유발될 수 있는 수준
101-150 민감군영향 환자군 및 민감군에게 유해한 영향이 유발될 수 있는 수준
151-200 나쁨 환자군 및 민감군(어린이, 노약자 등)에게 유해한 영향 유발, 일반인도 건강상 불쾌감을 경험할 수 있는 수준
201-300 매우나쁨 환자군 및 민감군에게 급성 노출시 심각한 영향 유발, 일반인도 약한 영향이 유발될 수 있는 수준
300+ 위험 환자군 및 민감군에게 응급 조치가 발생되거나, 일반인에게 유해한 영향이 유발될 수 있는 수준
(Reference: see airkorea.or.kr)

대기질과 오염에 대해 더 많은 것을 알아보려면 위키피디아의 대기질 문서(영어)을 보거나 대기질과 건강에 대한 AirNow 가이드(영어)를 참조해보세요.

매우 유용한 베이징의 의학박사 Richard Saint Cyr MD의 건강 관련 팁을 보려면 www.myhealthbeijing.com 의 블로그를 확인하세요.


사용안내: 모든 대기 질 데이터는 발행 당시에 검증되지 않았으며, 품질 보증으로 인해 이러한 데이터는 예고없이 언제든지 수정 될 수 있습니다. 세계 대기 품질 지수 프로젝트는이 정보의 내용을 편집함에있어 합당한 기술과 관심을 행사했으며 어떤 상황에서도 세계 대기 품질 지수 (World Air Quality Index) 프로젝트 팀 또는 그 대리인은이 데이터의 공급으로 인해 직접 또는 간접적으로 발생하는 손실, 상해 또는 손해에 대해 계약, 불법 행위 또는 기타의 책임을지지 않습니다.



설정


언어 설정 :


Temperature unit:
Celcius