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

# Quickstart: your first API call

> Get an API key and make your first Hydrafetch call in under a minute, with curl, Node or Python. Scrape a page and read the clean markdown that comes back.

## Let your agent set it up

If you code with an agent, give it this prompt instead of reading on. It reads our endpoint list, looks at your project and makes the first call itself.

```text Prompt theme={null}
Read https://hydrafetch.com/agents.md and set up Hydrafetch in this project.

Use the HYDRAFETCH_API_KEY environment variable, never a hardcoded key. Then make one scrape call against a URL that is relevant to what this project does, and show me the markdown it returns and what it cost.
```

> [!TIP]
>
> Want to know where Hydrafetch fits in an existing codebase? Use [this prompt](https://hydrafetch.com/#where-it-fits) instead. It reads the repository and lists the scraping code we would replace, with file paths and a credit estimate.

## 1. Get your API key

Sign up at [app.hydrafetch.com](https://app.hydrafetch.com) and verify your email. Your workspace comes with a key ready to copy and 500 free credits for 30 days. The key starts with `hf_`. Treat it like a password.

## 2. Scrape your first page

Send a URL to `/v1/web/scrape` with your key in the `X-API-Key` header. You get clean Markdown back by default.

```bash cURL theme={null}
curl -X POST https://api.hydrafetch.com/v1/web/scrape \
  -H "X-API-Key: hf_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com" }'
```

```javascript Node theme={null}
const res = await fetch("https://api.hydrafetch.com/v1/web/scrape", {
  method: "POST",
  headers: {
    "X-API-Key": "hf_your_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ url: "https://example.com" }),
});
const { data } = await res.json();
console.log(data.markdown);
```

```python Python theme={null}
import requests

res = requests.post(
    "https://api.hydrafetch.com/v1/web/scrape",
    headers={"X-API-Key": "hf_your_key_here"},
    json={"url": "https://example.com"},
)
print(res.json()["data"]["markdown"])
```

Prefer a library? There are [SDKs](https://docs.hydrafetch.com/sdks.md) for Node, Python, Go, Rust, Ruby and PHP.

## 3. Read the response

A scrape returns the page, what the page says about itself, how far to trust the result, and what the call cost:

```json theme={null}
{
  "data": {
    "url": "https://example.com",
    "finalUrl": "https://example.com/",
    "redirected": false,
    "status": 200,
    "cached": false,
    "metadata": {
      "title": "Example Domain",
      "pageType": "article",
      "wordCount": 19,
      "description": "Illustrative examples in documents.",
      "language": "en",
      "author": null,
      "siteName": null,
      "publishedTime": null,
      "modifiedTime": null,
      "image": null
    },
    "quality": { "confidence": 0.94, "complete": true, "blocked": false },
    "usage": { "creditsUsed": 1, "creditsRemaining": 499, "freshness": "fresh" },
    "markdown": "# Example Domain\n\nThis domain is for use in illustrative examples..."
  }
}
```

* `markdown` is the page's content, cleaned of navigation and boilerplate.
* `metadata` is what the page declares about itself. A field the page does not publish is `null`.
* `quality` says how far to trust the result. See [Extraction quality](https://docs.hydrafetch.com/concepts/quality.md).
* `usage` is what the call cost and what is left. `freshness` is `cache` when the page came from a recent copy, which costs the same.

## 4. Ask for more

Add [formats](https://docs.hydrafetch.com/concepts/formats.md) to get more than Markdown in the same call:

```bash theme={null}
curl -X POST https://api.hydrafetch.com/v1/web/scrape \
  -H "X-API-Key: hf_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "formats": ["markdown", "links", "structured"]
  }'
```

## Next steps

> [card] [Authentication](https://docs.hydrafetch.com/authentication.md)
>
> Keys, workspaces and what happens when a key is wrong.

> [card] [Formats](https://docs.hydrafetch.com/concepts/formats.md)
>
> Markdown, structured data, links, summaries and more.

> [card] [Crawl a whole site](https://docs.hydrafetch.com/endpoints/crawl.md)
>
> Go from one page to every page.

> [card] [API Reference](https://docs.hydrafetch.com/api-reference)
>
> Every endpoint, with a live playground.


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