Ask a policy question.
Get the legislative record
and the market odds.
One API call searches Congress.gov, Kalshi, Open States, and our legislation-market mapping. Returns bills, nominations, prediction market prices, and LLM synthesis. No auth required.
Try it now
Bills, markets, and
nominations in one call.
The endpoint understands natural language. Ask about a bill by name, a policy topic, or a person. It fans out to 4 data sources in parallel, re-ranks by relevance, and optionally synthesizes an answer.
Congress.gov bills
Full text search via Tavily, enriched with market pairs.
Prediction markets
Kalshi policy markets — confirmation odds, vote markets.
Nominations
PN numbers, committee referrals, confirmation status.
State legislation
Open States cross-reference when a state is mentioned.
$ curl "simplefunctions.dev/api/public/query-gov?q=save+act"{
"answer": "The SAVE Act (H.R. 22) passed
the House and is in the Senate. Markets
give it 11% to become law.",
"bills": [
{ "id": "119-hr-22",
"title": "SAVE Act",
"status": "Received in the Senate.",
"hasMarket": true,
"market": { "ticker": "KXSAVEACT..." } }
],
"markets": [
{ "ticker": "KXSAVEACT-27-JAN04",
"price": 11, "volume": 3322351 }
],
"nominations": [],
"meta": { "latencyMs": 3100, "sources": ["congress", "kalshi"] }
}Three ways to query
REST
No auth. JSON in, JSON out. Add &mode=raw to skip LLM synthesis.
$ curl "simplefunctions.dev/api/public/query-gov?q=government+shutdown"CLI
sf policy searches bills and markets. sf bill gets full detail.
$ sf policy "save act"MCP
query_gov and legislation tools for Claude, Cursor, or any MCP client.
$ claude mcp add simplefunctions --url simplefunctions.dev/api/mcp/mcpData sources
Each query fans out to multiple sources in parallel. Results are de-duplicated, enriched with market pairs, and re-ranked by relevance.
Congress.gov API
425K+ bills, 538 members, nominations, CRS reports. LLM-expanded search finds bills by name, acronym, or topic.
e.g. SAVE Act, HR 22, immigration reform
Kalshi
Policy prediction markets — bill passage, confirmation votes, shutdown odds, tariff rates. Live prices and volume.
e.g. KXSAVEACT, KXGOVSHUT, cloture votes
Open States
State-level legislation from all 50 states. Cross-referenced when your query mentions a state.
e.g. California AI bill, Texas immigration
Legislation-Market Pairs
143 mapped pairs linking Congress bills and nominations to Kalshi/Polymarket contracts. Updated weekly.
e.g. Which bills have prediction markets?
Endpoints
Full reference →/api/public/query-gov?q=...Legislative search — bills + markets + nominations/api/public/query-gov?q=...&mode=rawSkip LLM synthesis, structured data only/api/public/legislationList legislation with market pairs/api/public/legislation/:billIdBill detail — sponsors, actions, state bills/api/public/congress/membersAll current Congress members/api/public/congress/member/:idMember detail — bills, terms, committeesqstringNatural language query (required, min 2 chars)moderaw | fullSkip or include LLM synthesis (default: full)sourcescsvPick sources: congress, openstates, kalshi, crslimit1-20Max results per source (default: 10)How it works
Query understanding
LLM extracts bill references (HR 22), jurisdictions (California), person names, and expanded search terms from your natural language query.
Parallel fan-out
Raw query hits Tavily + Kalshi + Congress API simultaneously. After LLM returns, expanded queries fire in parallel. Total: ~3 seconds.
Merge and enrich
Results de-duplicated across sources. Bills matched against our 143 legislation-market pairs for live prediction market prices.
Re-rank and synthesize
Bills with markets rank higher. Policy area match boosts score. Optional LLM synthesis produces a 1-3 sentence answer citing bill numbers and probabilities.
Phase 1 (parallel):
LLM → ["government shutdown",
"continuing resolution",
"appropriations bill"]
Tavily → 8 bills from congress.gov
Kalshi → 4 policy markets
Noms → 250 fetched, 0 matched
Phase 2 (parallel):
Tavily → +6 bills from expanded queries
Merge:
10 unique bills, 4 markets
1 bill has market pair
Total: 2955msUse cases
Policy analysts
Track bill progression alongside market-implied probability. Know when the Senate vote odds shift before the press release.
?q=government shutdownTrading desks
Cross-reference legislative status with Kalshi prices. Find confirmation vote markets with mispriced odds based on committee status.
?q=fed chair nominationAI agents
Give your agent legislative context. MCP tools and structured JSON make it trivial to integrate policy intelligence into any workflow.
?q=tariff on chinese goodsFree. No auth. Try it now.
All legislative endpoints are public. No API key, no rate limit for reasonable use. Add an API key for higher throughput and custom model tiers.