Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.simplefunctions.dev/llms.txt

Use this file to discover all available pages before exploring further.

Use these endpoints when an agent needs source context separate from prediction-market objects.

Economic query

GET /api/public/query-econ
curl "https://simplefunctions.dev/api/public/query-econ?q=unemployment%20rate&limit=3"
Parameters:
ParameterValuesUse
qstringEconomic series or macro topic. Required.
modefull, rawfull includes answer text from the mirror; raw is structured retrieval.
limit1 to 10Max series. Default 5.
includeMarketstrue, 1, yesInclude related Kalshi/Polymarket markets. Default false.
Response shape:
{
  "query": "unemployment rate",
  "answer": "...",
  "series": [
    {
      "id": "UNRATE",
      "title": "Unemployment Rate",
      "units": "Percent",
      "frequency": "Monthly",
      "latest": {
        "date": "2026-03-01",
        "value": "4.3",
        "numericValue": 4.3
      },
      "changes": {
        "previous": {},
        "yearAgo": {}
      },
      "observations": [],
      "source": "FRED",
      "sourceUrl": "https://fred.stlouisfed.org/series/UNRATE",
      "observationsUrl": "https://simplefunctions.dev/api/public/fred?series=UNRATE"
    }
  ],
  "markets": [],
  "meta": {
    "provider": "fred-mirror",
    "mode": "full",
    "includeMarkets": false,
    "latencyMs": 0
  },
  "nextActions": {
    "inspect": [],
    "related": []
  }
}
Add markets:
curl "https://simplefunctions.dev/api/public/query-econ?q=unemployment%20rate&includeMarkets=true"
CLI:
sf econ "unemployment rate" --json
sf fred UNRATE --json

Government query

GET /api/public/query-gov
curl "https://simplefunctions.dev/api/public/query-gov?q=save%20act&limit=3"
Parameters:
ParameterValuesUse
qstringBill, nomination, member, jurisdiction, or policy question. Required.
modefull, rawfull includes synthesis. raw returns structured retrieval.
sourcescomma listcongress, openstates, kalshi, crs. Default all.
limit1 to 20Max results per source. Default 10.
depthtrueFetch deeper bill/action/orderbook context where available.
Response shape:
{
  "query": "save act",
  "answer": "...",
  "keyFactors": [],
  "bills": [
    {
      "id": "119-hr-22",
      "congress": 119,
      "type": "hr",
      "number": 22,
      "title": "...",
      "status": "...",
      "sponsor": "...",
      "hasMarket": true,
      "market": {
        "ticker": "...",
        "title": "...",
        "venue": "kalshi"
      }
    }
  ],
  "nominations": [],
  "markets": [],
  "members": [],
  "meta": {
    "provider": "congress-mirror",
    "mode": "full",
    "latencyMs": 0
  },
  "nextActions": {
    "inspect": [],
    "related": []
  }
}
Examples:
curl "https://simplefunctions.dev/api/public/query-gov?q=warsh%20fed%20chair&limit=5"
curl "https://simplefunctions.dev/api/public/query-gov?q=save%20act&sources=congress,kalshi"
curl "https://simplefunctions.dev/api/public/query-gov?q=new%20york%20energy%20bill&sources=openstates"
CLI:
sf policy "save act" --json
sf bill 119-hr-22 --json

Bill detail

GET /api/public/legislation/{billId}
curl "https://simplefunctions.dev/api/public/legislation/119-hr-22"
Use bill detail after query-gov returns a bill id.