API - City Packs
Espil.Online is a digital replica of this world, and a replica has to be fed by the world it copies. This API is that feed, published: one call returns the live state of a real place - its weather, its sky, its traffic, its transit - so any world, game, or app can keep step with reality. It ships in city packs. Vancouver is the first.
A city pack is a bundle: the feeds that cover one city, normalized into one state. The Vancouver pack draws on the same sources Espil.Online itself runs on.
New cities open as packs: a configuration of sources, bounds, and the local transit agency. Nothing about the API changes when a city is added - only the map of what is covered grows, the same way the world itself grows city by city.
GET /v1/state?lat=&lng= - the composite call: the live state of a place in one response. Each section carries its own freshness, because weather, traffic, and transit age at different rates.
GET /v1/weather?lat=&lng= - current conditions and the hours ahead.
GET /v1/sky?lat=&lng=&at= - sun position, sunrise and sunset, moon phase, and the orientation of the bright-star field. Computed, not fetched: no upstream limits.
GET /v1/traffic?city= - a derived congestion level (low, moderate, heavy, severe) and a 0-100 index per zone. Never raw provider data.
GET /v1/transit?city=&stop= - service alerts and next departures for the pack's agency.
GET /v1/city/{slug}/state - a whole city pack's summary state at its reference point. First slug: vancouver.
A section is omitted, never faked, when a point sits outside coverage.
{
"place": { "city": "vancouver", "lat": 49.2827, "lng": -123.1207,
"timezone": "America/Vancouver" },
"at": "2026-11-03T20:55:00Z",
"weather": { "condition": "rain", "tempC": 8.2, "precipMm": 0.6,
"windKph": 21, "source": "open-meteo", "ttlSeconds": 600 },
"sky": { "sun": { "altitudeDeg": -12.4, "sunset": "2026-11-04T00:52:00Z" },
"moon": { "phase": "waxing gibbous", "illumination": 0.78 },
"computed": true, "ttlSeconds": 60 },
"traffic": { "level": "moderate", "index": 46, "derived": true,
"ttlSeconds": 300 },
"transit": { "agency": "TransLink", "alerts": 1, "ttlSeconds": 60 },
"attribution": ["Weather: Open-Meteo (CC BY 4.0)",
"Transit: TransLink open data",
"Sky: computed by Espil"]
}
Every call carries a token: Authorization: Bearer esp_live_... Tokens are per project, counted per key, and revocable. Three tiers are planned - Free, generous for indie and hobby worlds with attribution; Pro, with the traffic and transit sections and higher quotas; Scale, with custom quotas and city-pack requests. Prices are being set now and will be published on this page.
Beta tokens are being prepared and issued first, ahead of the endpoints opening, in request order. To ask for one, email han@espil.online with your project, the city packs you need, and your expected call volume. Espil.Online itself is the API's first consumer, so the Vancouver pack is proven in production before it is sold to anyone.
The API is license-safe by construction. It ships only openly licensed data (Open-Meteo under CC BY 4.0, TransLink open data, each with attribution carried in every response), values computed by Espil itself (the sky), and derived indicators where a provider's terms allow them. Raw data from providers whose terms forbid redistribution - Google Places above all - never passes through this API, and Mapbox is a rendering layer inside Espil.Online, not a data source here.