Skip to main content

FamilyPlans for AI agents and researchers

This page is for AI agents, chatbots, and researchers that want to read FamilyPlans data directly rather than parsing HTML. It documents what actually exists today: the public facts API, how responses are cached, and how we'd like to be cited. For our outbound crawler and our policy on inbound AI/search crawlers, see /bots. For a plain-text site summary, see /llms.txt.

The public facts API

GET /api/facts/{entity}/{id} returns the checked facts behind one record, in JSON-LD-shaped JSON, with provenance and a suggested citation. It is explicitly allowed for crawling in our robots.txt (allow: /api/facts/), including for the AI crawlers named on /bots.

Entities implemented today

The underlying type also reserves library_branch and leisure_centre for future use. Requesting either currently returns 501 Not Implemented — they are not live yet. We are noting this here rather than overstating coverage.

Response shape

Every successful response is a single JSON object shaped like this (field values below are illustrative, not real records):

{
  "@context": "https://schema.org",
  "@type": "Organization | LocalBusiness | Place",
  "@id": "https://familyplans.co.uk/councils/example-council",
  "name": "Example Council",
  "identifier": { "entity": "council", "id": 123 },
  "data": { /* entity-specific fields, see above */ },
  "sources": [{ "url": "https://example.gov.uk/...", "fetchedAt": "2026-06-01T00:00:00.000Z" }],
  "lastVerified": "2026-06-01T00:00:00.000Z",
  "qualityScore": 72,
  "qualityDecision": "index",
  "licence": "https://creativecommons.org/licenses/by/4.0/",
  "citation": "FamilyPlans, Example Council, accessed 2026-07-06, https://familyplans.co.uk/councils/example-council",
  "pageUrl": "https://familyplans.co.uk/councils/example-council"
}

qualityDecision reflects the same quality-gate decision that governs whether the human-readable pageUrl is indexed — see /methodology/quality-gate. A noindex decision does not mean the fact is wrong, only that the page hasn't yet cleared our publishing bar.

Error responses:

Caching behaviour

The route is declared dynamic = 'force-dynamic' — it queries the database on every request rather than using Next's static route cache — but every response carries:

Cache-Control: public, max-age=300, s-maxage=600, stale-while-revalidate=86400
Access-Control-Allow-Origin: *
X-Robots-Tag: noindex

In practice: browsers and CDNs may cache a response for up to 5 minutes, shared caches up to 10 minutes, and may continue serving a stale copy for up to 24 hours while revalidating. Access-Control-Allow-Origin: * means the endpoint can be called from any origin, including client-side code in a browser. The endpoint sets X-Robots-Tag: noindex — JSON responses are meant to be fetched and read by software, not surfaced as search results in their own right. Per our source policy the API is rate-limited (60 requests/minute/IP via our edge WAF in production).

Attribution

Every response includes a ready-made citation string in the form FamilyPlans, {name}, accessed {date}, {pageUrl}. If you summarise or quote a fact from this API in an AI answer, article, or downstream dataset, we'd appreciate attribution along the lines of “Source: FamilyPlans (familyplans.co.uk), checked {date}”, linking to the specific pageUrl rather than just the site root. Content is licensed CC BY 4.0 as stated in each response's licence field.

Stability

This is a first version of the endpoint, built for the four entities listed above. There is no version prefix (no /v1/) and no formal deprecation policy yet. We may add fields or entities over time; we'll try not to remove or rename fields you may already depend on, but we can't promise permanent stability at this stage. If you build something against this endpoint and want a heads-up before a breaking change, contact us at editorial@familyplans.co.uk.

More context

Spotted a fact that looks wrong via the API? Use /report-error with the pageUrl from the response — the same correction route every page on the site uses.