Build on the clean hour

The engine behind this site is public: a JSON API, an MCP server for agents and tools, and a card any school or housing society can embed. No key, no sign-up. Open source under MIT.

HTTP API

Base URL https://khidki-engine-ptslyhnp7q-el.a.run.app. Times are IST. Concentrations are PM2.5 in µg/m³; doses are µg inhaled, from US EPA inhalation rates by activity and age.

Interactive OpenAPI docs

Cleanest 45 minutes for a run tomorrow, Lodhi Road

curl "https://khidki-engine-ptslyhnp7q-el.a.run.app/v1/window?lat=28.5931&lon=77.2197&activity=run&minutes=45&habitual=06:00&day=tomorrow"

When to air the house

curl "https://khidki-engine-ptslyhnp7q-el.a.run.app/v1/airing?lat=19.0760&lon=72.8777&open_minutes=30&day=tomorrow"

Check a published day yourself

curl -so 2026-11-11.json https://khidki-engine-ptslyhnp7q-el.a.run.app/v1/ledger/2026-11-11.json
sha256sum 2026-11-11.json        # compare with the hash in /v1/ledger
curl -so 2026-11-11.json.ots https://khidki-engine-ptslyhnp7q-el.a.run.app/v1/ledger/2026-11-11.ots
ots verify 2026-11-11.json.ots   # OpenTimestamps client
MethodPathWhat it returns
GET/v1/windowCleanest start time for an activity: lat, lon, activity, minutes, earliest, latest_end, habitual, age, day.
GET/v1/airingWhen to open the windows at home: lat, lon, open_minutes, habitual, day.
GET/v1/air-nowLatest measured PM2.5 at the monitors within 15 km of a point.
GET/v1/stationsEvery monitor Khidki reads, with its latest reading.
GET/v1/stations/{id}One monitor: forecast, measured hours, published recommendations, audit flags.
GET/v1/ledgerEvery published day with its SHA-256, counts and timestamp status.
GET/v1/ledger/{day}.jsonThe exact bytes that were hashed for that day.
GET/v1/ledger/{day}.otsThe OpenTimestamps proof for that day's hash.
GET/v1/scoreboardPublished hours scored against measured air, per scenario and policy.
GET/v1/auditMonitor data-quality flags for a day (?day=YYYY-MM-DD).
GET/v1/impactLive counters from the production database.
GET/v1/geocodePlace search inside India (?q=…), rate-limited.
POST/v1/chatAsk the planner in English or Hindi: {text, session (UUIDv4), lat, lon, lang}.

Activities: walk, run, cycle, yoga, play, commute_walk, commute_two_wheeler, errand, outdoor_work. Ages: child, adult, older. Window statuses: ok, no_data, stale, window_closed. A source of cams_only means no nearby monitor had a forecast and the answer comes from the CAMS model alone.

MCP endpoint

Streamable HTTP, stateless, no auth. Point any MCP client at it and the clean hour becomes a tool an agent can call.

  • find_window the cleanest start time for an activity
  • find_airing_time when to open the windows at home
  • air_now latest measured PM2.5 near a place
  • ledger_day a published day and its hash
  • monitor_health the day's data-quality flags

Endpoint

https://khidki-engine-ptslyhnp7q-el.a.run.app/mcp/

Client config

{
  "mcpServers": {
    "khidki": { "type": "http", "url": "https://khidki-engine-ptslyhnp7q-el.a.run.app/mcp/" }
  }
}

Embed card

A small card with the day's cleanest window for one place, for a school website, a housing-society notice screen or a clinic. It updates itself from the monitors nearest that point.

lat, lon
The place, in India. Required.
activity
walk, run, play, cycle, yoga or commute_walk. Default walk; play uses school hours (08:00–14:00).
label
The name shown on the card, for example your school's name.
minutes, habitual, day
Optional: duration, the usual start time to compare with, and today or tomorrow.

HTML

<iframe
  src="https://khidki-air.vercel.app/embed?lat=28.5931&lon=77.2197&activity=play&label=Our%20school"
  width="360" height="240" style="border:0" loading="lazy"
  title="Today's cleanest playtime, by Khidki"></iframe>

Source and data

Engine, site and replay results are in one public repository under the MIT licence. PM2.5 comes from CPCB and state pollution-control boards via OpenAQ; the weather-driven forecast from CAMS (ECMWF/Copernicus) via Open-Meteo.

github.com/RaYYeR220/khidki