Open Standard · v2.0 · Apache 2.0

The universal format
for air quality data

BXP is to atmospheric exposure data what MP4 is to video — a universal file format and protocol that any system can read, write, and exchange. Owned by nobody. Usable by everyone. Free forever.

Get Started → View on GitHub Try the Validator
31
Atmospheric Agents
v2.0
Protocol Version
0–100
BXP_HRI Scale
DOI
Zenodo Archived
7M
Premature deaths annually
attributed to air pollution — WHO, 2024

The sensors exist.
The data infrastructure does not.

Air quality sensors are deployed across thousands of cities, research institutions, and homes. But every device speaks a different format. Every platform uses a proprietary schema. Data cannot move freely between systems — so it doesn't.

BXP fixes this. A single open standard for reading, writing, and exchanging atmospheric exposure data — across sensors, servers, SDKs, and research platforms — with built-in health risk scoring, privacy protections, and federated networking.

Everything a standard needs to be universal

BXP defines the complete stack: file format, REST API, health risk index, privacy framework, and federated node architecture.

Universal formats by domain

VideoMP4Any player, any platform
DocumentsPDFIdentical anywhere
GeospatialGeoJSONOpen, composable
MessagingMQTTSpeaks across IoT
Air Quality.bxpThe missing standard
📄
.bxp File Format

JSON-based container carrying readings, location, quality flags, payload hash for integrity, and HRI score. Machine-readable and human-readable.

🌐
REST API Standard

Standard endpoints any server can implement. Submit readings, query by geohash, aggregate over time windows, verify integrity.

📊
BXP_HRI Score

WHO-derived composite Health Risk Index on a 0–100 scale. Comparable across all agents, locations, and time periods.

🔒
Privacy by Design

SHA-256 hashed person IDs, geohash-5 spatial floor, k≥5 anonymity on aggregates, cryptographic deletion proof.

🕸
Federated Architecture

Any institution can run a node. Nodes interoperate. No central owner. Data sovereignty preserved at the source.

Working in minutes, not days

The Python SDK ships with zero required dependencies. Everything else is optional.

python
# Install (zero required dependencies)
# pip install bxp-sdk         # once published
# pip install bxp-sdk[async]  # with async client
# Or: copy sdk/python/bxp_sdk.py into your project

from bxp_sdk import BXPClient, write_bxp, calculate_risk

# ── Calculate HRI without any server ──────────────────
risk = calculate_risk(pm25=47.2, no2=31.0, duration="8h", population="sensitive")
print(risk["score"])    # 72.4
print(risk["level"])    # HIGH
print(risk["advice"])   # Wear N95 outdoors. Close windows.

# ── Write a .bxp file ─────────────────────────────────
write_bxp("accra_20240101.bxp.json", {
    "latitude": 5.6037, "longitude": -0.1870,
    "pm25": 47.2, "no2": 18.3, "temp": 29.0,
    "durationS": 3600, "indoorOutdoor": "outdoor",
})

# ── Submit to a BXP node ──────────────────────────────
client = BXPClient("https://your-bxp-node.example.com")
result = client.submit(latitude=5.6037, longitude=-0.1870, pm25=47.2)
print(result["bxpHri"])  # 61.2
print(result["level"])   # HIGH

# ── Async client (requires pip install httpx) ──────────
from bxp_sdk import AsyncBXPClient
import asyncio

async def main():
    async with AsyncBXPClient("https://your-bxp-node.example.com") as client:
        result = await client.submit(latitude=5.6037, longitude=-0.1870, pm25=47.2)

asyncio.run(main())
shell
# Check node health
curl https://your-node.example.com/bxp/v2/health

# Get live air quality for a city
curl https://your-node.example.com/bxp/v2/city/accra

# Submit a reading (no auth required for anonymous)
curl -X POST https://your-node.example.com/bxp/v2/readings \
  -H "Content-Type: application/json" \
  -d '{
    "readings": [{
      "latitude": 5.6037,
      "longitude": -0.1870,
      "agents": [
        {"agentId": "PM2_5", "value": 47.2, "unit": "ug/m3"},
        {"agentId": "NO2",   "value": 18.3, "unit": "ppb"}
      ],
      "durationS": 3600,
      "indoorOutdoor": "outdoor"
    }]
  }'

# Register a device (returns a token for authenticated writes)
curl -X POST https://your-node.example.com/bxp/v2/devices/register \
  -H "Content-Type: application/json" \
  -d '{"label": "Rooftop Sensor - Building A"}'

# Query readings by geohash with pagination
curl "https://your-node.example.com/bxp/v2/readings?geohash=s1v0g&limit=50&offset=0"

# Verify a reading's integrity
curl https://your-node.example.com/bxp/v2/readings/{reading_id}/verify

# Aggregate (k≥5 anonymity enforced)
curl "https://your-node.example.com/bxp/v2/locations/s1v0g/aggregate"
shell
# Generate a .bxp file from sensor readings
python cli/bxp_cli.py generate \
  --pm25 47.2 --no2 18.3 --temp 29 \
  --lat 5.6037 --lon -0.1870 \
  --output accra.bxp.json

# Calculate HRI without writing a file
python cli/bxp_cli.py hri --pm25 67.0 --no2 31.0 --duration 24h --population sensitive

# Validate a .bxp file against the spec
python cli/bxp_cli.py validate accra.bxp.json

# Export to CSV or GeoJSON
python cli/bxp_cli.py export accra.bxp.json --format csv
python cli/bxp_cli.py export accra.bxp.json --format geojson

# Submit to a BXP node
python cli/bxp_cli.py submit --file accra.bxp.json \
  --server https://your-node.example.com

# Batch submit a directory of readings
python cli/bxp_cli.py batch-submit --dir ./sensor_data/

