Code-driven Manifesto: Evaluating Government Data & Systems with an Engineer's Lens

どうも〜おかむーです! Today let's look at government and municipal data from a coder's point of view — brisk, technical, but friendly. エンジニア的に言うと、政策の実効性はデータの設計でかなり決まるんですよ〜
- Government publishes APIs (e-Gov) and open-data portals (Tokyo), but many critical stats remain trapped in PDFs.
- Machine-readability, versioning, and schema discipline are the most common technical gaps.
- With a few engineering practices (OpenAPI, DCAT, CI for data), municipalities can turn policy targets into verifiable code.
結論
Open data is getting better — see e-Gov API catalog (https://www.e-gov.go.jp/digital-government/api) and Tokyo's Open Data API (https://portal.data.metro.tokyo.lg.jp/opendata-api/) — but practical obstacles remain: PDFs, missing schemas, inconsistent update cadences, and unclear licensing. 要するに、政策をコードで検証するためには「API-first」「schema-first」「CI-for-data」が必要です。
Report
1) What exists today (quick inventory)
- e-Gov provides an API catalog and some machine endpoints (see https://www.e-gov.go.jp/digital-government/api).
- Tokyo publishes an Open Data API with endpoints like GET /PublicFacility (https://portal.data.metro.tokyo.lg.jp/opendata-api/).
- GovTech Tokyo documents data-utilization support and dashboards (https://www.govtechtokyo.or.jp/services/data-utilization/).
これ見てくださいよ: having an API catalog is huge, but that doesn't guarantee each dataset is easy to use. Many policy reports are still PDFs or HTML tables.
2) Technical pain points
- PDF vs CSV/JSON: PDFs are not machine-readable. OCR/heuristics are brittle. 要するに人手が増えるだけ。
- Missing schema: no JSON Schema / OpenAPI means every consumer re-discovers fields.
- No versioning: when numbers change, consumers can't rely on reproducible queries.
- Irregular update cadence and lacking metadata (last_updated, frequency, license).
3) API & format quality assessment
- Presence: Catalogs exist, but coverage varies by ministry and municipality.
- Format: Where APIs exist, JSON is common, but CSV endpoints are still needed for bulk analytics.
- Documentation: Japanese-first docs are fine, but machine-readable OpenAPI / examples for SDKs speed adoption.
4) Policy targets vs measurable reality
Many policies set numeric goals (e.g., digitalization targets, service KPIs). But without: (a) canonical metrics exposed via API, (b) historical series, and (c) clear definitions, you can't programmatically assert achievement. Example checklist:
- Is the KPI exposed as an API field? If no → not verifiable by code.
- Is the collection method documented? If no → data comparability is weak.
- Are there baseline and target fields? If no → you must reconstruct from PDFs.
5) Concrete technical improvements (actionable)
- API-first: publish OpenAPI specs and machine-readable examples for each dataset.
- Schema and DCAT: provide JSON Schema + DCAT catalog for discoverability.
- CI for data: put datasets through automated validation (jsonschema/pydantic checks), checksum/version on release.
- Bulk exports: provide compressed CSV/NDJSON downloads alongside paged APIs for analytics.
- Licensing & metadata: attach machine-readable license and last_updated timestamps.
- Monitoring: endpoint SLA and usage telemetry so teams know consumer needs.
6) Code example: fetching Tokyo PublicFacility and saving CSV
# curl to fetch JSON (pseudo-URL from portal)
curl -s "https://portal.data.metro.tokyo.lg.jp/opendata-api/PublicFacility" -o facilities.json
# Python: load, validate, save
import json
import pandas as pd
from jsonschema import validate
with open('facilities.json') as f:
data = json.load(f)
minimal normalization
rows = []
for item in data.get('results', []):
rows.append({
'id': item.get('id'),
'name': item.get('name'),
'lat': item.get('location', {}).get('lat'),
'lon': item.get('location', {}).get('lon'),
})
df = pd.DataFrame(rows)
validate a column exists
assert 'name' in df.columns
df.to_csv('facilities.csv', index=False)
要するに、APIがあるだけでなく“使える形”に整える工程が必要なんです。
7) Governance: bridge between policy and engineers
- Ship a policy data contract: a small machine-readable file per KPI that states source, calculation, refresh cadence, and owner.
- Cross-functional teams: policymakers + data engineers + UX to prioritize machine-readability.
まとめ
政府・自治体はAPIやオープンデータの基盤を整えてきているけど、実用レベルで“コードで語る”にはまだ足りない。PDFの排除、OpenAPI/JSON Schemaの整備、CIでのデータ検証、そして明確なデータ契約があれば、政策評価は数値で・自動で・再現可能になる!
おかむーから一言
I've built products that die by bad specs — so trust me, clean data contracts save lives (and budgets). Let's make policy verifiable with code, one API at a time!
Sources
- https://www.zhihu.com/question/290714454
- https://metidx-gov.note.jp/n/n9468573c213b
- https://www.zhihu.com/question/6430289390
- https://www.trans-plus.jp/blog/column/202210_municipality-dx
- https://www.zhihu.com/question/38923279
- https://www.zhihu.com/question/40553450
- https://www.govtechtokyo.or.jp/services/data-utilization/
- https://www.zhihu.com/tardis/zm/art/1924492115896960699
- https://note.govtechtokyo.jp/n/n77785a8254d6
- https://www.zhihu.com/question/372341437
- https://www.jichi.ac.jp/
- https://www.e-gov.go.jp/digital-government/api
- https://www.jichi.ac.jp/web_text/
- https://portal.data.metro.tokyo.lg.jp/opendata-api/
- https://www.jichi.ac.jp/library/
Share
Related Reports

Code-driven Manifesto: Auditing Local Gov Data and Systems (Kagawa case study)
Local gov systems run but hide data behind UIs; expose CSV/JSON, APIs, and common schemas to unlock value.

Code-driven Check: Japan’s Open Data and the Machine-Readable Gap
Digital Japan has dashboards and rules, but PDFs and messy formats still block automated policy verification; mandate CSV/JSON, APIs, and dataset linting.

Code Speaks: Testing Japan's Gov Data and Dashboards
Japan has great dashboards but inconsistent machine-readability. This report inspects e-Stat, Japan Dashboard, Kantei PDFs, and proposes API-first fixes and practical code examples.