> ## Documentation Index
> Fetch the complete documentation index at: https://vetta.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Data

> client.data — search the data catalogue in any of 18 domains, read a tool's schema, and run it.

`client.data` wraps the three [data routes](/docs/api/data). Types: `DataTool`, `DataToolDetail`, `DataRun`, `DataRunRequest`, `DataToolSearch`, `DataDomain`. [`client.socialData`](/docs/sdk/social-data) is the same catalogue's `social` domain.

```ts theme={"system"}
import { createClient } from "@usenaive-sdk/vetta";
const client = createClient({ apiKey: process.env.VETTA_API_KEY! });

// 1. Find a tool (free)
const { data: tools } = await client.data.searchTools({ query: "homes for sale", domain: "real_estate", limit: 5 });
for (const tool of tools) console.log(tool.name, tool.domains, tool.price.text, tool.id);

// 2. Read what it takes (free)
const tool = await client.data.getTool(tools[0].id);
console.log(tool.input.query, tool.input.body, tool.notes);

// 3. Run it (priced) — with the parameters tool.input names
const run = await client.data.run({ tool_id: tool.id, query: { location: "Austin, TX" } });
if (run.status === "failed") throw new Error(run.error!);
console.log(run.data, `cost $${run.cost_micro_usd / 1e6}`);
```

| Method | Route | Notes |
| - | - | - |
| `searchTools({ query, domain?, platform?, limit? })` | `GET /v1/data/tools` | Free. `{ data: DataTool[] }`, best match first. |
| `getTool(id)` | `GET /v1/data/tools/{id}` | Free. Adds `input` (JSON Schema per `path` / `query` / `body`) and `notes`. |
| `run({ tool_id, query?, path?, body? })` | `POST /v1/data/runs` | Priced. Resolves when the run ends (≤ \~2 min). Each call sends a fresh `Idempotency-Key` (or your client's `idempotencyKey()`), so calling `run()` again is a second, billed run. |

A failed run resolves (it does not throw) with `status: "failed"` and `error`; refusals before a run — `insufficient_credits` (the balance does not cover the tool's listed price for one call, or for 25 results on a per-result tool), `not_found`, `validation_failed` — throw an [`ApiError`](/docs/sdk/errors).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.