# Generate a self-contained HTML map
python cli/bxp_cli.py map ./sensor_data/ --output city_map.html

# Store server URL so you don't repeat it every command
python cli/bxp_cli.py config set server https://your-node.example.com
python cli/bxp_cli.py server-status
json — .bxp.json
{
  "bxpVersion":    "2.0",
  "deviceUuid":    "550e8400-e29b-41d4-a716-446655440000",
  "geohash":       "s1v0g7k",          // precision-7, ~153m resolution
  "latitude":      5.6037,
  "longitude":     -0.1870,
  "timestampUs":   1710000000000000,  // Unix epoch, microseconds
  "durationS":     3600,               // 1-hour averaging period
  "indoorOutdoor": "outdoor",
  "agents": [
    { "agentId": "PM2_5", "value": 47.2, "unit": "ug/m3" },
    { "agentId": "NO2",   "value": 18.3, "unit": "ppb"  },
    { "agentId": "O3",    "value": 24.1, "unit": "ppb"  },
    { "agentId": "TEMP",  "value": 29.0, "unit": "C"    }
  ],
  "quality": {
    "flag":       "UNVALIDATED",
    "confidence": 0.9,
    "qcMethod":   "bxp-sdk-auto"
  },
  "bxpHri":      61.2,
  "bxpHriLevel": "HIGH",
  "payloadHash": "sha256:a4c2e1f8..."   // tamper detection
}

Six pillars of the protocol

Every component is specified, documented, and implemented in the reference server.

📦
Universal File Format
JSON-based .bxp files carry readings, location, quality metadata, and an SHA-256 payload hash for tamper detection. Readable by any JSON parser.
§2 · File Specification
🌍
REST API Standard
Standard endpoints for submitting readings, querying by geohash or time window, device registration, community reports, and federated node discovery.
§4 · API Reference
📊
BXP_HRI Score
WHO-derived composite Health Risk Index. Weighted across 7 primary agents. Adjustable for exposure duration (1h/8h/24h) and population sensitivity.
§3 · HRI Specification
🔒
Privacy Framework
SHA-256 hashed person IDs. Geohash-5 spatial floor on personal records. k≥5 anonymity on aggregate endpoints. Cryptographic deletion proof.
§9 · Privacy
🕸
Federated Nodes
Any institution can run a node. Nodes self-announce and interoperate. No central authority, no single point of failure, full data sovereignty.
§6 · Federation
✅
Quality Control
Four-state quality flag (VALIDATED / UNVALIDATED / SUSPECT / INVALID) with confidence score and QC method provenance tracked per reading.
§7 · QC Framework

31 agents, one standard

From PM2.5 to benzene to mold spores — every atmospheric substance the BXP spec covers, with standardised IDs, units, and WHO thresholds.

One number that explains the air

BXP_HRI translates complex multi-pollutant data into a single 0–100 score that is comparable across locations, agents, and time.

0 CLEAN2040607590100 HAZARDOUS
RangeLevelWho is at risk
0–20CLEANNo restrictions
21–40MODERATESensitive groups: limit exertion
41–60ELEVATEDReduce outdoor exertion
61–75HIGHWear N95. Close windows.
76–90VERY HIGHAvoid all outdoor activity
91–100HAZARDOUSHealth emergency

HRI Formula (simplified)

HRI = min(100, Σ(val/WHO × weight) × 100
× d_factor × v_factor)
Duration factor: 1h → ×1.0 · 8h → ×1.2 · 24h → ×1.5
Population factor: general → ×1.0 · sensitive → ×1.3
PRIMARY AGENT WEIGHTS
PM2.5
35%
PM10
15%
NO₂
15%
O₃
12%
CO
10%
SO₂
5%

How BXP data flows

From sensor hardware through the network to researchers — every step is standardised.

IoT SensorMQTT / serial
──▶
BXP ClientSDK / CLI
──▶
.bxp FileJSON + hash
──▶
BXP NodeFastAPI + SQLite
──▶
FederatedNode network
──▶
Research / AppsREST API
BXP Node — Reference Implementation (FastAPI + SQLite)
Data Collection
POST /bxp/v2/readings
Device auth · Rate limiting
QC auto-assessment
Storage
SQLite persistence
SHA-256 payload hash
Geohash indexing
Query
By geohash / time window
Cursor pagination
k≥5 aggregate privacy
Live Data
AQICN integration
10-min ETag cache
10 global cities
Visualisation
Map view (Leaflet)
Time series (Chart.js)
City comparison
Integrity
GET /readings/{id}/verify
DELETE with crypto proof
Payload hash check
Community
POST /community/reports
Device registration
Anonymous + authenticated
Ops
GET /metrics (Prometheus)
Structured logging
Docker ready

Everything you need to build with BXP

Reference implementations, SDKs, integrations, and tools — all open source, all Apache 2.0.

Live public node — real-time global data

The reference node runs a public BXP API with live data for 10 global cities, a map view, dashboard, and embeddable widgets. No account required.

Open Dashboard → Global Map API Docs (Swagger) Health Check

Citable, archived, permanent

BXP is archived on Zenodo with permanent DOIs. Cite the protocol or the reference implementation independently.

Protocol Specification
doi:10.5281/zenodo.18906812
BXP Protocol v2.0 — Breathe Exposure Protocol specification. Zenodo.
🆔 ORCID: 0009-0001-4856-4986
Reference Implementation
doi:10.5281/zenodo.18907003
BXP Protocol Reference Node — FastAPI reference server implementation. Zenodo.
BibTeX
@software{bxp_protocol_2024,
  title = {BXP Protocol},
  doi = {10.5281/zenodo.18906812},
  license = {Apache-2.0}
}