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

# Introduction

> Command-line interface for ScrapeGraph AI

`just-scrape` is the official CLI for [ScrapeGraph AI](https://scrapegraphai.com) — AI-powered web scraping, data extraction, search, and crawling, straight from your terminal.

<Note>
  Get your API key from the [dashboard](https://scrapegraphai.com/dashboard)
</Note>

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install -g just-scrape
  ```

  ```bash pnpm theme={null}
  pnpm add -g just-scrape
  ```

  ```bash yarn theme={null}
  yarn global add just-scrape
  ```

  ```bash bun theme={null}
  bun add -g just-scrape
  ```

  ```bash npx (no install) theme={null}
  npx just-scrape --help
  ```

  ```bash bunx (no install) theme={null}
  bunx just-scrape --help
  ```
</CodeGroup>

Package: [just-scrape](https://www.npmjs.com/package/just-scrape) on npm | [GitHub](https://github.com/ScrapeGraphAI/just-scrape)

## Configuration

The CLI needs a ScrapeGraph API key. Four ways to provide it (checked in order):

1. **Environment variable**: `export SGAI_API_KEY="sgai-..."`
2. **`.env` file**: `SGAI_API_KEY=sgai-...` in project root
3. **Config file**: `~/.scrapegraphai/config.json`
4. **Interactive prompt**: the CLI asks and saves to config

### Environment Variables

| Variable       | Description                          | Default                                |
| -------------- | ------------------------------------ | -------------------------------------- |
| `SGAI_API_KEY` | ScrapeGraph API key                  | —                                      |
| `SGAI_API_URL` | Override API base URL                | `https://api.scrapegraphai.com/api/v2` |
| `SGAI_TIMEOUT` | Request timeout in seconds           | `120`                                  |
| `SGAI_DEBUG`   | Set to `1` to log requests/responses | —                                      |

Legacy variables are still bridged transparently: `JUST_SCRAPE_API_URL` → `SGAI_API_URL`, `JUST_SCRAPE_TIMEOUT_S` and `SGAI_TIMEOUT_S` → `SGAI_TIMEOUT`, `JUST_SCRAPE_DEBUG` → `SGAI_DEBUG`.

## Verify your setup

```bash theme={null}
just-scrape credits    # check your credit balance
```

## Quick start

```bash theme={null}
just-scrape extract https://news.ycombinator.com \
  -p "Extract the top 5 story titles and their URLs"
```

<CardGroup cols={2}>
  <Card title="Commands" icon="list" href="/services/cli/commands">
    Full reference for every command and its flags
  </Card>

  <Card title="JSON Mode" icon="brackets-curly" href="/services/cli/json-mode">
    Machine-readable output for scripting and AI agents
  </Card>

  <Card title="AI Agent Skill" icon="robot" href="/services/cli/ai-agent-skill">
    Install just-scrape as a coding agent skill
  </Card>

  <Card title="Examples" icon="code" href="/services/cli/examples">
    Practical examples for every command
  </Card>
</CardGroup>
