Why Every City Needs an API

City data is locked in PDFs, portals, and annual reports. What if every city had a REST API? Here is what that would look like.

I have been thinking about this since a trip to Bangalore last year. I wanted to check water supply timings for my parents' neighborhood. The data existed somewhere in BWSSB's system, but the only way to access it was a badly scanned PDF from 2019.

The problem is not missing data

Governments collect enormous amounts of data. Water, electricity, traffic, waste, pollution, land records. The problem is access. It is trapped in:

  • PDF reports nobody reads
  • Internal databases with no external interface
  • Physical records in offices that close at 4 PM
  • Dashboards that only show what the department decided to show

What if you could just do GET /api/bangalore/water/timings?area=jayanagar?

What a city API would look like

Think of it as a standard REST interface. Every city implements the same spec, like how every weather station reports in the same format.

GET /api/{city}/water/quality
GET /api/{city}/traffic/realtime
GET /api/{city}/air-quality?station=central
GET /api/{city}/property/tax?survey_number=123
GET /api/{city}/schools?type=public&radius=2km

The spec would be open. Any city can implement it. Developers can build tools on top of it.

Who benefits

Startups building civic tools. Journalists doing data stories. Researchers comparing cities. Citizens who just want to know why their water is brown today.

The closest thing we have is the US Census Bureau API and India's data.gov.in, but those are national datasets updated annually. Cities change daily.

Why this has not happened yet

Three reasons, in order of difficulty:

  1. Bureaucratic inertia. Nobody gets promoted for building APIs.
  2. Data cleaning. The underlying data is messy. Different departments use different systems, formats, and update cycles.
  3. Accountability. An API makes it easy to prove what the government said vs what actually happened. Not every department welcomes that kind of transparency.

Still, I think this is worth building. Start with one city. Make it so useful that others copy the format.

My ideas folder has three different versions of a spec for this. One day I will clean it up and publish it.

  • Mohan

- Mohan