Building Urbanita

Urbanita started from a simple itch: type a city name, get the essentials, without wading through a full Wikipedia article. The first version was exactly that — a search box and a summary card pulled straight from Wikipedia’s REST API. It worked, and it was immediately wrong half the time.

The problem with just searching Wikipedia

Wikipedia’s summary endpoint will happily hand back an article for anything with that name — a mountain, a programming language, an island. Search for “Java” and you get the programming language, not the city of Jakarta you probably meant, or you get an island that happens to share a name with a city on it. Coordinates don’t save you either: Mount Fuji has coordinates too.

The fix was to stop trusting the article and start asking Wikidata what kind of thing it’s actually describing. Every Wikipedia article maps to a Wikidata entity with an instance of claim, and settlements — cities, towns, villages, municipalities — all sit under a recognizable set of types. When an article’s direct type doesn’t match, Urbanita walks subclass of upward a few hops, so a “commune of France” or a “city-state” resolves correctly without ever being hardcoded by name. Requests are batched and cached, so in practice a lookup costs one extra request, often zero once the taxonomy is warm.

A rejection was never meant to be a dead end, either: search for something that isn’t a city and Urbanita offers the real alternatives it filtered for instead — search “Java” and it points you at Jakarta.

From a card to a page

Disambiguation ("Did you mean…?"), shareable ?city= URLs with proper back-button support, and the city filter came next, rounding out the core lookup experience. But a one-paragraph extract only tells you so much about a place. The next stretch of work was about depth: a key-facts box pulling population, country, area, elevation, and timezone straight off the same Wikidata entity already fetched for classification — reusing that lookup instead of paying for it twice — and a Leaflet map centred on the city, with tiles that follow whichever theme the page is in.

Still no backend

Every one of those features is still just static files talking directly to Wikipedia and Wikidata from the browser. No server, no database, no build step — which is exactly what makes it free to host and easy to keep tinkering with.