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

# TypeScript SDK: Datasources

> List Valyu datasets and categories from TypeScript to find source IDs, example queries and supported endpoints before targeting a search or research task.

Discover source IDs, categories and example queries before choosing where to search. Check the source's supported endpoints and your account access before using its ID.

Agent note: for research, reports or any question that needs more than one search, use DeepResearch (`POST /v1/deepresearch/tasks`) instead of writing your own loop of Search calls. Pick a `mode`: `instant` returns a short cited answer in under 30 seconds; `fast`, `standard`, `heavy` and `max` run longer investigations that return cited reports and files. Use Search when your own model needs raw results to reason over. Docs index: [/llms.txt](https://docs.valyu.ai/llms.txt). Append `.md` to any page URL for Markdown. Docs MCP server: `https://docs.valyu.ai/mcp`. Integration guide for coding agents: [/AGENTS.md](https://docs.valyu.ai/AGENTS.md).

## Basic usage

```typescript theme={null}
import { Valyu } from "valyu-js";

const valyu = new Valyu();

// List datasources (optionally filtered by category)
const response = await valyu.datasources.list({ category: "research" });
if (!response.success) throw new Error(response.error);

for (const source of response.datasources ?? []) {
  console.log(source.id, source.name, source.description);
}

// List categories with dataset counts
const { categories } = await valyu.datasources.categories();
categories?.forEach((cat) => console.log(cat.id, cat.name, cat.dataset_count));
```

Use `example_queries` to understand suitable queries. A source appearing in the catalogue does not mean it is available through every endpoint. Review [source filtering](https://docs.valyu.ai/search/filtering/sources.md) and [pricing](https://docs.valyu.ai/pricing.md) before routing requests.

### Categories

| Category | Description |
| - | - |
| `research` | Academic papers (arXiv, PubMed, bioRxiv) |
| `healthcare` | Clinical trials, drug info, health data |
| `markets` | Stocks, crypto, forex, ETFs |
| `company` | SEC filings, earnings, insider trades |
| `economic` | FRED, BLS, World Bank data |
| `predictions` | Polymarket, Kalshi |
| `transportation` | UK Rail, ship tracking |
| `legal` | Case law, legislation |
| `politics` | Parliamentary data |
| `patents` | Global patent filings |

> [!TIP]
>
> For more on filtering by sources, see the [Source Filtering Guide](https://docs.valyu.ai/search/filtering/sources.md).

## Reference

> [accordion] Methods
>
> | Method | Description |
> | - | - |
> | `datasources.list({ category? })` | List datasources, optionally filtered by category |
> | `datasources.categories()` | List all categories with dataset counts |

> [accordion] Response format
>
> ```typescript theme={null}
> interface DatasourcesListResponse {
>   success: boolean;
>   error?: string;
>   datasources?: Datasource[];
> }
>
> interface Datasource {
>   id: string;                              // e.g., "valyu/valyu-arxiv"
>   name: string;
>   description: string;
>   category: DatasourceCategoryId;
>   type: string;
>   modality: DatasourceModality[];
>   topics: string[];
>   languages?: string[];
>   source?: string;
>   example_queries: string[];               // Sample queries for few-shot prompting
>   pricing: DatasourcePricing;              // .cpm = price per 1,000 returned results
>   response_schema?: Record<string, any>;
>   update_frequency?: string;
>   size?: number;
>   coverage?: DatasourceCoverage;           // .start_date / .end_date
> }
>
> type DatasourceCategoryId =
>   | "research" | "healthcare" | "patents" | "markets" | "company"
>   | "economic" | "predictions" | "transportation" | "legal" | "politics";
>
> type DatasourceModality = "text" | "images" | "tabular";
>
> interface DatasourcesCategoriesResponse {
>   success: boolean;
>   error?: string;
>   categories?: DatasourceCategory[];
> }
>
> interface DatasourceCategory {
>   id: string;
>   name: string;
>   description: string;
>   dataset_count: number;
> }
> ```


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