GET /data

Parameters

nametypedata typedescription
zipcoderequiredintzipcode of user's location
api_keyrequiredstringuser's purpleair API key

Responses

http codecontent-typeresponse
200application/jsonJSON object
400application/json{error: "Invalid zipcode"}
400application/json{"error": "No sensors found within the range of "x" miles."}
400application/json{"error": "No read key or zipcode provided."}

Example response

   {
       "zip_code": 11101,
       "pm2.5": 2.4,
       "pm2.5_30minute": 2.4,
       "pm2.5_60minute": 2.6,
       "pm2.5_1week": 3.4,
       "temperature": 52,
       "IAQI": {
           "score": 105,
           "descriptor": "Good"
          }
   }