# WBGT Heat Stress API
> Wet Bulb Globe Temperature (WBGT) heat-stress index as an API, computed locally and deterministically. WBGT is the standard occupational and athletic heat-stress measure (ISO 7243). The wbgt endpoint computes the true index from measured thermometer readings: outdoors in the sun WBGT = 0.7·Tnwb + 0.2·Tg + 0.1·Tdb, and indoors or in the shade WBGT = 0.7·Tnwb + 0.3·Tg, from the natural wet-bulb, globe and dry-bulb temperatures, and returns the heat-stress flag and work-rest and hydration guidance. The estimate endpoint gives an approximate shade WBGT from just the air temperature and relative humidity using the Bureau of Meteorology approximation — e = (rh/100)·6.105·exp(17.27·T/(237.7+T)); WBGT ≈ 0.567·T + 0.393·e + 3.94 — for when you do not have a globe or wet-bulb thermometer. The flag endpoint classifies any WBGT value (°C or °F) into a heat-stress category — green, yellow, red or black — with the recommended work-rest cycle and water intake. Everything is computed locally and deterministically, so it is instant and private. Ideal for occupational-safety and industrial-hygiene tools, sports, military and outdoor-event planning, and environmental-monitoring apps. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is the WBGT heat-stress index; for the NWS heat index, wind chill and dew point use a weather-formulas API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/wbgt-api/..."
```

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 2 req/s
- **Starter** ($9/Mo) — 30,000 calls/Mo, 5 req/s
- **Pro** ($24/Mo) — 200,000 calls/Mo, 15 req/s
- **Mega** ($79/Mo) — 1,500,000 calls/Mo, 50 req/s

## Endpoints

### WBGT

#### `GET /v1/estimate` — Estimated WBGT from temp & humidity

**Parameters:**
- `temperature` (query, required, string) — Air temperature (°C) Example: `35`
- `humidity` (query, required, string) — Relative humidity (%) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wbgt-api/v1/estimate?temperature=35&humidity=50"
```

**Response:**
```json
{
    "data": {
        "flag": "black",
        "note": "Approximate shade WBGT from temperature and humidity only (no direct measurement of globe or wet-bulb). For full-sun conditions the true WBGT is higher.",
        "wbgt_c": 34.7922,
        "wbgt_f": 94.626,
        "formula": "e = (rh/100)·6.105·exp(17.27·T/(237.7+T)); WBGT ≈ 0.567·T + 0.393·e + 3.94 (BoM shade estimate).",
        "guidance": "Extreme risk. Suspend or cancel strenuous activity.",
        "risk_level": "extreme",
        "temperature_c": 35,
        "vapour_pressure_hpa": 28.0083,
        "recommended_work_rest": "20 min work / 40 min rest or stop",
        "recommended_water_l_per_h": 1,
        "relative_humidity_percent": 50
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:52.124Z",
        "request_id": "d3333fc5-f6d2-47a7-a327-8cedfd3a72cf"
    },
    "status": "ok",
    "message": "Estimated WBGT from temp & humidity",
    "success": true
}
```

#### `GET /v1/flag` — Classify a WBGT value

**Parameters:**
- `wbgt` (query, optional, string) — WBGT (°C) Example: `27.5`
- `wbgt_f` (query, optional, string) — Or WBGT (°F)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wbgt-api/v1/flag?wbgt=27.5"
```

**Response:**
```json
{
    "data": {
        "flag": "red",
        "note": "General athletic/occupational WBGT guidance; follow your local standard (e.g. ISO 7243, ACSM, TB MED 507) for binding limits.",
        "wbgt_c": 27.5,
        "wbgt_f": 81.5,
        "guidance": "High risk. Limit intense exertion; increase rest and hydration.",
        "risk_level": "high",
        "recommended_work_rest": "30 min work / 30 min rest",
        "recommended_water_l_per_h": 1
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:52.205Z",
        "request_id": "58b6285b-667e-4ad7-bf5a-83ada4baf4b2"
    },
    "status": "ok",
    "message": "Classify a WBGT value",
    "success": true
}
```

#### `GET /v1/wbgt` — WBGT from measured temperatures

**Parameters:**
- `natural_wet_bulb` (query, required, string) — Natural wet-bulb temperature (°C) Example: `25`
- `globe` (query, required, string) — Globe temperature (°C) Example: `35`
- `dry_bulb` (query, optional, string) — Dry-bulb / air temperature (°C, needed outdoors) Example: `30`
- `environment` (query, optional, string) — outdoor (in sun) or indoor (shade) Example: `outdoor`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wbgt-api/v1/wbgt?natural_wet_bulb=25&globe=35&dry_bulb=30&environment=outdoor"
```

**Response:**
```json
{
    "data": {
        "flag": "red",
        "mode": "outdoor",
        "note": "General athletic/occupational WBGT guidance; follow your local standard (e.g. ISO 7243, ACSM, TB MED 507) for binding limits.",
        "wbgt_c": 27.5,
        "wbgt_f": 81.5,
        "formula": "WBGT = 0.7·Tnwb + 0.2·Tg + 0.1·Tdb (outdoor, in sun).",
        "globe_c": 35,
        "guidance": "High risk. Limit intense exertion; increase rest and hydration.",
        "dry_bulb_c": 30,
        "risk_level": "high",
        "natural_wet_bulb_c": 25,
        "recommended_work_rest": "30 min work / 30 min rest",
        "recommended_water_l_per_h": 1
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:52.304Z",
        "request_id": "2c994a21-9f6d-42dc-aef4-b3d7955969f0"
    },
    "status": "ok",
    "message": "WBGT from measurements",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wbgt-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "api": "wbgt",
        "note": "WBGT heat-stress index — computed locally and deterministically, no key, no third-party service.",
        "flags": [
            {
                "flag": "green",
                "up_to_c": 18
            },
            {
                "flag": "yellow",
                "up_to_c": 23
            },
            {
                "flag": "red",
                "up_to_c": 28
            },
            {
                "flag": "black",
                "up_to_c": null
            }
        ],
        "endpoints": [
            "/v1/wbgt",
            "/v1/estimate",
            "/v1/flag",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-04T10:18:52.369Z",
        "request_id": "ed208adf-baf5-43d9-ac21-be7e051111a6"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/wbgt-api
OpenAPI spec: https://www.oanor.com/api/wbgt-api/openapi.json
