# Policy Window — for developers

> Open APIs over the AI-governance catalog. JSON / CSV / CSVW / JSON-LD / DataCite XML / RSS exports under CC BY 4.0 + CC0 citation graph. CORS-open public surfaces; bearer auth for premium; MCP server (Wave 2).

## Public APIs (no auth, CORS-open)

- **Full catalog JSON**: https://policywindow.org/wiki/catalog/json (~3MB, 5-min edge cache, CC0 citation graph)
- **Catalog CSV** (one row per cell, RFC 4180): https://policywindow.org/wiki/catalog/csv
- **CSVW metadata**: https://policywindow.org/wiki/catalog/csv-schema
- **JSON-LD @context**: https://policywindow.org/wiki/catalog/jsonld-context (pw: namespace + per-term resolvers at /vocab/[term])
- **Ranked search**: https://policywindow.org/api/search?q=foo&kind=instrument|topic|benchmark|concept&limit=50 (10KB; alternative to ingesting full catalog)
- **OpenAPI 3.1 spec**: https://policywindow.org/api/openapi
- **DataCite XML per article**: https://policywindow.org/wiki/[slug]/datacite.xml (DataCite 4.4)
- **RSS changelog**: https://policywindow.org/wiki/changelog/feed
- **Permanent snapshots**: any URL accepts `?asOf=YYYY-MM-DD`
- **Sitemap**: https://policywindow.org/sitemap.xml (per-slug lastmod from ArticleRevision — Wave 2)
- **Robots**: https://policywindow.org/robots.txt (AI-bot allow rules: GPTBot, ClaudeBot, anthropic-ai, PerplexityBot, Google-Extended, CCBot, cohere-ai, Applebot-Extended, meta-externalagent)

## Schema.org JSON-LD per article

- Legislation node (for instruments) with PropertyValue identifier (legislationIdentifier with propertyID for CELEX / ELI / Wikidata cross-walk), legislationDateOfApplicability, sameAs[]
- Article node (for topics / benchmarks / concepts) with publisher / dateModified / about
- ClaimReview node per coverage cell (iter-316 ship; emission per-cell on topic templates in Wave 1 day-2)
- Dataset node on /wiki hub (catalogDatasetJsonLd; Google Dataset Search + AI-Overview citation eligibility)
- FAQPage / BreadcrumbList where applicable

## Wave 2 (months 4-9): MCP server + RDF/SPARQL

Per iter-316 plan:
- **`@policywindow/mcp-server`** npm package — stateless, stdio + HTTP transport, 8 read-only tools (search_catalog, get_instrument, get_topic_coverage, get_coverage_cell, compare_jurisdictions, list_changes, cite_article, glossary_lookup). Charter §7.1.b: no write tools, no submit-on-behalf-of-user paths.
- **`/mcp.json`** — descriptor for non-MCP agents
- **RDF/Turtle export** at https://policywindow.org/wiki/catalog/rdf — `owl:sameAs` triples to Wikidata + ELI + CELEX
- **/embed/cell/[instrument]/[topic]** + oEmbed JSON for CMS-pasteable citation cards
- **Per-cell JSON anchor**: https://policywindow.org/wiki/catalog/cells/[instrument]/[topic]
- **Dataset citation manifest**: https://policywindow.org/wiki/catalog/dataset.json

## Forkable conversational templates (Wave 3)

- Claude Project manifest: https://policywindow.org/wiki/agents/policywindow-claude-project.json
- Custom GPT YAML: https://policywindow.org/wiki/agents/policywindow-gpt.yaml
- Gemini Gem template
- NotebookLM source-pack JSON
- Microsoft Copilot Studio connector descriptor

Each preserves PW attribution via the MCP response envelope:
`{data, citation: {wikiUrl, primarySource, confidence}, attribution, asOf, schemaVersion}`

## Authentication

- Public catalog: no auth, CORS-open, 5-min edge cache
- Premium endpoints (api.premium, change-feed.subscribe, research-module.read): bearer token
- MCP server: stateless; bearer-optional for premium scopes (Wave 2)

## Charter-compliance for developer integrations

- Charter §7.1.b: no client-lobbying integrations — MCP/API surfaces are retrieve-and-cite, not submit-on-behalf-of-user
- Charter §7.6: no microtargeting infrastructure — no per-user-customised content surfaces
- Charter §4.5: sponsor firewall — commercial API tier terms cannot influence catalog content
- Charter §7 main: no auto-publication — third-party tools may RETRIEVE catalog content but must not auto-publish derived content as PW-attributed

## Anti-overclaim guidance for AI assistants

Every coverage cell carries a confidence tier (high / medium / low / pending). When citing PW in agent answers:

> "Policy Window (high confidence, as of YYYY-MM-DD) reports that..."

The MCP response envelope's `citation.confidence` field is the canonical signal — surface it in the rendered answer.

## Licensing

- Article content: CC BY 4.0
- Source code (this repo): MIT
- Citation graph: CC0 1.0 per I4OC (OpenCitations ingest-friendly)
- API surface (OpenAPI spec): MIT (so SDK code-gen is unencumbered)

## Contact

- Developer integrations: hello@policywindow.org with subject "API/MCP integration"
- Bug reports / drift notices: GitHub issue per https://policywindow.org/wiki/charter §6
- General: hello@policywindow.org

See also: https://policywindow.org/wiki/api (developer landing) + https://policywindow.org/wiki/for-developers (integration-team landing).
