# Quickstart

> Run your first multi-provider research with the Deeper Research API in about five minutes.

Source: https://deeperesearch.com/docs/quickstart/

This guide sends one question to several research providers, waits for them, and reads their cited reports. You’ll need a Deeper Research account with a few dollars of credit. You see the exact estimate before anything is charged.

Tip

Using Claude Code, Cursor or another coding agent? You don’t need the API: [connect the MCP server](https://deeperesearch.com/docs/mcp/clients/) instead.

1. ### Create an API key

   In the web app, open [Settings → API keys](https://deeperesearch.com/app/settings/api-keys) and create a key. It starts with `dr_live_` and is shown only once. Keep it in an environment variable:

   ```bash
   export DEEPER_RESEARCH_API_KEY="dr_live_..."
   ```

   If you don’t have credit yet, add some in [Settings → Billing](https://deeperesearch.com/app/settings/billing).

2. ### Check the key

   ```bash
   curl https://deeperesearch.com/v1/credits \
     -H "Authorization: Bearer $DEEPER_RESEARCH_API_KEY"
   ```

   ```json
   { "available_usd": 25, "held_usd": 0, "debt_usd": 0 }
   ```

   A `401` means the key is wrong or was revoked.

3. ### Estimate the cost

   Pick providers with a preset (`fast`, `balanced` or `thorough`), or list them yourself from [`GET /v1/vendors`](https://deeperesearch.com/docs/api/reference/operations/listvendors/). Estimating is free:

   ```bash
   curl https://deeperesearch.com/v1/research/estimate \
     -H "Authorization: Bearer $DEEPER_RESEARCH_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{ "vendors": "fast" }'
   ```

   The response lists each provider’s low, expected and worst-case price. `total.hold_usd` is the worst case: the most this research can cost.

4. ### Start the research

   Set `max_cost_usd` to at least `total.hold_usd`, so the request is refused rather than run if prices change. The `Idempotency-Key` header makes retries safe: sending the same key again returns the same research instead of starting (and charging) a second one.

   ```bash
   curl https://deeperesearch.com/v1/research \
     -H "Authorization: Bearer $DEEPER_RESEARCH_API_KEY" \
     -H "Content-Type: application/json" \
     -H "Idempotency-Key: quickstart-1" \
     -d '{
       "query": "Which Postgres-backed job queues for Node.js are production-ready in 2026, and how do they compare?",
       "vendors": "fast",
       "max_cost_usd": 5
     }'
   ```

   The response comes back at once with status `202` and the research `id`. Each provider now works on the question in parallel, which takes a few minutes.

5. ### Wait for it to finish

   Check the research every 15–30 seconds until `status` is `completed`, `failed` or `cancelled`:

   ```bash
   curl https://deeperesearch.com/v1/research/RESEARCH_ID \
     -H "Authorization: Bearer $DEEPER_RESEARCH_API_KEY"
   ```

   Each entry in `runs` shows one provider’s state. Research is `completed` once its providers have finished and at least one delivered a report; `charged_usd` then shows what it actually cost. In production, use [webhooks](https://deeperesearch.com/docs/api/webhooks/) instead of polling.

6. ### Read the reports

   ```bash
   curl https://deeperesearch.com/v1/research/RESEARCH_ID/reports \
     -H "Authorization: Bearer $DEEPER_RESEARCH_API_KEY"
   ```

   Each report has the provider’s write-up in `body_markdown`, citing sources as `[1]`, `[2]` and so on, and the matching `citations` with URL, title and domain. The same research is in your library in the web app.

## The whole thing in code

- JavaScript

  research.mjs

  ```js
  // Node 18+ or any runtime with fetch.
  const API = "https://deeperesearch.com/v1";
  const headers = {
    Authorization: `Bearer ${process.env.DEEPER_RESEARCH_API_KEY}`,
    "Content-Type": "application/json",
  };


  async function api(method, path, body, extraHeaders = {}) {
    const res = await fetch(`${API}${path}`, {
      method,
      headers: { ...headers, ...extraHeaders },
      body: body ? JSON.stringify(body) : undefined,
    });
    const json = await res.json();
    if (!res.ok) throw new Error(`${json.error.code}: ${json.error.message}`);
    return json;
  }


  const vendors = "fast";
  const estimate = await api("POST", "/research/estimate", { vendors });
  console.log(`Expected $${estimate.total.expected_usd}, at most $${estimate.total.hold_usd}`);


  const research = await api(
    "POST",
    "/research",
    {
      query: "Which Postgres-backed job queues for Node.js are production-ready in 2026, and how do they compare?",
      vendors,
      max_cost_usd: estimate.total.hold_usd,
    },
    { "Idempotency-Key": crypto.randomUUID() },
  );


  let current = research;
  while (!["completed", "failed", "cancelled"].includes(current.status)) {
    await new Promise((r) => setTimeout(r, 20_000));
    current = await api("GET", `/research/${research.id}`);
    console.log(current.runs.map((r) => `${r.vendor}: ${r.state}`).join(", "));
  }


  const { data: reports } = await api("GET", `/research/${research.id}/reports`);
  for (const report of reports) {
    console.log(`\n## ${report.vendor} (${report.citations.length} sources)\n`);
    console.log(report.body_markdown);
  }
  console.log(`\nCharged $${current.charged_usd}`);
  ```

- Python

  research.py

  ```python
  # pip install requests
  import os, time, uuid
  import requests


  API = "https://deeperesearch.com/v1"
  session = requests.Session()
  session.headers["Authorization"] = f"Bearer {os.environ['DEEPER_RESEARCH_API_KEY']}"


  def api(method, path, body=None, headers=None):
      res = session.request(method, API + path, json=body, headers=headers)
      data = res.json()
      if not res.ok:
          raise RuntimeError(f"{data['error']['code']}: {data['error']['message']}")
      return data


  vendors = "fast"
  estimate = api("POST", "/research/estimate", {"vendors": vendors})
  print(f"Expected ${estimate['total']['expected_usd']}, at most ${estimate['total']['hold_usd']}")


  research = api(
      "POST",
      "/research",
      {
          "query": "Which Postgres-backed job queues for Node.js are production-ready in 2026, and how do they compare?",
          "vendors": vendors,
          "max_cost_usd": estimate["total"]["hold_usd"],
      },
      headers={"Idempotency-Key": str(uuid.uuid4())},
  )


  current = research
  while current["status"] not in ("completed", "failed", "cancelled"):
      time.sleep(20)
      current = api("GET", f"/research/{research['id']}")
      print(", ".join(f"{r['vendor']}: {r['state']}" for r in current["runs"]))


  for report in api("GET", f"/research/{research['id']}/reports")["data"]:
      print(f"\n## {report['vendor']} ({len(report['citations'])} sources)\n")
      print(report["body_markdown"])
  print(f"\nCharged ${current['charged_usd']}")
  ```

## Next steps

- [Merge the reports](https://deeperesearch.com/docs/api/merges/) into one cited synthesis, and see where providers agree and disagree.
- [Attach files](https://deeperesearch.com/docs/api/files/), such as a spec or a PDF, for providers to read with the question.
- [Get a webhook](https://deeperesearch.com/docs/api/webhooks/) when research finishes, instead of polling.
- Browse every endpoint in the [API reference](https://deeperesearch.com/docs/api/reference/).
