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.

01

Congress.gov bills

Full text search via Tavily, enriched with market pairs.

02

Prediction markets

Kalshi policy markets — confirmation odds, vote markets.

03

Nominations

PN numbers, committee referrals, confirmation status.

04

State legislation

Open States cross-reference when a state is mentioned.

Terminal
$ curl "simplefunctions.dev/api/public/query-gov?q=save+act"
Response — 200 OK~3s
{
  "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/mcp

Data 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?

PublicNo auth required
GET
/api/public/query-gov?q=...Legislative search — bills + markets + nominations
GET
/api/public/query-gov?q=...&mode=rawSkip LLM synthesis, structured data only
GET
/api/public/legislationList legislation with market pairs
GET
/api/public/legislation/:billIdBill detail — sponsors, actions, state bills
GET
/api/public/congress/membersAll current Congress members
GET
/api/public/congress/member/:idMember detail — bills, terms, committees
Parameters
qstringNatural language query (required, min 2 chars)
moderaw | fullSkip or include LLM synthesis (default: full)
sourcescsvPick sources: congress, openstates, kalshi, crs
limit1-20Max results per source (default: 10)

How it works

01

Query understanding

LLM extracts bill references (HR 22), jurisdictions (California), person names, and expanded search terms from your natural language query.

02

Parallel fan-out

Raw query hits Tavily + Kalshi + Congress API simultaneously. After LLM returns, expanded queries fire in parallel. Total: ~3 seconds.

03

Merge and enrich

Results de-duplicated across sources. Bills matched against our 143 legislation-market pairs for live prediction market prices.

04

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.

Pipeline — "government shutdown"
Phase 1 (parallel):
  LLM["government shutdown",
         "continuing resolution",
         "appropriations bill"]
  Tavily8 bills from congress.gov
  Kalshi4 policy markets
  Noms250 fetched, 0 matched

Phase 2 (parallel):
  Tavily+6 bills from expanded queries

Merge:
  10 unique bills, 4 markets
  1 bill has market pair
  Total: 2955ms

Use cases

Policy analysts

Track bill progression alongside market-implied probability. Know when the Senate vote odds shift before the press release.

?q=government shutdown

Trading desks

Cross-reference legislative status with Kalshi prices. Find confirmation vote markets with mispriced odds based on committee status.

?q=fed chair nomination

AI 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 goods

Free. 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.