Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

purple_air_api (PAA)

This is a python3 wrapper for the PurpleAirAPI (PAA). Details of the API can be found using this link: https://api.purpleair.com/#api-welcome

To use the PurpleAirAPI (PAA), API keys are required. You can get API keys by sending an email to contact@purpleair.com with a first and last name to assign them to.

PyPI Distributions TestPyPI Distributions Black Tests Total download count Latest release download count

How to Support This Project

Buy Me A Coffee

Purpose

This package is designed to be used for making tools around the PurpleAir API.

For example, PAA data loggers - https://github.com/carlkidcrypto/purpleair_data_logger

Requirements

  • Python 3.10 or higher (supports Python 3.10, 3.11, 3.12, 3.13, and 3.14)

  • requests library

Installation

You can install the PurpleAir API via pip:

python3 -m pip install purpleair_api

You can also install PurpleAir API by cloning down this repo:

git clone https://github.com/carlkidcrypto/purpleair_api.git
cd purpleair_api
pip install .

PurpleAirAPI Usage Example

First we need to import the PurpleAir API (PAA):

from purpleair_api.PurpleAirAPI import PurpleAirAPI

Next we need to make an instance of PAA:

my_paa = PurpleAirAPI(your_api_read_key, your_api_write_key, [your_ipv4_address])

Now you can use that PAA instance to do things like:

retval = my_paa.request_sensor_data(1234)

PurpleAirReadAPI Usage Example

First we need to import the PurpleAirReadAPI:

from purpleair_api.PurpleAirReadAPI import PurpleAirReadAPI

Now we need to make an instance of it:

my_paa = PurpleAirReadAPI(api_read_key)

Now we can use that instance to do things like:

retval = my_paa.request_multiple_sensors_data("name")

PurpleAirWriteAPI Usage Example

First we need to import the PurpleAirWriteAPI:

from purpleair_api.PurpleAirWriteAPI import PurpleAirWriteAPI

Now we need to make an instance of it:

my_paa = PurpleAirWriteAPI(api_write_key)

Now we can use that instance to do things like:

retval = my_paa.post_create_member(group_id=1234, sensor_index=5678)

PurpleAirLocalAPI Usage Example

First we need to import the PurpleAirLocalAPI:

from purpleair_api.PurpleAirLocalAPI import PurpleAirLocalAPI

Now we need to make an instance of it:

my_paa = PurpleAirLocalAPI(["ipv4_address"])

Now we can use that instance to do things like:

retval = my_paa.request_local_sensor_data()

Tests

Refer to the test README

Documentation

Full API documentation is available at https://carlkidcrypto.github.io/purpleair_api/


This content was generated by AI and reviewed by humans. Mistakes may still occur. PRs for corrections are welcome.

Matter Device Converter (Matter 1.5.1)

Map PurpleAir sensor data to Matter device type structures for use with Matter-compatible ecosystems (Apple Home, Google Home, Alexa, SmartThings, Home Assistant Matter integration).

Supports Matter 1.5.1 Air Quality Sensor (Device Type 0x002D), Temperature Sensor, and Environmental Sensor device types with full EPA AQI calculation.

from purpleair_api.PurpleAirReadAPI import PurpleAirReadAPI
from purpleair_api.PurpleAirMatterConverter import PurpleAirMatterConverter

pa = PurpleAirReadAPI("YOUR_READ_API_KEY")
raw = pa.request_sensor_data(282168)

matter_device = PurpleAirMatterConverter.to_air_quality_sensor(raw)
print(matter_device["air_quality_summary"])
# {'epa_aqi': 68, 'epa_category': 'Moderate',
#  'matter_air_quality_rating': 'GOOD', ...}

See the Matter implementation guide at sphinx_docs_build/source/matter_implementation.rst or docs/html/matter_implementation.html after building, or read the rendered guide online at https://carlkidcrypto.github.io/purpleair_api/matter_implementation.html. The API reference remains available at sphinx_docs_build/source/PurpleAirMatterConverter.rst.

References:

Metadata

Release files for purpleair-api 1.5.1a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for purpleair-api 1.5.1a1
File Size Uploaded Provenance
purpleair_api-1.5.1a1.tar.gz 33.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for purpleair-api 1.5.1a1
File Interpreter ABI Platform
purpleair_api-1.5.1a1-py3-none-any.whl Python 3 none any Details

Total release size: 57.3 kB

Release files / purpleair_api-1.5.1a1.tar.gz

Download URL purpleair_api-1.5.1a1.tar.gz
Size 33.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fb1930e18dabfcd2674e2b317437bba17a48cdf6c76e46e22d0e6e08c421da89
BLAKE2b-256 checksum
How to use checksums
a7846b87472aa131ff5cc74fb8a2e0e616269989c1e811fee4ea06ee12d15b68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / purpleair_api-1.5.1a1-py3-none-any.whl

Download URL purpleair_api-1.5.1a1-py3-none-any.whl
Size 23.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a01181da22706accf82adcf356755ad259c8d07fa74d24d7c423cbcd6816dfbe
BLAKE2b-256 checksum
How to use checksums
125c2ee40deeb92247f28ee7fc7e7fa4fa337d52a84a518f08c91b3a4212a245
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Security for purpleair-api 1.5.1a1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for purpleair_api-1.5.1a1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page