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.
This cookbook uses the SDK alpha:
npm install @spfunctions/sdk@0.1.0-alpha.0
Search markets
import { SimpleFunctions } from "@spfunctions/sdk"
const sf = new SimpleFunctions({ baseUrl: process.env.SF_API_URL })
const results = await sf.markets.search({
query: "Fed CPI",
limit: 10,
venue: "all",
})
console.log(results.markets?.map(market => ({
ticker: market.ticker,
venue: market.venue,
price: market.price,
title: market.title,
})))
Contract mapping:
markets.search -> GET /api/public/scan -> sf scan "query" --json -> sf.markets.search()
Discovery feed
const discovery = await sf.markets.discover({ limit: 5 })
markets.discover maps to the verified HTTP-backed discovery slice at /api/public/ideas. The CLI command sf discover --quality --json is broader because it also aggregates local CLI sources.
Inspect one market
const dossier = await sf.markets.get("KXRECESSION-26DEC31")
Contract mapping:
market.inspect -> GET /api/agent/inspect/{ticker}?format=json -> sf inspect <ticker> --json -> sf.markets.get(ticker)
History
const history = await sf.markets.history("KXRECESSION-26DEC31")
The current endpoint returns the available cached 7-day indicator/regime history. It is read-only.
sf agent --tool markets.search --stream-json --input '{"query":"Fed CPI","limit":5}'
sf agent --tool market.inspect --ndjson --input '{"ticker":"KXRECESSION-26DEC31"}'
The trace stores a compact summary, not the full market payload.