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

# Quickstart

> Make your first scrape in under a minute.

## Prerequisites

* An API key from the [dashboard](https://tallyscrape.com) (starts with `spy_`).
* A prepaid credit balance — see [Credits](/credits).

Authentication is a single header on every request:

```
X-API-Key: spy_your_api_key
```

## Your first scrape

Send a `POST /scrape` request with a target URL. This example also extracts the book
titles on the page using a CSS selector.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://api.tallyscrape.com/scrape \
    -H "X-API-Key: spy_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://books.toscrape.com",
      "engine": "static",
      "selectors": { "titles": "h3 a" }
    }'
  ```

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

  resp = requests.post(
      "https://api.tallyscrape.com/scrape",
      headers={"X-API-Key": "spy_your_api_key"},
      json={
          "url": "https://books.toscrape.com",
          "engine": "static",
          "selectors": {"titles": "h3 a"},
      },
  )
  data = resp.json()
  print(data["title"], data["elapsed_ms"], "ms")
  print(data["extracted"]["titles"])
  ```

  ```javascript JavaScript theme={null}
  const resp = await fetch("https://api.tallyscrape.com/scrape", {
    method: "POST",
    headers: {
      "X-API-Key": "spy_your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      url: "https://books.toscrape.com",
      engine: "static",
      selectors: { titles: "h3 a" },
    }),
  });
  const data = await resp.json();
  console.log(data.title, data.elapsed_ms, "ms");
  console.log(data.extracted.titles);
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.*;

  var body = """
      {"url":"https://books.toscrape.com","engine":"static","selectors":{"titles":"h3 a"}}
      """;

  var request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.tallyscrape.com/scrape"))
      .header("X-API-Key", "spy_your_api_key")
      .header("Content-Type", "application/json")
      .POST(HttpRequest.BodyPublishers.ofString(body))
      .build();

  var response = HttpClient.newHttpClient()
      .send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```
</CodeGroup>

## The response

You get structured JSON back. `elapsed_ms` is the billing basis; `success` and `blocked`
tell you whether the scrape is reliable.

```json theme={null}
{
  "url": "https://books.toscrape.com",
  "final_url": "https://books.toscrape.com/",
  "status_code": 200,
  "success": true,
  "engine": "static",
  "elapsed_ms": 412,
  "error": null,
  "blocked": false,
  "proxy_used": false,
  "title": "All products | Books to Scrape - Sandbox",
  "meta": { "description": "..." },
  "headings": { "h1": ["All products"] },
  "links": [{ "text": "Home", "href": "https://books.toscrape.com/index.html" }],
  "images": ["https://books.toscrape.com/media/cache/..."],
  "text": "Books to Scrape ...",
  "extracted": {
    "titles": ["A Light in the Attic", "Tipping the Velvet", "Soumission"]
  }
}
```

<Tip>
  Need a page that renders with JavaScript? Set `"engine": "js"` to run it in a real
  headless browser. It costs more credits — see [Pricing](/pricing).
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="POST /scrape reference" icon="code" href="/endpoints/scrape">
    Every parameter and response field.
  </Card>

  <Card title="Errors" icon="triangle-exclamation" href="/errors">
    Status codes and how to handle them.
  </Card>
</CardGroup>
