canonical: https://jentic.com/apis/api.opensensemap.org/opensensemap

# openSenseMap

Jentic publishes the only available OpenAPI specification for openSenseMap, keeping it validated and agent-ready. openSenseMap is a citizen science platform for environmental sensor data - boxes (sensor stations) report measurements such as air quality, temperature, and humidity, and the API exposes them for both ingestion and analysis. Consumers can list and filter sensor boxes, query historical and recent measurements, retrieve descriptive statistics or interpolated values, and download data as JSON, CSV, or GeoJSON. Sensor owners can authenticate with a bearer token to register boxes, push measurements, and manage sensors.

## For AI agents

Query and ingest environmental sensor readings from the citizen-science openSenseMap platform - list boxes, fetch measurements, run statistics, and post new data with a bearer token.

## Scope

Does not provide weather forecasts, satellite imagery, or commercial-grade calibrated readings - use for citizen-science environmental sensor data only.

## Capabilities

- List sensor boxes with location and tag filters via /boxes and inspect a single box with `/boxes/{boxId}`
- Retrieve recent and historical measurements per sensor through `/boxes/{boxId}/sensors/{sensorId}/measurements`
- Compute descriptive statistics or inverse-distance-weighted interpolation across boxes with `/statistics/descriptive` and `/statistics/idw`
- Download datasets as JSON, CSV, or GeoJSON for offline analysis
- Register and manage sensor boxes and individual sensors when authenticated
- Post new measurements from a sensor box to contribute to the open dataset

## Use cases

### Air Quality Map and Alerts

Build a live air quality map by listing boxes within a bounding region via /boxes and pulling the latest measurements per sensor. Alerts can fire when a station reports PM2.5 above a threshold, drawing on `/statistics/descriptive` to contextualise the reading against recent baselines. The data is community-contributed, so coverage is densest in urban areas where citizen scientists have deployed boxes.

Example prompt: Fetch /boxes filtered by bounding box and tag 'particulate matter', read each box's latest sensor measurement, and flag boxes reporting PM2.5 above 35 µg/m³.

### Historical Environmental Analysis

Pull long-running historical series for individual sensors via `/boxes/{boxId}/sensors/{sensorId}/measurements` with date filters, then export to CSV for analysis or modelling. Researchers can compare urban heat islands, study seasonal patterns, or build training datasets for environmental ML models. Inverse-distance-weighted interpolation through `/statistics/idw` is available where measurements need to be estimated between station locations.

Example prompt: Query `/boxes/{boxId}/sensors/{sensorId}/measurements` for the past 90 days with format=csv and save the result for analysis.

### Citizen Science Data Contribution

Register a sensor box, configure its sensors, and post measurements from a Raspberry Pi, microcontroller, or other field hardware. Authenticated owners can manage their fleet of boxes, mark sensors active or inactive, and contribute to the open dataset. The platform handles ingestion, persistence, and exposure of the data back to the community.

Example prompt: Authenticate with a bearer token, POST a new measurement payload to the box's measurements endpoint, and verify it appears in the latest reading.

### AI Agent Environmental Insights via Jentic

Power an agent that answers questions like 'how is air quality near me right now' or 'show humidity trends for sensor X over June'. Jentic returns the right openSenseMap operation per intent so the agent does not need to memorise the 38 endpoints, and the bearer token (when needed for ingestion) stays in your Jentic One instance rather than the agent's prompt.

Example prompt: Search Jentic for 'find nearby sensor boxes', load the GET /boxes schema, execute with a bounding box derived from the user location, and summarise current readings for the closest box.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/boxes` | List sensor boxes with filters |
| GET | `/boxes/{boxId}` | Retrieve a sensor box |
| GET | `/boxes/{boxId}/sensors` | List sensors on a box |
| GET | `/boxes/{boxId}/sensors/{sensorId}` | Retrieve a single sensor |
| GET | `/boxes/data` | Download box data in bulk |
| GET | `/statistics/descriptive` | Descriptive statistics across boxes |
| GET | `/statistics/idw` | Inverse-distance-weighted interpolation |
| GET | `/stats` | Platform-level statistics |

## Key resources

- **Boxes** — Sensor stations with metadata, sensors, and measurements
- **Sensors** — Individual sensors attached to a box
- **Measurements** — Historical and live readings per sensor
- **Statistics** — Descriptive and IDW-interpolated summaries across boxes
- **Tags** — Tag-based discovery of boxes by topic

## Why Jentic

- **Setup:** Wiring openSenseMap by hand means setting up its bearer auth for managed boxes, learning the box and sensor resource shapes, and assembling measurement queries yourself. Through Jentic you install once, import openSenseMap from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** openSenseMap puts the box id in the URL path (`/boxes/{boxId}/...`), so a rule can pin your agent to one box: it can read that box and its sensors and nothing else. You choose the operations it may call, so write or delete actions are not included unless you add them.
- **Credential handling:** Your openSenseMap token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'read sensor data from a station' or 'get environmental statistics for an area', and Jentic returns the matching openSenseMap operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **IQAir AirVisual API** — Commercial air quality data with global coverage
- **Ambee API** — Environmental intelligence data including air, weather, and pollen
- **OpenWeatherMap API** — General-purpose weather data and forecasts

## FAQ

### Why is there no official OpenAPI spec for openSenseMap?

openSenseMap does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call openSenseMap via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the openSenseMap API use?

Read endpoints such as /boxes and /statistics/* are public. Mutating operations - registering boxes, posting measurements, managing sensors - require an HTTP bearer token. Through Jentic, the bearer token is stored encrypted in your Jentic One instance and injected at execution time, so it never appears in agent prompts.

### Can I download historical sensor measurements with the openSenseMap API?

Yes. Use `/boxes/data` for bulk per-box exports, or query individual sensors via the box and sensor endpoints with date filters. Multiple output formats (JSON, CSV, GeoJSON) are supported, which is useful for feeding analysis pipelines or geospatial tools.

### What are the rate limits for the openSenseMap API?

The spec does not declare hard numeric limits. As the platform is community-funded, callers should batch requests, paginate /boxes results, and avoid scraping the same data repeatedly. Cache descriptive statistics and bulk exports rather than recomputing them on every call.

### How do I find sensor boxes near a location through Jentic?

Search Jentic for 'find nearby sensor boxes', load the GET /boxes schema, and execute it with a bounding box derived from your coordinates. With `pip install jentic` the call returns the matching boxes; you can chain a follow-up call to fetch their latest measurements.

### Is the openSenseMap API free?

Yes. openSenseMap is an open citizen-science platform and the API is free to use. There are no paid tiers in the spec; please respect the platform's terms of use and consider contributing your own sensor data if you build something on top of it.

### Can I limit what my agent is allowed to do with the openSenseMap API?

Yes. Jentic One is self-hosted, so your own rules decide which openSenseMap operations and credentials your agent may use. Because openSenseMap carries the box id in the URL path (`/boxes/{boxId}/...`), a rule can pin the agent to a single box so it only reads that box and its sensors and measurements and nothing else. You pick the exact operations it may call, so write actions like registering boxes or posting measurements stay out of reach unless you explicitly add them.
