Overview
The Cough Radar REST API provides geospatial coughing analytics, enabling health monitoring applications to display coughing heatmaps and retrieve classification levels (normal, elevated, high) for specific geographic locations. A typical integration displays an interactive map with cough-intensity heatmap overlays, accompanied by a panel showing the current classification and historical trends for the selected region. To build this:-
Use
/v1/tilesto get tile URLs for rendering heatmap overlays on your map. The response is compatible with standard map libraries like Google Maps, Apple Maps, and Mapbox. -
Use
/v1/classificationsto fetch the cough activity level (normal, elevated, high) and trend data for the user’s current view or location. Display the classification status and render the time series data in a graph.
Authentication
All API requests require authentication via theAPI-Key header. Your API key must have the coughRadar capability enabled.
Base URL
Endpoints
POST /v1/tiles
Fetch available heatmap tile data for a date range. Returns tile metadata including URLs for rendering map overlays. Request| Field | Type | Required | Description |
|---|---|---|---|
date_interval_start | datetime | Yes | Start date (ISO 8601 with timezone) |
date_interval_end | datetime | Yes | End date (ISO 8601 with timezone) |
| Field | Type | Description |
|---|---|---|
name | string | Tile set identifier |
tile_data | array | Available dates with tile data |
base_template_url | string | Base URL for tile images |
relative_tile_template_path | string | URL template for individual tiles |
max_zoom | integer | Maximum zoom level available |
POST /v1/classifications
Get coughing classification (normal, elevated, high) for a geographic location or bounding box on a specific date. You can specify the location using either:- coordinate - A single point. The API returns aggregated data for the surrounding area (approximately 200 km radius).
- bounding_box - A geographic rectangle. The API returns aggregated data for the specified region.
| Field | Type | Required | Description |
|---|---|---|---|
date | datetime | Yes | Date for classification (ISO 8601 with timezone) |
trend_number_of_days | integer | No | Days for trend calculation (default: 30) |
coordinate | object | No* | Single point location |
bounding_box | object | No* | Geographic bounding box |
coordinate or bounding_box must be provided.
Response (200 OK)
| Field | Type | Description |
|---|---|---|
classification | string | Classification level (see Data Types) |
coughing_per_hour_average | float | Average coughs per hour |
coughing_data_time_series | object | Historical trend data |
elevated_threshold | float | Threshold for elevated classification |
high_threshold | float | Threshold for high classification |
Data Types
Classification Values
Classifications compare current cough levels against historical data from the same location over the past year:| Value | Description |
|---|---|
normal | Cough levels are within the typical range for this location |
elevated | Cough levels are higher than usual, ranking in the top 25% of recorded levels over the past year |
high | Cough levels are very high, ranking in the top 10% of recorded levels over the past year |
not_enough_data | Insufficient data to accurately classify cough levels |
Coughing Data Time Series Object
Historical trend data for the requested location.| Field | Type | Description |
|---|---|---|
date | array | List of dates (ISO 8601 with timezone) |
cough_per_hour_average | array | Average coughs per hour for each corresponding date |
Coordinate Object
| Field | Type | Range | Description |
|---|---|---|---|
latitude | float | -90 to 90 | Latitude in decimal degrees |
longitude | float | -180 to 180 | Longitude in decimal degrees |
Bounding Box Object
| Field | Type | Range | Description |
|---|---|---|---|
latitude_min | float | -90 to 90 | Southern boundary |
latitude_max | float | -90 to 90 | Northern boundary |
longitude_min | float | -180 to 180 | Western boundary |
longitude_max | float | -180 to 180 | Eastern boundary |
Error Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 401 | Missing or invalid API key |
| 403 | API key lacks coughRadar capability |
| 422 | Invalid request body (validation error) |
| 500 | Internal server error |