New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

airthings-consumer-api

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

airthings-consumer-api

An unofficial Node.js client library for Airthings Air Quality Monitors via the Airthings Consumer API.

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

Airthings Consumer API Client

npm node downloads types Ask DeepWiki

An unofficial Node.js client library for Airthings Air Quality Monitors via the Airthings Consumer API.

Docs

https://michaelahern.github.io/airthings-consumer-api/

Installing

$ npm install airthings-consumer-api

Example

import { AirthingsClient, SensorUnits } from 'airthings-consumer-api';

async function main() {
    // Create an Airthings Client ID & Secret at
    // https://consumer-api-doc.airthings.com/dashboard
    const client = new AirthingsClient({
        clientId: '[CLIENT_ID]',
        clientSecret: '[CLIENT_SECRET]'
    });

    const devicesResponse = await client.getDevices();
    devicesResponse.devices.forEach((device) => {
        console.log(device);
    });

    // {
    //   serialNumber: '2960000000',
    //   home: 'My Home',
    //   name: 'My Airthings',
    //   type: 'VIEW_PLUS',
    //   sensors: [
    //     'radonShortTermAvg',
    //     'temp',
    //     'humidity',
    //     'pressure',
    //     'co2',
    //     'voc',
    //     'pm1',
    //     'pm25'
    //   ]
    // }

    const sensorsResponse = await client.getSensors(SensorUnits.Imperial);
    sensorsResponse.results.forEach((sensor) => {
        console.log(sensor);
    });

    // {
    //   serialNumber: '2960000000',
    //   sensors: [
    //     { sensorType: 'radonShortTermAvg', value: 1.2, unit: 'pci' },
    //     { sensorType: 'humidity', value: 40, unit: 'pct' },
    //     { sensorType: 'temp', value: 68.8, unit: 'f' },
    //     { sensorType: 'co2', value: 678, unit: 'ppm' },
    //     { sensorType: 'voc', value: 234, unit: 'ppb' },
    //     { sensorType: 'pressure', value: 78178, unit: 'pa' },
    //     { sensorType: 'pm25', value: 0, unit: 'mgpc' },
    //     { sensorType: 'pm1', value: 0, unit: 'mgpc' }
    //   ],
    //   recorded: '2025-01-01T12:34:56',
    //   batteryPercentage: 100
    // }
}

main().catch(err => console.error(err));

Keywords

airthings

FAQs

Package last updated on 22 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts