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

# Run your first research report

> Run your first DeepResearch task: send a brief, keep the task ID and get a cited report plus the CSV or spreadsheet you asked for. Python, TypeScript, cURL.

A search answers one question. DeepResearch takes a whole research job: it plans the work, runs many searches across the web and specialist sources, reads what it finds and writes a cited report. Ask for files and you get those too, such as a CSV with one row per company.

You send a brief, keep the task ID and collect the result when it's done. This walkthrough takes about ten minutes, most of it waiting for the research.

> [!TIP]
>
> Want to see the output first? Browse [finished example reports](https://docs.valyu.ai/example-reports.md), each with its CSV and the exact request that produced it.

**1. Get a key and install an SDK**

Create a key at [platform.valyu.ai](https://platform.valyu.ai) and set it in your environment. Accounts without a plan get 2,000 free credits a month with a work email (1,000 with a personal email; add a card after your first month to keep them coming), enough for several research reports.

```bash Python theme={null}
export VALYU_API_KEY="your-api-key"
python3 -m pip install valyu
```

```bash TypeScript theme={null}
export VALYU_API_KEY="your-api-key"
pnpm add valyu-js
```

**2. Write the brief**

A good brief says what to find, where to look and what to hand back. Three fields carry it:

| Field | What it's for | Example |
| - | - | - |
| `query` | The question and its scope | Capex guidance from five companies, on their last three calls |
| `research_strategy` | Where to look and what to trust | Use transcripts and filings; quote management exactly |
| `report_format` | How the report should read | A table, then one short section per company |

Be specific about periods and entities. "Their last three earnings calls before 15 October 2026" gets a better result than "recently".

**3. Ask for the files you want**

Add `deliverables` to get files with the report. A CSV needs only a description; suggested `columns` make the shape predictable.

```json theme={null}
"deliverables": [
  {
    "type": "csv",
    "description": "One row per company per call, with the guidance quote and source URL.",
    "columns": ["company", "call_date", "guidance_quote", "change_vs_prior_call", "source_url"]
  }
]
```

You can ask for up to ten files: `csv`, `xlsx`, `pptx`, `docx` or `pdf`, in every mode except instant. Excel, PowerPoint and Word files need the code execution tool, which you turn on with `tools`.

**4. Start the task and wait for it**

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

valyu = Valyu()  # reads VALYU_API_KEY

task = valyu.deepresearch.create(
    query=(
        "How did Microsoft, Alphabet, Amazon and Meta describe their capital "
        "expenditure plans on their last three earnings calls held before "
        "15 October 2026? Record any numeric guidance and whether it was "
        "raised, maintained or lowered compared with the previous call."
    ),
    mode="standard",
    research_strategy="Use earnings call transcripts, earnings releases and 10-Q filings. Quote management exactly.",
    report_format="A summary, a table by company and call, then one short section per company.",
    deliverables=[{
        "type": "csv",
        "description": "One row per company per call, with the guidance quote and source URL.",
        "columns": ["company", "call_date", "guidance_quote", "change_vs_prior_call", "source_url"],
    }],
)
if not task.success or not task.deepresearch_id:
    raise RuntimeError(task.error)
print("Task:", task.deepresearch_id)

result = valyu.deepresearch.wait(task.deepresearch_id)  # polls; raises on failure
```

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

const valyu = new Valyu(); // reads VALYU_API_KEY

const task = await valyu.deepresearch.create({
  query:
    "How did Microsoft, Alphabet, Amazon and Meta describe their capital " +
    "expenditure plans on their last three earnings calls held before " +
    "15 October 2026? Record any numeric guidance and whether it was " +
    "raised, maintained or lowered compared with the previous call.",
  mode: "standard",
  researchStrategy: "Use earnings call transcripts, earnings releases and 10-Q filings. Quote management exactly.",
  reportFormat: "A summary, a table by company and call, then one short section per company.",
  deliverables: [{
    type: "csv",
    description: "One row per company per call, with the guidance quote and source URL.",
    columns: ["company", "call_date", "guidance_quote", "change_vs_prior_call", "source_url"],
  }],
});
if (!task.success || !task.deepresearch_id) throw new Error(task.error);
console.log("Task:", task.deepresearch_id);

const result = await valyu.deepresearch.wait(task.deepresearch_id); // polls until done
if (result.status !== "completed") throw new Error(`Task ${result.status}`);
```

```bash cURL theme={null}
curl --fail-with-body https://api.valyu.ai/v1/deepresearch/tasks \
  -H "x-api-key: $VALYU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "How did Microsoft, Alphabet, Amazon and Meta describe their capital expenditure plans on their last three earnings calls held before 15 October 2026? Record any numeric guidance and whether it was raised, maintained or lowered compared with the previous call.",
    "mode": "standard",
    "research_strategy": "Use earnings call transcripts, earnings releases and 10-Q filings. Quote management exactly.",
    "report_format": "A summary, a table by company and call, then one short section per company.",
    "deliverables": [{
      "type": "csv",
      "description": "One row per company per call, with the guidance quote and source URL.",
      "columns": ["company", "call_date", "guidance_quote", "change_vs_prior_call", "source_url"]
    }]
  }'

# Save the deepresearch_id from the response, then poll until "status" is "completed":
curl https://api.valyu.ai/v1/deepresearch/tasks/TASK_ID/status \
  -H "x-api-key: $VALYU_API_KEY"
```

Save the task ID. If your process restarts, check the existing task instead of creating a new one. In Python, `wait` raises if the task fails, is cancelled or times out; in TypeScript it returns the final status, so check it as shown.

**5. Read the report and download the files**

A completed task carries the report, its sources, the files and the cost.

```python Python theme={null}
print(result.output)  # the cited report, in markdown

for source in result.sources or []:
    print("-", source.title, source.url)

for file in result.deliverables or []:
    if file.status == "completed":
        print(file.type, file.title, file.url)  # signed download link

print("Cost:", result.cost)
```

```typescript TypeScript theme={null}
console.log(result.output); // the cited report, in markdown

result.sources?.forEach((s) => console.log("-", s.title, s.url));

for (const file of result.deliverables ?? []) {
  if (file.status === "completed") console.log(file.type, file.title, file.url);
}

console.log("Cost:", result.cost);
```

| Field | What it holds |
| - | - |
| `output` | The report in markdown, with numbered citations |
| `sources` | Every source the report cites, with title and URL |
| `deliverables` | Your files, each with `type`, `status`, `title` and a signed `url` |
| `pdf_url` | The report as a PDF, when you add `"pdf"` to `output_formats` |
| `cost` | What the task cost |

Download files you need to keep: the signed links expire.

**6. Share it (optional)**

Make a finished report public to get a link anyone can open, with no login. The share page includes the sources and file downloads.

```python Python theme={null}
valyu.deepresearch.toggle_public(task.deepresearch_id, is_public=True)
# Share link: https://platform.valyu.ai/share/<deepresearch_id>
```

```typescript TypeScript theme={null}
await valyu.deepresearch.togglePublic(task.deepresearch_id, true);
// Share link: https://platform.valyu.ai/share/<deepresearch_id>
```

```bash cURL theme={null}
curl -X POST https://api.valyu.ai/v1/deepresearch/tasks/TASK_ID/public \
  -H "x-api-key: $VALYU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"public": true}'
```

To keep the report private and share it with specific people instead, see [share a report with specific people](https://docs.valyu.ai/guides/deepresearch-sharing.md).

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

## Pick a mode

`mode` sets how much research a task does, from `instant` (8 credits, under 30 seconds) to `max` (2,500 credits, up to 90 minutes). Start with `standard` at 100 credits, then compare modes on a few of your own briefs. See [modes and limits](https://docs.valyu.ai/guides/deepresearch-overview#pick-a-mode) and [pricing](https://docs.valyu.ai/pricing.md); failed tasks are never charged.

## Next steps

> [card] [See finished reports](https://docs.valyu.ai/example-reports.md)
>
> Real Standard, Heavy and Max reports with CSVs, and the requests behind them.

> [card] [Configure research](https://docs.valyu.ai/guides/deepresearch.md)
>
> Choose sources, attach documents, request structured output or pin a run to a date.

> [card] [Put research in your app](https://docs.valyu.ai/guides/research-in-your-application.md)
>
> Store task IDs, show progress and keep citations with the output.

> [card] [Run many at once](https://docs.valyu.ai/guides/deepresearch-batch-quickstart.md)
>
> Batch tasks with shared settings and one cost total.


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