Code-speaking Manifesto: Auditing Japan's Public CSVs and APIs

どうも〜おかむーです!今日はちょっとエンジニアっぽい話をしますよ〜
- Three-line summary
- Machine-readability issues: encoding, missing schema, no stable APIs, and scattered hosting hurt reproducibility and policy evaluation.
- Technical fixes: standardize schema (CSVW/JSON Table Schema), add OpenAPI-backed endpoints, publish data packages and time-series APIs for transparency.
結論
Public data in CSV form is a huge win compared to PDFs — but CSV alone isn't enough. 要するに、データを機械で「使える」形にするにはスキーマ、API、メタデータ、そして安定的なエンドポイントが必要です。エンジニア的に言うと、API一本とスキーマ一枚で行政の再現性と説明責任が劇的に上がるんですよね。
Report: what I looked at and why it matters
This quick audit used several concrete datasets surfaced in search results: NOTICE (https://notice.go.jp/docs/status_notice.csv), MHLW rescue facilities CSV (https://www.mhlw.go.jp/content/001682075.csv), a national dataset from MIC (https://www.soumu.go.jp/main_content/000323625.csv), and a Ministry of Environment file (https://www.env.go.jp/content/900398071.csv). These are real CSV files — hooray — but several patterns repeat:
- Encoding and headers: Many gov CSVs in Japan use Shift_JIS or unspecified encodings. That trips up pandas/read_csv unless you guess encoding or convert first. 要するに、一貫した UTF-8 出力がほしい。
- Missing machine schema: No JSON Table Schema / CSVW annotations. Consumers must infer column types, date formats, and units — error-prone.
- No unified API: Files are individually downloadable, but there's no REST API to filter, paginate, or query time ranges. エンジニア的に言うと、bulk CSV is fine for dump, but you also need query endpoints for apps.
- Metadata & provenance: License, last-updated timestamps, and stable IDs often absent. That makes auditing policy targets vs results painful.
Quick technical checks you can run
This is practical — code you can run to validate a public CSV.
import requests
import pandas as pd
r = requests.head('https://notice.go.jp/docs/status_notice.csv')
print(r.headers.get('content-type'))
then load safely
df = pd.read_csv('https://notice.go.jp/docs/status_notice.csv', encoding='utf-8', low_memory=False)
print(df.head())
If encoding fails, try chardet to detect or pass encoding='shift_jis'. Also validate schema:
# quick column type coercion check
for col in df.columns:
try:
pd.to_datetime(df[col])
print(col, 'looks datetime')
except: pass
Policy measurement gap example
Many policy documents promise numerical targets (e.g., disaster shelter readiness, migration targets). The datasets above provide raw inventories (shelter lists, migration records), but since they lack consistent time-series endpoints and unique IDs, it's hard to compute target vs actual over time reliably. 要するに、数値目標の検証が手作業になってしまう。
Technical recommendations (concrete)
- Publish a Data Package (frictionlessdata.io) per resource: CSV + datapackage.json with schema, encoding UTF-8, license.
- Add CSVW/JSON Table Schema alongside each CSV to declare types, units, and primary keys.
- Provide a simple REST API with OpenAPI spec: GET /resources/{id}/rows?from=2023-01-01&to=2024-01-01&limit=1000. This enables reproducible queries and dashboards.
- CI for data hygiene: automated checks that validate schema, detect null spikes, and emit alerts on anomalies.
- Offer Parquet and JSONL derivatives for large datasets to speed analytics and lower bandwidth.
Implementation sketch: OpenAPI fragment
paths:
/datasets/{id}/rows:
get:
parameters:
- name: from
in: query
schema:
type: string
format: date
- name: to
in: query
schema:
type: string
format: date
responses:
'200':
content:
application/json: {}
まとめ
CSV publication is an excellent start — much better than locked PDFs — but to turn data into accountability you need schema, APIs, and provenance. エンジニア的に言うと、データフォーマットと契約(schema+API)が揃えば、政策検証は自動化できる。現状は良い基盤だけど、あと一歩を踏み出すべき段階です。
おかむーから一言
I started companies to build this exact infrastructure — tech can make government measurable and improvable. Let's push for data contracts, not just data dumps。興奮してきた!
Sources
- https://notice.go.jp/docs/status_notice.csv
- https://www.env.go.jp/content/900398071.csv
- https://www.inpit.go.jp/content/100869372.csv
- https://www.mhlw.go.jp/content/001682075.csv
- https://www.soumu.go.jp/main_content/000323625.csv
- https://www.intec.co.jp/column/smartcity-08.html
- https://www.digital.go.jp/resources/data_case_study_local
- https://ja.wikipedia.org/wiki/%E5%85%AC%E5%85%B1
- https://www.manawin.jp/languagegap/general/koukyou-kouteki/
- https://datafor.jp/opendata2025/
- https://www.zhihu.com/question/290714454
- https://metidx-gov.note.jp/n/n9468573c213b
- https://www.zhihu.com/question/6430289390
- https://ai-government-portal.com/%E5%85%AC%E5%8B%99%E5%93%A1%E3%81%AE%E6%96%B0%E3%81%97%E3%81%84%E6%8C%91%E6%88%A6%E3%80%8C%E8%A1%8C%E6%94%BFux%E6%94%B9%E5%96%84%E6%A5%AD%E5%8B%99%E5%A7%94%E8%A8%97%E3%80%8D%E5%AE%8C%E5%85%A8%E3%82%AC/
- https://www.zhihu.com/question/38923279
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.