# Creating API Keys

**URL:** <https://community.purpleair.com/t/creating-api-keys/3951>\
**Category:** API\
**Created:** [March 20, 2023, 6:33pm UTC](https://community.purpleair.com/t/creating-api-keys/3951 "2023-03-20T18:33:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PurpleAir](https://sea2.discourse-cdn.com/flex020/user_avatar/community.purpleair.com/purpleair/32/176_2.png) [@PurpleAir](https://community.purpleair.com/u/PurpleAir)\
**Post date:** [March 20, 2023, 6:33pm UTC](https://community.purpleair.com/t/creating-api-keys/3951/1 "2023-03-20T18:33:18Z")

</div>

> This article is related to the PurpleAir API. If you are unfamiliar with it, check out our [API Landing Page](https://community.purpleair.com/t/api-landing-page/7145) to get started.

This article will go over how to create API keys and navigate the API portal.

You will need a Google account to sign in (doesn’t need to be an “@gmail.com” email address). You can learn more here: [Sign in to your Google Account with another email address – Google Account Help](https://support.google.com/accounts/answer/176347?hl=en&co=GENIE.Platform%3DDesktop)

If you want to use the PurpleAir API, you can create your own API keys here: [https://develop.purpleair.com/dashboards/keys](https://develop.purpleair.com/dashboards/keys).

Please review our article about the [API Online Dashboard.](https://community.purpleair.com/t/new-api-online-dashboard/3981)

* * *

## Create API Keys

- After signing in, click “API Keys” on the top bar.  
&nbsp;  
 ![Screenshot 2026-05-27 at 10.07.58 AM](https://us1.discourse-cdn.com/flex020/uploads/purpleair/original/2X/2/2a73fc4d9698e1298a620c9acc4ca54d5544d63d.png)  
&nbsp;
- Then click the “+ API Key” button in the top right corner of the screen.  
&nbsp;  
 ![Screenshot 2026-05-27 at 10.08.23 AM](https://us1.discourse-cdn.com/flex020/uploads/purpleair/optimized/2X/3/3669924fe3bd073e1450b152b3796f47899bed70_2_690x61.png)  
&nbsp;
- You will see an auto-populated project name, which you can rename anytime. You can have several projects and API keys. If you already have multiple projects, be sure to select the appropriate project.
- Select “Read” for the “Type,” select “Enabled” under “Status,” and leave the fields “Label,” “Host restrictions,” and “Referer restrictions” blank.  
&nbsp;  
 ![Screenshot 2026-05-27 at 10.08.39 AM](https://us1.discourse-cdn.com/flex020/uploads/purpleair/original/2X/9/99efdbeecb409191e3f375702902aa4850af639e.png)  
&nbsp;
- Click “Create.”
- To create a “Write” key, repeat the process but select “Write” under “Type.”

> When creating a new key, you will have the option to create a “Read” or “Write” key. Typically, a Read key will be used to pull data and a Write key will be used to update information on the API, such as [creating a group](https://community.purpleair.com/t/making-api-calls-with-the-purpleair-api/180#use-of-groups-5).

* * *

## Manage Projects

- On the top bar, click on “Projects.” Here you can edit and add projects, view each project’s usage, and archive projects.
- To add a project, click “+ Project” in the top right-hand corner of the page. Choose a project name, and click “Create.”
- To edit a project name, click the pencil icon to the right of the project name
- To archive a project, click the box icon to the right of the project name
- To check usage, click on the project name.  
&nbsp;

 ![Screenshot 2026-05-27 at 10.12.58 AM](https://us1.discourse-cdn.com/flex020/uploads/purpleair/original/2X/3/3d126db127544df9de4909e6d1e348a9b96fb3e4.png)

* * *

## Manage Users

- Select “Users” on the top bar. Here you can edit the name of a user.

* * *

## Manage Organizations

- Select “Organization” on the top bar. Here you can edit the organization’s name and view the organization’s usage.
- The “Purchase Points” button will allow you to add points to your account. Points are used to make API calls.

* * *

## Learn More

[PurpleAir API](https://api.purpleair.com/#api-sensors-get-sensor-data)  
[API Use Guidelines](https://community.purpleair.com/t/api-use-guidelines/1589)  
[Making calls with the PurpleAir API](https://community.purpleair.com/t/making-api-calls-with-the-purpleair-api/180)

---

<div class="post-metadata">

**Author:** ![James\_Laderoute](https://sea2.discourse-cdn.com/flex020/user_avatar/community.purpleair.com/james_laderoute/32/2967_2.png) [@James\_Laderoute](https://community.purpleair.com/u/James_Laderoute)\
**Post date:** [July 6, 2024, 9:57pm UTC](https://community.purpleair.com/t/creating-api-keys/3951/2 "2024-07-06T21:57:49Z")

</div>

My website’s name is www dot softwarejim dot com, so for Host Restriction that is what I typed in. My website is hosted on Hostinger dot com, so I tried that as well when softwarejim dot com did not work. Hostinger dot com also did not work. The error description that I got from using the API is “The provided API key is restricted to certain hosts. Neither ‘[https://www.softwarejim.com/](https://www.softwarejim.com/)’, ‘2601:18f:101:b590:f41f:2680:d18d:7074’ or ‘2601:18f:101:b590:f41f:2680:d18d:7074’ have access.”

I’m wondering what I’m doing wrong? I also tried just “softwarejim dot com”

---

<div class="post-metadata">

**Author:** ![James\_Laderoute](https://sea2.discourse-cdn.com/flex020/user_avatar/community.purpleair.com/james_laderoute/32/2967_2.png) [@James\_Laderoute](https://community.purpleair.com/u/James_Laderoute)\
**Post date:** [July 7, 2024, 7:39pm UTC](https://community.purpleair.com/t/creating-api-keys/3951/3 "2024-07-07T19:39:41Z")

</div>

I just realized the issue. The JavaScript runs locally on the person’s system, so their system (ip address) is the one being sent.

If I want to restrict it to [softwarejim.com](http://softwarejim.com), then I should use a CGI script that runs on the server instead of JavaScript that runs on the user’s system.
