Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.
openapi: 3.2.0
info:
version: 1.0.0
title: Airthings for Consumer Sensor API
description: The Airthings for Consumer API provides secure and authorized access for Airthings consumers to retrieve the latest data from their Airthings air quality monitors. Leveraging HTTPS and OAuth for enhanced security, this API empowers users to seamlessly access real-time information from their Airthings devices, gaining valuable insights into the air quality within their environments.
contact:
email: support@airthings.com
servers:
- url: https://consumer-api.airthings.com/v1
description: Airthings for Consumer API (prod)
tags:
- name: Sensor
paths:
/v1/accounts/{accountId}/sensors:
get:
summary: Get sensors for a set of devices
operationId: getMultipleSensors
parameters:
- $ref: '#/components/parameters/deviceSerialNumbers'
- $ref: '#/components/parameters/accountId'
- $ref: '#/components/parameters/pageNumber'
- $ref: '#/components/parameters/unit'
tags:
- Sensor
security:
- bearerAuth: []
responses:
'200':
description: OK
headers:
X-RateLimit-Limit:
schema:
type: integer
description: Request limit per hour.
X-RateLimit-Remaining:
schema:
type: integer
description: The number of requests left for the time window.
X-RateLimit-Reset:
schema:
type: string
format: timestamp
description: The timestamp at which the current rate limit window resets.
content:
application/json:
schema:
type: object
properties:
results:
type: array
items:
$ref: '#/components/schemas/SensorsResponse'
hasNext:
type: boolean
description: True if next pages can be fetched, false otherwise.
totalPages:
type: integer
'429':
description: Rate limit exceeded
headers:
X-RateLimit-Retry-After:
schema:
type: string
format: timestamp
description: Number of seconds in which the current rate limit window resets.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
parameters:
pageNumber:
name: pageNumber
in: query
required: false
description: The number of a page (of 50 records) to fetch
schema:
type: integer
default: 1
accountId:
name: accountId
in: path
required: true
description: The account ID associated with the user
schema:
type: string
unit:
name: unit
in: query
required: false
description: The units type sensors values will be returned in
schema:
type: string
enum:
- metric
- imperial
default: metric
deviceSerialNumbers:
name: sn
in: query
required: false
description: The serial numbers of the devices
schema:
type: array
items:
type: string
style: form
explode: true
schemas:
SensorsResponse:
type: object
properties:
serialNumber:
type: string
sensors:
type: array
items:
$ref: '#/components/schemas/SensorResponse'
recorded:
type:
- string
- 'null'
batteryPercentage:
type:
- integer
- 'null'
Error:
type: object
properties:
message:
type: string
description: A message detailing the error encountered
SensorResponse:
type:
- object
- 'null'
properties:
sensorType:
type: string
value:
type: number
format: double
unit:
type: string
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
externalDocs:
description: Find out more about consumerAPI
url: https://consumer-api-doc.airthings.com/