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

# Social data

> client.socialData — search the public social data catalogue, read a tool's schema, and run it.

`client.socialData` wraps the three [social data routes](/docs/api/social-data). Types: `SocialDataTool`, `SocialDataToolDetail`, `SocialDataRun`, `SocialDataRunRequest`, `SocialDataToolSearch`. It is [`client.data`](/docs/sdk/data)'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.socialData.searchTools({ query: "tiktok video comments", platform: "tiktok", limit: 5 });
for (const tool of tools) console.log(tool.name, tool.price.text, tool.id);

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

// 3. Run it (priced)
const run = await client.socialData.run({ tool_id: tool.id, query: { url: "https://www.tiktok.com/@nasa/video/1" } });
if (run.status === "failed") throw new Error(run.error!);
console.log(run.data, `cost $${run.cost_micro_usd / 1e6}`);
```

| Method | Route | Notes |
| - | - | - |
| `searchTools({ query, platform?, limit? })` | `GET /v1/social_data/tools` | Free. `{ data: SocialDataTool[] }`, best match first. |
| `getTool(id)` | `GET /v1/social_data/tools/{id}` | Free. Adds `input` (JSON Schema per `path` / `query` / `body`) and `notes`. |
| `run({ tool_id, query?, path?, body? })` | `POST /v1/social_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`, `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.