# API

**URL:** https://community.purpleair.com/c/data/api/18.md?page=2

[Latest](https://community.purpleair.com/latest.md) · [Categories](https://community.purpleair.com/categories.md)

**Page:** 3

---

## [PaymentRequiredError making api calls](https://community.purpleair.com/t/paymentrequirederror-making-api-calls/3971)

<div class="topic-metadata">

**Author:** [@Sam\_Wolfand](https://community.purpleair.com/u/Sam_Wolfand)\
**Replies:** 37\
**Last updated:** [November 6, 2023, 8:29pm UTC](https://community.purpleair.com/t/paymentrequirederror-making-api-calls/3971 "2023-11-06T20:29:07Z")

</div>

When trying to make a request to the historical data endpoint https://api.purpleair.com/v1/sensors/124139/history/csv?api\_key=xxx-xxx-xxx&start\_timestamp=1679543743&fields=humidity,temperature,pressure,pm2.5\_alt but am…

---

## [Can i get all sensors id's?](https://community.purpleair.com/t/can-i-get-all-sensors-ids/6926)

<div class="topic-metadata">

**Author:** [@gugarauj07](https://community.purpleair.com/u/gugarauj07)\
**Replies:** 4\
**Last updated:** [November 6, 2023, 3:52pm UTC](https://community.purpleair.com/t/can-i-get-all-sensors-ids/6926 "2023-11-06T15:52:08Z")

</div>

I would like to get the data of all the sensors registered on south america automatically in my app. Otherwise, i have to keep updating my code whenever i install a new sensor. Is there a way to do it?

---

## [Accuracy of Latitude and Longitude on API](https://community.purpleair.com/t/accuracy-of-latitude-and-longitude-on-api/3737)

<div class="topic-metadata">

**Author:** [@Alisha\_Jimenez](https://community.purpleair.com/u/Alisha_Jimenez)\
**Replies:** 9\
**Last updated:** [October 27, 2023, 12:08am UTC](https://community.purpleair.com/t/accuracy-of-latitude-and-longitude-on-api/3737 "2023-10-27T00:08:35Z")

</div>

How accurate are the latitude and longitude reported on the API? How are the coordinates acquired? Is there a GPS system in the sensors?

---

## [Problems with API stability, rate limiting](https://community.purpleair.com/t/problems-with-api-stability-rate-limiting/6567)

<div class="topic-metadata">

**Author:** [@Marcin](https://community.purpleair.com/u/Marcin)\
**Replies:** 1\
**Last updated:** [September 20, 2023, 5:15pm UTC](https://community.purpleair.com/t/problems-with-api-stability-rate-limiting/6567 "2023-09-20T17:15:23Z")

</div>

Hi, I tried to resurrect my old project Purp to better visualize PurpleAir data, it went dead with the new API changes. After adapting it to the new API, I noticed a few main issues: the rate limits seem extremely ex…

---

## [PurpleAir Data Download Tool - Issue with getting the latitude & longitude of sensors](https://community.purpleair.com/t/purpleair-data-download-tool-issue-with-getting-the-latitude-longitude-of-sensors/4550)

<div class="topic-metadata">

**Author:** [@megonzalez](https://community.purpleair.com/u/megonzalez)\
**Replies:** 3\
**Last updated:** [September 18, 2023, 8:03pm UTC](https://community.purpleair.com/t/purpleair-data-download-tool-issue-with-getting-the-latitude-longitude-of-sensors/4550 "2023-09-18T20:03:33Z")

</div>

For my project, I need to get all the latitudes and longitude of all (both current and past) PurpleAIr sensors in South Africa using the PurpleAir Data Download Tool. I tested doing this with one sensor with the sensor …

---

## [Unable to use Python to create a group](https://community.purpleair.com/t/unable-to-use-python-to-create-a-group/1089)

<div class="topic-metadata">

**Author:** [@dongzwak](https://community.purpleair.com/u/dongzwak)\
**Replies:** 1\
**Last updated:** [September 9, 2023, 9:53pm UTC](https://community.purpleair.com/t/unable-to-use-python-to-create-a-group/1089 "2023-09-09T21:53:32Z")

</div>

I am trying to create a new group using Python, my code is the following. But I keep receiving error. I could be wrong but I assume it has something to do with the User-Agent in the header (which is missing here since I …

---

## [Widget issues with Pressure on PA-II sensor](https://community.purpleair.com/t/widget-issues-with-pressure-on-pa-ii-sensor/5785)

<div class="topic-metadata">

**Author:** [@iheartpi](https://community.purpleair.com/u/iheartpi)\
**Replies:** 0\
**Last updated:** [July 28, 2023, 12:33am UTC](https://community.purpleair.com/t/widget-issues-with-pressure-on-pa-ii-sensor/5785 "2023-07-28T00:33:19Z")

</div>

I am trying to embed data from a specific sensor in a webpage. When I go to the maps and click the sensor I want with the variable (in this case Pressure) selected and hover over the get widget to copy the embeded code……

---

## [(Outdated) Historical API Endpoints are now Restricted](https://community.purpleair.com/t/outdated-historical-api-endpoints-are-now-restricted/1557)

<div class="topic-metadata">

**Author:** [@Ethan](https://community.purpleair.com/u/Ethan)\
**Replies:** 3\
**Last updated:** [July 24, 2023, 10:10pm UTC](https://community.purpleair.com/t/outdated-historical-api-endpoints-are-now-restricted/1557 "2023-07-24T22:10:05Z")

</div>

The historical endpoints in the PurpleAir API have recently become restricted due to extremely heavy use. To use the historical API, you will need to be granted access. To gain access, contact us at contact@purpleair.co…

---

## [Connecting the API to Geoevent Server](https://community.purpleair.com/t/connecting-the-api-to-geoevent-server/5127)

<div class="topic-metadata">

**Author:** [@jpac000](https://community.purpleair.com/u/jpac000)\
**Replies:** 0\
**Last updated:** [June 22, 2023, 3:35pm UTC](https://community.purpleair.com/t/connecting-the-api-to-geoevent-server/5127 "2023-06-22T15:35:36Z")

</div>

Does anyone know how to connect the PurpleAir to an esri GeoEvent Server.

---

## [API Correct Timestamp Get Sensors API Call](https://community.purpleair.com/t/api-correct-timestamp-get-sensors-api-call/2057)

<div class="topic-metadata">

**Author:** [@jenv](https://community.purpleair.com/u/jenv)\
**Replies:** 1\
**Last updated:** [September 21, 2022, 10:28pm UTC](https://community.purpleair.com/t/api-correct-timestamp-get-sensors-api-call/2057 "2022-09-21T22:28:33Z")

</div>

Hello, I’m looking at using the Purple Air API call Get Sensors Data to pull sensor data. The field last\_seen states “The UNIX time stamp of the last time the server received data from the device.” I’m assuming this i…

---

## [Sensor history limited by time intervals](https://community.purpleair.com/t/sensor-history-limited-by-time-intervals/2930)

<div class="topic-metadata">

**Author:** [@BCHomestudy](https://community.purpleair.com/u/BCHomestudy)\
**Replies:** 1\
**Last updated:** [June 8, 2023, 5:02pm UTC](https://community.purpleair.com/t/sensor-history-limited-by-time-intervals/2930 "2023-06-08T17:02:27Z")

</div>

Hi all, I am using the API to retrieve historical data for a large group of sensors. I believe that the current limits on historical Get requests are: Real-time: 2 days 10 Minute : 3 days 30 minute: 7 days 1 hr: 14 …

---

## [PurpleAir Crypto Rewards?](https://community.purpleair.com/t/purpleair-crypto-rewards/4637)

<div class="topic-metadata">

**Author:** [@Rob\_Luxem](https://community.purpleair.com/u/Rob_Luxem)\
**Replies:** 0\
**Last updated:** [May 24, 2023, 11:44am UTC](https://community.purpleair.com/t/purpleair-crypto-rewards/4637 "2023-05-24T11:44:25Z")

</div>

It would be nice to set up a crypto reward system similar to Helium or Dimo for all of the users who bought sensors to provide data to the network. Just a thought.

---

## [Outdoor sensor returning 0 on all sensors](https://community.purpleair.com/t/outdoor-sensor-returning-0-on-all-sensors/1132)

<div class="topic-metadata">

**Author:** [@willowpad](https://community.purpleair.com/u/willowpad)\
**Replies:** 0\
**Last updated:** [July 3, 2022, 2:01am UTC](https://community.purpleair.com/t/outdoor-sensor-returning-0-on-all-sensors/1132 "2022-07-03T02:01:56Z")

</div>

I went to check on my outdoor sensor and it’s showing 0 for all both A/B across all measurements. You can see this in the JSON from sensor on my local network. {"SensorId":"10:52:1c:42:25:30","DateTime":"2022/07/03T01:5…

---

## [How is hourly historical purpleair data generated?](https://community.purpleair.com/t/how-is-hourly-historical-purpleair-data-generated/4217)

<div class="topic-metadata">

**Author:** [@amukherj](https://community.purpleair.com/u/amukherj)\
**Replies:** 0\
**Last updated:** [April 14, 2023, 9:20pm UTC](https://community.purpleair.com/t/how-is-hourly-historical-purpleair-data-generated/4217 "2023-04-14T21:20:50Z")

</div>

Hi folks, I have been working with hourly historical purpleair data through the “Get Sensor History” pathway. I have questions about how is this data generated such as: Are there any quality control steps that are ap…

---

## [Query data of multiple sensor by bounding box or group](https://community.purpleair.com/t/query-data-of-multiple-sensor-by-bounding-box-or-group/4329)

<div class="topic-metadata">

**Author:** [@Hoang\_Trung\_Le](https://community.purpleair.com/u/Hoang_Trung_Le)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 3:42am UTC](https://community.purpleair.com/t/query-data-of-multiple-sensor-by-bounding-box-or-group/4329 "2023-05-01T03:42:39Z")

</div>

Hello everyone! I’m brand new to PurpleAir and it’s exciting to join the community. I would like to ask for your explanation on what the differences are between query data from multiple sensors by using the bounding box…

---

## [How to download the data for all the sensors over USA? Not able to get any efficient way](https://community.purpleair.com/t/how-to-download-the-data-for-all-the-sensors-over-usa-not-able-to-get-any-efficient-way/4300)

<div class="topic-metadata">

**Author:** [@Pratik\_Nag](https://community.purpleair.com/u/Pratik_Nag)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 3:36am UTC](https://community.purpleair.com/t/how-to-download-the-data-for-all-the-sensors-over-usa-not-able-to-get-any-efficient-way/4300 "2023-05-01T03:36:37Z")

</div>

I am trying to download the data for all the sensors in USA. But the api query method is not giving any suggestions on how I can get all the sensor id over US. Kindly help me out with this.

---

## [Invalid JSON from API](https://community.purpleair.com/t/invalid-json-from-api/4377)

<div class="topic-metadata">

**Author:** [@jdarpinian](https://community.purpleair.com/u/jdarpinian)\
**Replies:** 0\
**Last updated:** [April 29, 2023, 5:20pm UTC](https://community.purpleair.com/t/invalid-json-from-api/4377 "2023-04-29T17:20:52Z")

</div>

Hi, I’m seeing invalid responses from the PurpleAir API. Starting at 10:25 AM Pacific Time yesterday (April 28), about 50% of the time the API response will contain an “ApiSqlException” error saying something like “Value…

---

## [R script to retrieve historical data](https://community.purpleair.com/t/r-script-to-retrieve-historical-data/3046)

<div class="topic-metadata">

**Author:** [@willianflores](https://community.purpleair.com/u/willianflores)\
**Replies:** 15\
**Last updated:** [March 22, 2023, 6:44am UTC](https://community.purpleair.com/t/r-script-to-retrieve-historical-data/3046 "2023-03-22T06:44:40Z")

</div>

Hi everyone! I’m still new to this group, so I apologize in advance if this has been answered before. Does anyone know of an existing R script that uses the new API to create a data file of all historical data for a giv…

---

## [Python script for downloading and organizing historical API data](https://community.purpleair.com/t/python-script-for-downloading-and-organizing-historical-api-data/3726)

<div class="topic-metadata">

**Author:** [@Aaron\_Lamplugh](https://community.purpleair.com/u/Aaron_Lamplugh)\
**Replies:** 9\
**Last updated:** [March 21, 2023, 4:43pm UTC](https://community.purpleair.com/t/python-script-for-downloading-and-organizing-historical-api-data/3726 "2023-03-21T16:43:48Z")

</div>

Hey all, I just finished this python script to access historical data through the API. It pulls data for all monitors in a registered group. It then creates a file structure where it dumps the data and compiles it into …

---

## [Meaning of channel\_state](https://community.purpleair.com/t/meaning-of-channel-state/3836)

<div class="topic-metadata">

**Author:** [@JerryN](https://community.purpleair.com/u/JerryN)\
**Replies:** 2\
**Last updated:** [March 6, 2023, 5:17pm UTC](https://community.purpleair.com/t/meaning-of-channel-state/3836 "2023-03-06T17:17:37Z")

</div>

I can’t find a definition of the channel\_state values. And for that matter, some of the other fields in the api such as confidence, and confidence\_manual. Is there an api definitions lookup somewhere?

---

## [How to filter data by location. i.e. filter by certain zipcode/geolocation?](https://community.purpleair.com/t/how-to-filter-data-by-location-i-e-filter-by-certain-zipcode-geolocation/3741)

<div class="topic-metadata">

**Author:** [@dddictionary](https://community.purpleair.com/u/dddictionary)\
**Replies:** 2\
**Last updated:** [February 26, 2023, 7:59pm UTC](https://community.purpleair.com/t/how-to-filter-data-by-location-i-e-filter-by-certain-zipcode-geolocation/3741 "2023-02-26T19:59:51Z")

</div>

Currently when accessing the data, I receive a huge array of data which doesn’t really hold any meaning to me. I would like to filter the data such that only sensors that are near me are returned. How would I go about do…

---

## [Time Stamp in API](https://community.purpleair.com/t/time-stamp-in-api/3711)

<div class="topic-metadata">

**Author:** [@Sydonia\_Grogan](https://community.purpleair.com/u/Sydonia_Grogan)\
**Replies:** 1\
**Last updated:** [February 24, 2023, 6:07pm UTC](https://community.purpleair.com/t/time-stamp-in-api/3711 "2023-02-24T18:07:53Z")

</div>

When pulling data through the API, does the server correct for the time zone? Or is the output based on UTC?

---

## [Should I use groups for historical data downloads from multiple sensors?](https://community.purpleair.com/t/should-i-use-groups-for-historical-data-downloads-from-multiple-sensors/3639)

<div class="topic-metadata">

**Author:** [@ihsankahveci](https://community.purpleair.com/u/ihsankahveci)\
**Replies:** 3\
**Last updated:** [February 17, 2023, 9:08pm UTC](https://community.purpleair.com/t/should-i-use-groups-for-historical-data-downloads-from-multiple-sensors/3639 "2023-02-17T21:08:44Z")

</div>

I am trying to send requests for downloading daily averages of ~300 sensors over 3 years. The API guide suggests using the group functionality when working with real-time API. However, historical API doesn’t support mult…

---

## [Getting historical data with API keys in Python](https://community.purpleair.com/t/getting-historical-data-with-api-keys-in-python/3447)

<div class="topic-metadata">

**Author:** [@ashlaff](https://community.purpleair.com/u/ashlaff)\
**Replies:** 4\
**Last updated:** [February 8, 2023, 11:03pm UTC](https://community.purpleair.com/t/getting-historical-data-with-api-keys-in-python/3447 "2023-02-08T23:03:13Z")

</div>

Hi all, I am trying to download some historical data from the last 2 months using python but seem to be running into some issues, I was wondering has anyone been using python rather than R that could help me out? This …

---

## [Is there an Introductory guide on how to utilise the API to analyse historical data?](https://community.purpleair.com/t/is-there-an-introductory-guide-on-how-to-utilise-the-api-to-analyse-historical-data/3148)

<div class="topic-metadata">

**Author:** [@redskies421](https://community.purpleair.com/u/redskies421)\
**Replies:** 8\
**Last updated:** [January 24, 2023, 10:08pm UTC](https://community.purpleair.com/t/is-there-an-introductory-guide-on-how-to-utilise-the-api-to-analyse-historical-data/3148 "2023-01-24T22:08:06Z")

</div>

Hello, I first would like to say hello! I am a research scientist that was just introduced to Purpleair and am becoming more familiar on how to utilise the data presented. While my doctorate is in behavioural and spatia…

---

## [Python PurpleAirAPI (PAA) Implementation](https://community.purpleair.com/t/python-purpleairapi-paa-implementation/1353)

<div class="topic-metadata">

**Author:** [@carlkidcrypto-paa](https://community.purpleair.com/u/carlkidcrypto-paa)\
**Replies:** 8\
**Last updated:** [January 19, 2023, 4:38pm UTC](https://community.purpleair.com/t/python-purpleairapi-paa-implementation/1353 "2023-01-19T16:38:48Z")

</div>

Hello All, Just thought I would share with you a side project I’ve been working on. This is the link to the repository: https://github.com/carlkid1499/purple\_air\_data\_logger#readme In a nutshell, the “PurpleAirAPI.py” …

---

## [Erro 400 api.purpleair get historical data](https://community.purpleair.com/t/erro-400-api-purpleair-get-historical-data/2785)

<div class="topic-metadata">

**Author:** [@Val](https://community.purpleair.com/u/Val)\
**Replies:** 6\
**Last updated:** [January 18, 2023, 9:05pm UTC](https://community.purpleair.com/t/erro-400-api-purpleair-get-historical-data/2785 "2023-01-18T21:05:48Z")

</div>

Good afternoon! I am requesting in api.purpleair to get historical data (CSV) but it is giving following error message: Error 400 { “api\_version”: “V1.0.11-0.0.41”, “time\_stamp”: 1669149190, “error”: “InvalidParame…

---

## [Python script to retrieve historical data](https://community.purpleair.com/t/python-script-to-retrieve-historical-data/2923)

<div class="topic-metadata">

**Author:** [@benwe](https://community.purpleair.com/u/benwe)\
**Replies:** 4\
**Last updated:** [December 19, 2022, 5:26am UTC](https://community.purpleair.com/t/python-script-to-retrieve-historical-data/2923 "2022-12-19T05:26:25Z")

</div>

Hi everyone! I hope you’re doing well. I’m still new to this group so I am sorry in advance if this has been answered before. Does anyone know of an existing Python script that uses the new API to build a data file of al…

---

## [Preview of API that includes the ability to get sensor history](https://community.purpleair.com/t/preview-of-api-that-includes-the-ability-to-get-sensor-history/853)

<div class="topic-metadata">

**Author:** [@Adrian](https://community.purpleair.com/u/Adrian)\
**Replies:** 40\
**Last updated:** [December 6, 2022, 4:21pm UTC](https://community.purpleair.com/t/preview-of-api-that-includes-the-ability-to-get-sensor-history/853 "2022-12-06T16:21:55Z")

</div>

Here is the preview url for an upcoming API change: https://june2022.api.purpleair.com/ You will need to use that full url (june2022.api.purpleair.com) instead of api.purpleair.com to test it. The documentation on ther…

---

## [Averaging periods and local sensor time](https://community.purpleair.com/t/averaging-periods-and-local-sensor-time/2865)

<div class="topic-metadata">

**Author:** [@brianellin](https://community.purpleair.com/u/brianellin)\
**Replies:** 0\
**Last updated:** [December 2, 2022, 7:13pm UTC](https://community.purpleair.com/t/averaging-periods-and-local-sensor-time/2865 "2022-12-02T19:13:30Z")

</div>

Do you have guidance on how to think about longer averaging periods and local sensor time? For example, I’m interested in analyzing the 1440 (day) average for sensors in the US/Pacific timezone, in which a day is midnig…

[Previous page](https://community.purpleair.com/c/data/api/18.md?page=1)

[Next page](https://community.purpleair.com/c/data/api/18.md?page=3)
