Keep a local copy current
Store per-record SHA-256 values, fetch only changed or new records, and report removals.
Store per-record SHA-256 values, fetch only changed or new records, and report removals.
What you will produce: A deterministic local snapshot and checkpoint, without assuming a change feed or webhook exists.
1. Download the first snapshot and store every hash
On the first run, download and verify every directory record, then store a checkpoint map from district slug to SHA-256.
curl
mkdir -p de-records
base=https://www.districtfacts.com
curl -sS "$base/data/v1/de/districts.json" -o de-directory.json
jq -r '.[] | [.slug, .api_url, .sha256] | @tsv' de-directory.json | while IFS=