# Quickstart

Get a cited answer to a research question in under five minutes.

## What you will build

One request that returns a synthesized answer plus the papers it is grounded in, with a page-level
citation for every claim.

## Prerequisites

1. API access — request it with the **Apply for API Access** form, free during public beta
2. Python 3.9+, Node 18+, or just cURL

## Step 1 — get an API key

Use the **Apply for API Access** button at the top of any page and tell us what you are building.
We send your key once the request is approved. Test keys start `sk_test_` and come with 500 free credits a month.

```bash
export SCISPACE_API_KEY=sk_test_your_api_key
```

> [!warning] The key is shown once
> After creation you see only the prefix and last four characters. Store it in your secret manager
> now. See api-keys.

## Step 2 — install the SDK

```bash
# Python
pip install scispace

# TypeScript
npm install scispace

# cURL — nothing to install
```

## Step 3 — run a search

Searches are asynchronous. The SDKs hide the poll loop behind `.wait()`.

```python
from scispace import Scispace

client = Scispace()  # reads SCISPACE_API_KEY

search = client.searches.create(
    query="How does climate change affect biodiversity?",
    depth="standard",
).wait(timeout=60)

print(search.answer.text)
for c in search.answer.citations:
    print(c.index, c.source.title, c.locations[0].page if c.locations else "-")
```

```typescript
import Scispace from "scispace";

const client = new Scispace();

const search = await client.searches
  .create({ query: "How does climate change affect biodiversity?", depth: "standard" })
  .wait({ timeoutMs: 60_000 });

console.log(search.answer.text);
```

```bash
curl https://api.scispace.com/v1/searches \
  -H "Authorization: Bearer $SCISPACE_API_KEY" \
  -H "SciSpace-Version: 2026-08-01" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"query":"How does climate change affect biodiversity?","depth":"standard"}'
```

## Step 4 — read the response

```json
{
  "object": "search",
  "id": "srch_9dm2pq4x1a",
  "status": "succeeded",
  "depth": "standard",
  "paper_count": 20,
  "credits_cost": 5,
  "answer": {
    "object": "answer",
    "text": "Warming interacts with habitat fragmentation to accelerate local extinctions [1].",
    "citations": [
      {
        "index": 1,
        "quote": "Recent studies suggest that warming interacts with habitat fragmentation to accelerate local extinction risk.",
        "source": {
          "type": "paper",
          "id": "pap_3kf9wq2m8x",
          "title": "Climate-driven range shifts and local extinction risk"
        },
        "locations": [
          {
            "page": 4,
            "bbox": {
              "x": 0.14,
              "y": 0.31,
              "width": 0.72,
              "height": 0.04
            }
          }
        ]
      }
    ],
    "unsourced_claim_count": 0
  }
}
```

- `answer.text` carries `[n]` markers matching `citations[].index`
- `locations[].page` is 1-indexed; `bbox` values are fractions of the page — see citation-highlights
- The response headers report `X-Credits-Cost: 5` and `X-Credits-Remaining`

## What just happened

- You created a Search — a resource you can fetch, list, export, and cancel.
- The answer's claims are linked to sources by Citation objects.
- You spent 5 credits, the standard-depth price. See Credit and Depth.

## Next steps

- literature-review-agent — turn this into a real feature
- chats — ask questions about your own PDFs
- concepts-overview — the objects behind the call
