# Obtaining PurpleAir location data (lat/long) for California

**URL:** <https://community.purpleair.com/t/obtaining-purpleair-location-data-lat-long-for-california/3171>\
**Category:** API\
**Created:** [January 5, 2023, 9:12pm UTC](https://community.purpleair.com/t/obtaining-purpleair-location-data-lat-long-for-california/3171 "2023-01-05T21:12:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![emmsage](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@emmsage](https://community.purpleair.com/u/emmsage)\
**Post date:** [January 5, 2023, 9:12pm UTC](https://community.purpleair.com/t/obtaining-purpleair-location-data-lat-long-for-california/3171/1 "2023-01-05T21:12:39Z")

</div>

Hi everyone,

I am new to programming and using the PurpleAir API, and would really appreciate guidance on how to best download location data for all PurpleAir sensors in California (it doesn’t need to be historical data, just the current locations of sensors throughout the state). I am using this for a project looking at the relationship between PurpleAir sensor distribution and sociodemographic variables.

It seems like the best way might be to enter SW/SE/NW/NE coordinates to create a rectangle that covers the state, but if there’s a better way to do this, I’d love any insight!

Thanks so much.

---

<div class="post-metadata">

**Author:** ![emmsage](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@emmsage](https://community.purpleair.com/u/emmsage)\
**Post date:** [January 9, 2023, 6:34pm UTC](https://community.purpleair.com/t/obtaining-purpleair-location-data-lat-long-for-california/3171/2 "2023-01-09T18:34:51Z")

</div>

Update - I was able to figure this out and successfully downloaded the data.

---

<div class="post-metadata">

**Author:** ![caro](https://sea2.discourse-cdn.com/flex020/user_avatar/community.purpleair.com/caro/32/1995_2.png) [@caro](https://community.purpleair.com/u/caro)\
**Post date:** [February 5, 2023, 2:01am UTC](https://community.purpleair.com/t/obtaining-purpleair-location-data-lat-long-for-california/3171/3 "2023-02-05T02:01:04Z")

</div>

Hi,

I am attempting to do the same. Do you mind sharing the steps you took to download the data?  
I would greatly appreciate it.

Thank you.

---

<div class="post-metadata">

**Author:** ![bluesystems](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@bluesystems](https://community.purpleair.com/u/bluesystems)\
**Post date:** [February 6, 2023, 12:13am UTC](https://community.purpleair.com/t/obtaining-purpleair-location-data-lat-long-for-california/3171/4 "2023-02-06T00:13:05Z")

</div>

Att Purple Air, Where is your heart

Note you stated from the start.  
PurpleAir is built on the ideal of sharing data and by doing this, empowering individuals to effect change. All public PurpleAir data is available to download under various licenses

Now your sensor users find that their data is NOT freely available for download due to the very limited (crippled) tools that are now provided for users. The very limited tools of today now make the data for practical purposes for many uses unavailable.  
So again I ask the staff at Purple Air…  
Where is your heart

---

<div class="post-metadata">

**Author:** ![sophiematuch](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sophiematuch](https://community.purpleair.com/u/sophiematuch)\
**Post date:** [May 25, 2024, 5:48pm UTC](https://community.purpleair.com/t/obtaining-purpleair-location-data-lat-long-for-california/3171/5 "2024-05-25T17:48:29Z")

</div>

Hi. I am also trying to download the location data for the PurpleAir sensors in LA, how did you go about downloading the data? Thanks.

---

<div class="post-metadata">

**Author:** ![sophiematuch](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sophiematuch](https://community.purpleair.com/u/sophiematuch)\
**Post date:** [May 25, 2024, 5:49pm UTC](https://community.purpleair.com/t/obtaining-purpleair-location-data-lat-long-for-california/3171/6 "2024-05-25T17:49:07Z")

</div>

Hi. I am also trying to download the location data for the PurpleAir sensors in LA, did you ever figure out how to download the data locations? Thanks.

---

<div class="post-metadata">

**Author:** ![Andrew](https://sea2.discourse-cdn.com/flex020/user_avatar/community.purpleair.com/andrew/32/1211_2.png) [@Andrew](https://community.purpleair.com/u/Andrew)\
**Post date:** [May 28, 2024, 4:20pm UTC](https://community.purpleair.com/t/obtaining-purpleair-location-data-lat-long-for-california/3171/7 "2024-05-28T16:20:40Z")

</div>

@sophiematuch  
To get the locations, you’ll start by using a [Get Sensors Data](https://api.purpleair.com/#api-sensors-get-sensors-data) API call. This will allow you to create a geographic bounding box and retrieve data from the sensors in that bounding box. The data will be from the most recent report from each of the sensors, so the historical data cannot be gathered using this call. Rather, the purpose of this API call is to retrieve station information about the sensors. You will receive the sensor index for all sensors in the bounding box by default, and you can also request other fields, such as `latitude`, `longitude`, `altitude`, `name`, `model`, `location_type`, and [other information about each sensor that doesn’t change frequently](https://community.purpleair.com/t/how-to-make-efficient-api-calls/6906#fields-that-dont-update-often-5).

Once you have your list of sensor indexes, you can use the [Get Sensor History](https://api.purpleair.com/#api-sensors-get-sensor-history) (or [CSV version](https://api.purpleair.com/#api-sensors-get-sensor-history-csv)) to get the historical data. Alternatively, you can use the [PurpleAir Data Download Tool](https://community.purpleair.com/t/purpleair-data-download-tool/3787), which accesses the History API in the same way, but is a more user-friendly way to do so.

---

<div class="post-metadata">

**Author:** ![Andrew](https://sea2.discourse-cdn.com/flex020/user_avatar/community.purpleair.com/andrew/32/1211_2.png) [@Andrew](https://community.purpleair.com/u/Andrew)\
**Post date:** [May 28, 2024, 4:29pm UTC](https://community.purpleair.com/t/obtaining-purpleair-location-data-lat-long-for-california/3171/8 "2024-05-28T16:29:59Z")

</div>

Hi Bob, apologies for the incredibly late response. In case you haven’t received an answer to your question, here is some information on how retrieving data is made free for sensor owners: [API Points for Sensor Owners](https://community.purpleair.com/t/api-points-for-sensor-owners/7525).

Regarding ease of use, here is an article that will walk you through how to retrieve data using a variety of tools: [How do I download sensor data?](https://community.purpleair.com/t/how-do-i-download-sensor-data/4650)
