> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stophy.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get an API key, install the SDK and run your first Stophy search from cURL, TypeScript or Python. To have a coding agent do it, use the Agent quickstart.

Get a key, install a client and run your first search. To have your coding agent do it, use the [Agent quickstart](https://docs.stophy.dev/agent-quickstart.md).

## 1. Get an API key

Sign up at [stophy.dev/signup](https://stophy.dev/signup), create a key and set it in your server's environment. [Get credentials](https://docs.stophy.dev/get-credentials.md) has every way to get one, including from an agent.

```bash theme={null}
export STOPHY_API_KEY="<your key>"
```

## 2. Install a client

```bash TypeScript theme={null}
npm install stophy
```

```bash Python theme={null}
pip install stophy
```

Both [SDKs](https://docs.stophy.dev/sdks.md) read `STOPHY_API_KEY`. cURL needs nothing.

## 3. Search the web

This request returns the top three web results for `bun runtime`.

```bash cURL theme={null}
curl -X POST https://api.stophy.dev/v1/search \
  -H "Authorization: Bearer $STOPHY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "bun runtime", "limit": 3 }'
```

```typescript TypeScript theme={null}
import { Stophy } from "stophy";

const stophy = new Stophy();
const { data } = await stophy.search({ query: "bun runtime", limit: 3 });
console.log(data?.web?.map((result) => result.url));
```

```python Python theme={null}
from stophy import Stophy

stophy = Stophy()
body = stophy.search(query="bun runtime", limit=3)
print([result["url"] for result in body["data"]["web"]])
```

`data.web` holds the ranked results, each with `url`, `title`, `description` and `position`. Empty fields are left out. The `x-cost-usd` header is what the call cost.

```json theme={null}
{
  "success": true,
  "data": {
    "web": [
      { "url": "https://en.wikipedia.org/wiki/Bun_(software)", "title": "Bun (software) - Wikipedia", "position": 1 },
      { "url": "https://github.com/oven-sh/bun", "position": 2, "category": "github" }
    ]
  }
}
```

A failed call returns `success: false`, an `error` that says what to do next and a `code`, and costs nothing. See [Errors](https://docs.stophy.dev/api-reference/errors.md).

## Next

* [Choose an API](https://docs.stophy.dev/introduction.md#choose-an-api) for scrape, crawl, extract, browsers and the rest.
* [Search](https://docs.stophy.dev/search/overview) for sources, filters and reading result pages.
* [Production checklist](https://docs.stophy.dev/production/checklist.md) before you ship.


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