open_checkbook_search
Search US government vendor payments from Socrata Open Checkbook portals. Filter by year, vendor, department, expense category, sort, and paginate.
Instructions
Row-level vendor-payment search over a curated US-government Socrata Open Expenditures checkbook portal (keyless) — a SLED spending source. Some govs run Socrata's 'Open Expenditures/Open Checkbook' product, whose public dashboard fronts a keyless app-proxy at {host}/api/checkbook_data.json. First portal: sd = State of South Dakota Open Checkbook (~740,980 vendor-payment rows, ~$8.41B, the ~3 most-recent fiscal years). Inputs: portal (allowlist ENUM — SSRF core), year/vendor/org/expenseCategory (EXACT-match filters), sortBy/sortOrder, limit(1..1000)/offset. Returns { portal, rows:[{vendor, amount, payment_date, org1, expense_category, description, fund, invoice, payment_id}] } + honest _meta. HONESTY: totalAvailable = the API's own count (the REAL filtered total — matches the product's totals.json, e.g. 740,980 unfiltered / 109,887 for org=TRANSPORTATION — NEVER a page length); amount = number|null (a real $0 is 0, an absent value is null, never a fabricated 0); an EXACT-match filter miss ⇒ honest count:0; a deep offset past the end ⇒ returned:0 with the real count preserved; a 429/5xx/timeout THROWS; a non-{data:[],count} body ⇒ schema_drift. ★Only the ~3 most-recent fiscal years are exposed (NOT full history — disclosed). ★The underlying Socrata SODA dataset is login-gated and is NEVER touched — only the public app-proxy the dashboard itself uses. SSRF: fixed allowlist host + assertion + redirect:error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org | No | Department filter (org1, EXACT match, e.g. 'TRANSPORTATION' → 109,887). | |
| year | No | Fiscal-year filter (EXACT match), e.g. '2025'. Default 'All Years' = the exposed ~3-year window (NOT full history). | |
| limit | No | Rows per page, 1..1000, default 25. | |
| offset | No | 0-based offset (snapped to a page×limit boundary; the served offset is disclosed). totalAvailable = the real match count, NOT a page length. | |
| portal | Yes | The curated Open-Checkbook portal (SSRF allowlist enum). 'sd' = State of South Dakota Open Checkbook (~740,980 vendor payments, ~$8.41B, ~3 most-recent fiscal years). | |
| sortBy | No | Sort field. Pair with sortOrder. | |
| vendor | No | Vendor name filter (EXACT match, e.g. 'US BANK NA' → 917). A partial/misspelled value returns an honest count:0. | |
| sortOrder | No | Sort direction (default desc when sortBy is set). | |
| expenseCategory | No | Expense-category filter (EXACT match, e.g. 'CONTRACTUAL SERVICES'). |