# PlanWire UK planning API evaluation examples Source repository: https://github.com/beshogun/planwire-api-examples Version: 5 November 2026. Node.js 20+ and Python 3.10+. No third-party packages. Download this directory's files from https://planwire.io/examples/planning-api-evaluation/README.md and keep them together. Source is MIT licensed; the synthetic fixtures are fictional. The licence does not grant rights to third-party council records. ## Offline first ```sh node --test examples.test.mjs node search.mjs --fixture python3 search.py --fixture ``` Both search programs print the fictional reference, application date and source URL. The Node tests mock fetch and make no network calls. Set PLANWIRE_KEY privately in your shell or secret manager to run a read-only GET against your own entitlement: ```sh node search.mjs N16 python3 search.py 'N16 0AA' ``` Free keys return historical application identity samples and omit current status, decisions, documents and freshness. response.json is a complete synthetic paid-access list response for limit=1, evaluated as of 5 November 2026 at 12:00 UTC. It is not a promise of current local results. The code requests limit=5. Never put an API key in browser JavaScript, URLs or source control. ## Safe webhook integration signature.mjs verifies X-PlanWire-Signature with the sha256= prefix and HMAC-SHA256 over raw bytes. Call it BEFORE parsing JSON. webhook.json illustrates a durable application.new event; legacy events may lack id/cursor. Reject invalid signatures. Persist a durable event id and payload transactionally before replying 2xx; duplicate ids should return 2xx without repeating work. These files do not start a public receiver or register a subscription. Recovery: GET /v1/webhooks/{id}/events?after=0&limit=100 returns data[].payload and data[].cursor plus meta.nextCursor/meta.hasMore. Persist each complete page and its nextCursor in one transaction. Never use a pushed cursor as a recovery checkpoint: receipt order can differ. A 503 means recovery is unavailable, not an empty stream. /missed is attempt history. Events cover changes captured after durable capture began, not an all-history export. See https://planwire.io/blog/building-planning-alerts and https://planwire.io/planning-webhooks. ## Dates, pagination and errors Read records from data. meta.total and meta.pages can be null; iterate bounded pages until data is empty or shorter than the applied limit, respecting your plan and daily quota. This is not a transactionally stable export; concurrent writes can move rows. Stop on 401/402/403 and review access; back off on 429; treat 5xx/timeouts as failed requests, not empty searches. Do not retry blindly. Date filters apply to applicationDate, the later available receivedDate/validatedDate; records with neither are excluded. receivedDate and validatedDate retain their source meanings. Source detail time, council scrape time and database-write time differ. Raw status/decision wording varies; decisionOutcome is approved/refused/withdrawn/other/unknown. ## Coverage and evidence Use https://planwire.io/uk-planning-api and https://planwire.io/coverage before selecting territories. Dated aggregate report and methodology: https://planwire.io/research/uk-planning-data-quality. No source-completeness or construction-start inference is established by these examples.