Skip to content

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.

  1. In the web app, open Settings → API keys and create a key. It starts with dr_live_ and is shown only once. Keep it in an environment variable:

    Terminal window
    export DEEPER_RESEARCH_API_KEY="dr_live_..."

    If you don’t have credit yet, add some in Settings → Billing.

  2. Terminal window
    curl https://deeperesearch.com/v1/credits \
    -H "Authorization: Bearer $DEEPER_RESEARCH_API_KEY"
    { "available_usd": 25, "held_usd": 0, "debt_usd": 0 }

    A 401 means the key is wrong or was revoked.

  3. Pick providers with a preset (fast, balanced or thorough), or list them yourself from GET /v1/vendors. Estimating is free:

    Terminal window
    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. 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.

    Terminal window
    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. Check the research every 15–30 seconds until status is completed, failed or cancelled:

    Terminal window
    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 instead of polling.

  6. Terminal window
    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.

research.mjs
// 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}`);