Documentation

Base URL: https://api.nspros.ca — All responses are JSON and automatically include source attribution.

Authentication

Send your key on every request:

Authorization: Bearer <key>

Exception: browsing the catalog (GET /v1/sources) is public and needs no key. Browse first, and get a free key when you are ready to run queries.

REST reference

MethodEndpointDescription
GET/v1/sourcesList the catalog of available sources. Public — no API key needed. Supports q, category, and country filters.
GET/v1/query/{source_id}?q=...Run a query against one source.
POST/v1/queryRun a query with a JSON body.
GET/v1/usageCheck usage for the current key.

Parameters

NameWhereDescription
source_idpathSource identifier from the catalog, e.g. uk_bank_holidays.
qquery / bodyQuery text for the source.

POST example:

curl -X POST https://api.nspros.ca/v1/query \
  -H "Authorization: Bearer <key>" \
  -H "Content-Type: application/json" \
  -d '{"source_id": "uk_bank_holidays", "q": "2026"}'

Response format

{
  "source_id": "uk_bank_holidays",
  "query": "2026",
  "results": [],
  "attribution": {
    "source": "GOV.UK",
    "license": "Open Government Licence v3.0"
  }
}

The attribution object is included automatically in every response. Keep it with the data when you display or redistribute results.

Error codes

CodeMeaning
401Missing or invalid API key. Check the Authorization header.
429Rate limit exceeded. Slow down and retry after a short wait.
502The upstream source returned an error or was unavailable. Retry later.

MCP guide

MCP endpoint: https://api.nspros.ca/mcp — Connect with the same Bearer key:

{
  "mcpServers": {
    "nspros-data": {
      "url": "https://api.nspros.ca/mcp",
      "headers": {
        "Authorization": "Bearer <key>"
      }
    }
  }
}
ToolDescription
search_sourcesSearch the catalog for sources matching a topic or keyword.
query_sourceRun a query against a source by source_id.
get_usageReturn usage for the current key.

License policy

Rate limits and caching

Get a free API key  ·  llms.txt