API & MCP
Everything a person can do on Public Spending Explorer, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://publicspendingexplorer.usefulweb.site/api/v1/calculate– run Public Spending ExplorerGET https://publicspendingexplorer.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Public Spending Explorer
Searches US federal awards on USAspending.gov (contracts, IDVs, grants, other assistance) or EU contract award notices on TED, then totals the results per agency/buyer and per recipient and draws the agency → recipient relationship graph. Paste a saved API response to analyse it offline.
| Field | Type | Default | Description |
|---|---|---|---|
source | select (usaspending, ted, pasted) | "usaspending" | Data source |
keyword | text | — | Keyword. Full-text keyword (award description / notice text). |
recipient | text | — | Recipient / vendor name. Optional. USAspending: recipient_search_text; TED: winner-name contains. |
awardType | select (contracts, idvs, grants, other_financial_assistance) | "contracts" | Award type (USAspending) |
startDate | date | — | From. Default: 365 days before today. |
endDate | date | — | To. Default: today. |
buyerCountry | text | — | Buyer country (TED, ISO 3166 alpha-3) |
limit | integer | 50 | Max results |
pastedJson | textarea | — | Pasted JSON response. Response of USAspending POST /api/v2/search/spending_by_award/ or TED POST /v3/notices/search. |
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://publicspendingexplorer.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
public_spending_explorer - Local stdio connector:
node src/mcp-stdio.ts --tool=public-spending-explorer
{
"mcpServers": {
"public-spending-explorer": { "type": "http", "url": "https://publicspendingexplorer.usefulweb.site/mcp" }
}
}