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

# Quickstart

> Get an API key and scrape your first page.

**1. Create an account**

Sign in at [gainflow.ai/dashboard](https://gainflow.ai/dashboard) with Google, GitHub or email. Your account gets 300 free credits.

**2. Create an API key**

In the dashboard, open **API keys** and create one. Copy it right away: keys start with `gf_live_` and are shown only once.

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
export GAINFLOW_API_KEY="gf_live_..."
```

**3. Scrape a page**

```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://api.gainflow.ai/v1/scrape \
  -H "Authorization: Bearer $GAINFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "formats": ["markdown", "links"]}'
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
import os, requests

res = requests.post(
    "https://api.gainflow.ai/v1/scrape",
    headers={"Authorization": f"Bearer {os.environ['GAINFLOW_API_KEY']}"},
    json={"url": "https://example.com", "formats": ["markdown", "links"]},
    timeout=30,
)
res.raise_for_status()
print(res.json()["data"]["markdown"])
```

```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
const res = await fetch("https://api.gainflow.ai/v1/scrape", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.GAINFLOW_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ url: "https://example.com", formats: ["markdown", "links"] }),
})
const { data, meta } = await res.json()
console.log(data.markdown, meta.credits_used)
```

**4. Read the response**

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
{
  "data": {
    "url": "https://example.com",
    "final_url": "https://example.com/",
    "title": "Example Domain",
    "markdown": "# Example Domain\n\nThis domain is for use in documentation examples...",
    "links": [{ "url": "https://iana.org/domains/example", "text": "Learn more" }]
  },
  "meta": {
    "request_id": "req_...",
    "status_code": 200,
    "content_type": "text/html",
    "fetched_at": "2026-11-30T12:00:00Z",
    "cached": false,
    "country": "US",
    "credits_used": 1,
    "duration_ms": 412
  }
}
```

## Pull fields with CSS selectors

Pass `parse` to get named fields instead of reading the whole page. Parsing is free on top of the scrape.

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://api.gainflow.ai/v1/scrape \
  -H "Authorization: Bearer $GAINFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://news.ycombinator.com",
    "parse": { "titles": ".titleline > a", "scores": ".score" }
  }'
```

`data.parsed` comes back as `{ "titles": ["..."], "scores": ["..."] }`.

## Next steps

> [card] [Connect Claude or ChatGPT](https://docs.gainflow.ai/mcp.md)

> [card] [Find every URL on a site](https://docs.gainflow.ai/api-reference/scraping/map-a-site.md)


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