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

# Query economic and government data

> Use read-only SDK and agent tools for official econ and legislative context.

The local experimental SDK exposes the same read-only query objects used by the CLI and HTTP APIs.

## Economic data

```ts theme={null}
import { SimpleFunctions } from "@spfunctions/sdk"

const sf = new SimpleFunctions({ baseUrl: process.env.SF_API_URL })

const econ = await sf.econ.query({
  q: "unemployment rate",
  mode: "raw",
  limit: 3,
})
```

Contract mapping:

```text theme={null}
econ.query -> GET /api/public/query-econ -> sf econ "query" --json -> sf.econ.query()
```

## Government and legislation

```ts theme={null}
const gov = await sf.gov.query({
  q: "SAVE Act",
  mode: "raw",
  limit: 5,
})
```

Contract mapping:

```text theme={null}
gov.query -> GET /api/public/query-gov -> sf policy "query" --json -> sf.gov.query()
```

## Direct Agent tool mode

```bash theme={null}
sf agent --tool econ.query --stream-json --input '{"q":"unemployment rate","mode":"raw","limit":3}'
sf agent --tool gov.query --stream-json --input '{"q":"SAVE Act","mode":"raw","limit":3}'
```

These tools are read-only and have `sideEffect: none`.
