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

# Quickstart

> Set up Andi web search and page fetch in your agent or application. One-line agent install, CLI, or manual API key setup.

## Agent quick-start

Your agent installs and configures the Andi Search API itself — paste one line:

```text title="Paste into Claude Code, Cursor, or Codex" theme={null}
Set up Andi search for this project: andiai.com
```

Your agent fetches `andiai.com`, follows it to the [install guide](https://api.andiai.com/install.md) at `api.andiai.com`, then gets an API key from the [API Console](https://console.andiai.com/signup), connects the MCP server, and verifies the setup.

<Note>
  **Are you an AI agent?** Fetch [https://api.andiai.com/install.md](https://api.andiai.com/install.md) and follow it to configure Andi Search — MCP server, API key, and verification.
</Note>

## CLI quick-start

Search from your terminal without writing any code — get a key from the [API Console](https://console.andiai.com/signup), then install the CLI and run it:

```bash theme={null}
export ANDI_API_KEY=YOUR_API_KEY
npm install -g @andiai/cli

andi search "what is RAG"
andi fetch https://en.wikipedia.org/wiki/Retrieval-augmented_generation
```

Or run it without installing:

```bash theme={null}
npx -y @andiai/cli search "what is RAG"
```

See the [CLI guide](/getting-started/cli) for output formats and the local MCP server.

## Manual setup

<Info>You need an API key to follow these steps. Get one from the [API Console](https://console.andiai.com/signup).</Info>

<Steps>
  <Step title="Get your API key">
    Sign in to the [API Console](https://console.andiai.com) and create an API key. Copy it — you'll need it for the next step. See [authentication](/getting-started/authentication) for key management and security practices.
  </Step>

  <Step title="Make your first request">
    Send a search query using the `x-api-key` header:

    <CodeGroup>
      ```bash curl theme={null}
      curl "https://api.andiai.com/api/v1/search?q=what+is+RAG" \
        -H "x-api-key: YOUR_API_KEY"
      ```

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

      response = requests.get(
          "https://api.andiai.com/api/v1/search",
          params={"q": "what is RAG"},
          headers={"x-api-key": "YOUR_API_KEY"}
      )

      data = response.json()
      for result in data["results"]:
          print(result["title"], result["link"])
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch(
        "https://api.andiai.com/api/v1/search?q=what+is+RAG",
        { headers: { "x-api-key": "YOUR_API_KEY" } }
      );

      const data = await response.json();
      data.results.forEach(r => console.log(r.title, r.link));
      ```
    </CodeGroup>
  </Step>

  <Step title="Read the response">
    The API returns a JSON object with top-level fields and a `results` array. Each result includes a `title`, `link`, `desc`, and `source`:

    ```json theme={null}
    {
      "results_type": "Search",
      "answer": "",
      "type": "Search",
      "title": "what is RAG",
      "results": [
        {
          "title": "Retrieval-Augmented Generation (RAG) Explained",
          "link": "https://example.com/rag-explained",
          "desc": "RAG combines a retrieval system with a language model to generate responses grounded in retrieved documents.",
          "source": "example.com"
        }
      ],
      "metrics": {
        "query": "what is RAG",
        "intent": "FallbackSearchIntent",
        "timestamp": "2026-07-14T21:30:00.000Z",
        "duration": 1240,
        "queries_executed": 1,
        "api_requests_count": 1,
        "results_returned": 10,
        "total_results_found": 42,
        "cost_dollars": 0.0031
      }
    }
    ```

    The `metrics.cost_dollars` field shows the amount charged for this request in USD.
  </Step>

  <Step title="Fetch a page">
    The second core endpoint, `/api/v1/fetch`, retrieves a single page as clean extracted content — use it to read a result in full after searching:

    <CodeGroup>
      ```bash curl theme={null}
      curl "https://api.andiai.com/api/v1/fetch?url=https://en.wikipedia.org/wiki/Retrieval-augmented_generation" \
        -H "x-api-key: YOUR_API_KEY"
      ```

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

      response = requests.get(
          "https://api.andiai.com/api/v1/fetch",
          params={"url": "https://en.wikipedia.org/wiki/Retrieval-augmented_generation"},
          headers={"x-api-key": "YOUR_API_KEY"}
      )

      page = response.json()
      print(page["title"], page["word_count"])
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch(
        "https://api.andiai.com/api/v1/fetch?url=" +
          encodeURIComponent("https://en.wikipedia.org/wiki/Retrieval-augmented_generation"),
        { headers: { "x-api-key": "YOUR_API_KEY" } }
      );

      const page = await response.json();
      console.log(page.title, page.word_count);
      ```
    </CodeGroup>

    The response includes the page `title`, extracted `content` and `markdown`, `word_count`, and `metrics.cost_dollars`. Add `format=context` for LLM-ready markdown, or `query=...` for extracts focused on what you want from the page. See [content retrieval](/search/content-retrieval) for the full reference.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Search modes" icon="gauge-high" href="/search/search-modes">
    Automatic effort by default, manual control when you want it.
  </Card>

  <Card title="Build with AI agents" icon="robot" href="/resources/ai-agents">
    Connect via MCP for Claude Code, Cursor, and other tools.
  </Card>

  <Card title="Content retrieval" icon="file-lines" href="/search/content-retrieval">
    Full fetch endpoint reference.
  </Card>

  <Card title="Query parameters" icon="sliders" href="/features/query-parameters">
    Full parameter reference for the search endpoint.
  </Card>
</CardGroup>
