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

# Python SDK: Datasources

> List Valyu datasets and categories from Python 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

```python theme={null}
from valyu import Valyu

valyu = Valyu()

# List datasources (optionally filtered by category)
response = valyu.datasources(category="research")
if not response.success:
    raise RuntimeError(response.error)

for source in response.datasources or []:
    print(source.id, source.name, source.description)

# List categories with dataset counts
for cat in valyu.datasources_categories().categories:
    print(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(category=None)` | List datasources, optionally filtered by category |
> | `datasources_categories()` | List all categories with dataset counts |

> [accordion] Response format
>
> ```python theme={null}
> class DatasourcesResponse:
>     success: bool
>     error: Optional[str]
>     datasources: List[Datasource]
>
> class Datasource:
>     id: str                              # e.g., "valyu/valyu-arxiv"
>     name: str
>     description: str
>     category: str
>     type: Optional[str]
>     modality: Optional[List[str]]
>     topics: Optional[List[str]]
>     languages: Optional[List[str]]
>     source: Optional[str]
>     example_queries: Optional[List[str]] # Sample queries for few-shot prompting
>     pricing: Optional[DatasourcePricing] # .cpm = price per 1,000 returned results
>     response_schema: Optional[dict]
>     update_frequency: Optional[str]
>     size: Optional[int]
>     coverage: Optional[DatasourceCoverage]  # .start_date / .end_date
>
> class DatasourceCategoriesResponse:
>     success: bool
>     error: Optional[str]
>     categories: List[DatasourceCategory]
>
> class DatasourceCategory:
>     id: str
>     name: str
>     description: Optional[str]
>     dataset_count: int
> ```


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