Developer API
The nstate API is public and requires no key. Base URL: https://api.nstate.org
Data: CC BY 4.0 — free to use, attribute nstate.org. Code: MIT. Rate limit: 30 requests/hour per IP for /query. All other endpoints are unlimited.
/queryAsk a plain-English question. Returns a cited, data-backed answer or a gap notice.
⚠ Rate limited: 30 requests/hour per IP.
curl -X POST https://api.nstate.org/query \
-H 'Content-Type: application/json' \
-d '{"question":"How many civil servants work for the UK?","country":"uk"}'/findingsList published findings. Add ?status=reviewed_finding for curated ones.
curl "https://api.nstate.org/findings?country=uk&limit=10"
/findings/{id}Single finding by ID — includes question, narrative, key stat, SQL.
curl "https://api.nstate.org/findings/uk-2026-0001"
/findings/{id}/export.csvDownload finding data as a CSV file. Re-runs stored SQL for fresh rows.
curl -O "https://api.nstate.org/findings/uk-2026-0001/export.csv"
/findings/{id}/flagFlag a finding as incorrect, outdated, misleading, or other.
curl -X POST https://api.nstate.org/findings/uk-2026-0001/flag \
-H 'Content-Type: application/json' \
-d '{"flag_type":"outdated","note":"ONS updated this in June 2026"}'/gapsTop data gaps sorted by vote count — the public roadmap.
curl "https://api.nstate.org/gaps?country=uk&limit=20"
/gaps/voteVote to prioritise a gap topic.
curl -X POST "https://api.nstate.org/gaps/vote?topic=NHS+waiting+times+by+trust&country=uk"
/datasetsList loaded datasets for a country with source URLs and priority.
curl "https://api.nstate.org/datasets?country=uk"
/healthHealth check — returns current UTC time.
curl "https://api.nstate.org/health"