API: Operational
xity-dev

$ xity init --city tokyo

{

"city": "tokyo",

"endpoints": [

"transit",

"weather",

"demographics",

"infrastructure"

],

"version": "3.2.0",

"latency": 18,

"status": "connected"

}

$ _

2.4M API calls / day
142 Supported cities
18ms Avg latency

API Reference

Transit

GET /v1/{city}/transit/routes

Response

{
  "routes": [
    {
      "id": "yamanote",
      "type": "rail",
      "stops": 30,
      "frequency_min": 3
    }
  ],
  "total": 847
}
GET /v1/{city}/transit/realtime

Response

{
  "vehicles": 1204,
  "delays": 12,
  "timestamp": "2026-04-04T09:14:00Z"
}
POST /v1/{city}/transit/alerts/subscribe

Request body

{
  "routes": ["yamanote", "chuo"],
  "webhook": "https://example.com/hook"
}

Demographics

GET /v1/{city}/demographics/population

Response

{
  "city": "tokyo",
  "population": 13960000,
  "year": 2026,
  "growth_rate": -0.02
}
GET /v1/{city}/demographics/density

Response

{
  "density_km2": 6363,
  "area_km2": 2194,
  "districts": 23
}

Infrastructure

GET /v1/{city}/infrastructure/status

Response

{
  "power_grid": "operational",
  "water": "operational",
  "telecom": "degraded",
  "incidents": 3
}
PUT /v1/{city}/infrastructure/reports

Request body

{
  "type": "pothole",
  "lat": 35.6762,
  "lng": 139.6503,
  "severity": 2
}
DELETE /v1/{city}/infrastructure/alerts/{id}

Response

{
  "deleted": "true",
  "alert_id": "inf-7291"
}

Events

GET /v1/{city}/events

Response

{
  "events": [
    {
      "name": "Cherry Blossom Festival",
      "date": "2026-04-10",
      "impact_radius_km": 2.5
    }
  ],
  "total": 34
}
POST /v1/{city}/events/subscribe

Request body

{
  "categories": ["festival", "construction"],
  "radius_km": 5
}

SDK Quickstart

node

# Install the SDK

$ npm install @xity/sdk

 

const xity = require('@xity/sdk');

const client = xity.init('tokyo');

 

const routes = await client.transit.routes();

const pop = await client.demographics.population();

API Playground

GET /v1/tokyo/transit/routes

$ Select a city and endpoint, then click Run query

Data layer overlay
tokyo

Supported Cities

Tokyo Seoul London New York Berlin Singapore Sydney Paris + 134 more

Webhooks & Events

Subscribe to real-time city event streams. Get notified of transit delays, infrastructure incidents, and community events as they happen.

webhook-config

$ xity webhook create --city tokyo

 

{

"webhook_id": "wh-8f2a",

"city": "tokyo",

"events": ["transit.delay", "infra.incident", "event.new"],

"url": "https://your-app.com/webhooks/xity",

"status": "active"

}

 

$ xity webhook test --id wh-8f2a

OK — 200 in 42ms