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

# Quickstart

> Sign up, generate a key, and pull structured JSON from any URL in under a minute.

Zero to your first SmartScraper response. If you'd rather read code, the [Introduction](/docs/) has copy-paste examples for all three products on one page.

<Steps>
  <Step title="Create an account">
    Sign up at [webscrape.ai/app/signup](https://webscrape.ai/app/signup). New accounts start with **500 credits** — enough for 100 SmartScraper calls or 500 raw fetches.
  </Step>

  <Step title="Generate an API key">
    Open [API Keys](https://webscrape.ai/app/api-keys) in the dashboard and click **Generate**. Copy the key right away — it starts with `wsg_live_` and we only show the full secret once. You can revoke it whenever.
  </Step>

  <Step title="Make your first call">
    Fetch any page and extract structured data with one HTTP request:

    <CodeGroup>
      ```bash cURL theme={null}
      curl https://api.webscrape.ai/v1/smartscraper \
        -H "X-API-Key: wsg_live_..." \
        -H "Content-Type: application/json" \
        -d '{
          "website_url": "https://news.ycombinator.com",
          "user_prompt": "Extract the front-page stories with title, url, and score.",
          "output_schema": {
            "type": "object",
            "properties": {
              "stories": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "title": {"type": "string"},
                    "url":   {"type": "string"},
                    "score": {"type": "integer"}
                  }
                }
              }
            }
          }
        }'
      ```

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

      resp = requests.post(
          "https://api.webscrape.ai/v1/smartscraper",
          headers={"X-API-Key": "wsg_live_..."},
          json={
              "website_url": "https://news.ycombinator.com",
              "user_prompt": "Extract the front-page stories with title, url, and score.",
              "output_schema": {
                  "type": "object",
                  "properties": {
                      "stories": {
                          "type": "array",
                          "items": {
                              "type": "object",
                              "properties": {
                                  "title": {"type": "string"},
                                  "url":   {"type": "string"},
                                  "score": {"type": "integer"},
                              },
                          },
                      }
                  },
              },
          },
          timeout=120,
      )
      print(resp.json())
      ```

      ```js Node theme={null}
      const resp = await fetch("https://api.webscrape.ai/v1/smartscraper", {
        method: "POST",
        headers: {
          "X-API-Key": "wsg_live_...",
          "Content-Type": "application/json",
        },
        body: JSON.stringify({
          website_url: "https://news.ycombinator.com",
          user_prompt: "Extract the front-page stories with title, url, and score.",
          output_schema: {
            type: "object",
            properties: {
              stories: {
                type: "array",
                items: {
                  type: "object",
                  properties: {
                    title: { type: "string" },
                    url:   { type: "string" },
                    score: { type: "integer" },
                  },
                },
              },
            },
          },
        }),
      });
      console.log(await resp.json());
      ```

      ```go Go theme={null}
      package main

      import (
          "bytes"
          "encoding/json"
          "fmt"
          "io"
          "net/http"
      )

      func main() {
          body, _ := json.Marshal(map[string]any{
              "website_url": "https://news.ycombinator.com",
              "user_prompt": "Extract the front-page stories with title, url, and score.",
              "output_schema": map[string]any{
                  "type": "object",
                  "properties": map[string]any{
                      "stories": map[string]any{
                          "type": "array",
                          "items": map[string]any{
                              "type": "object",
                              "properties": map[string]any{
                                  "title": map[string]string{"type": "string"},
                                  "url":   map[string]string{"type": "string"},
                                  "score": map[string]string{"type": "integer"},
                              },
                          },
                      },
                  },
              },
          })

          req, _ := http.NewRequest("POST", "https://api.webscrape.ai/v1/smartscraper", bytes.NewReader(body))
          req.Header.Set("X-API-Key", "wsg_live_...")
          req.Header.Set("Content-Type", "application/json")

          resp, _ := http.DefaultClient.Do(req)
          defer resp.Body.Close()
          out, _ := io.ReadAll(resp.Body)
          fmt.Println(string(out))
      }
      ```

      ```rust Rust theme={null}
      use serde_json::json;

      #[tokio::main]
      async fn main() -> Result<(), Box<dyn std::error::Error>> {
          let body = json!({
              "website_url": "https://news.ycombinator.com",
              "user_prompt": "Extract the front-page stories with title, url, and score.",
              "output_schema": {
                  "type": "object",
                  "properties": {
                      "stories": {
                          "type": "array",
                          "items": {
                              "type": "object",
                              "properties": {
                                  "title": {"type": "string"},
                                  "url":   {"type": "string"},
                                  "score": {"type": "integer"}
                              }
                          }
                      }
                  }
              }
          });

          let resp = reqwest::Client::new()
              .post("https://api.webscrape.ai/v1/smartscraper")
              .header("X-API-Key", "wsg_live_...")
              .json(&body)
              .send()
              .await?;

          println!("{}", resp.text().await?);
          Ok(())
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Inspect the response">
    A successful call comes back wrapped in the standard envelope:

    ```json theme={null}
    {
      "status": "completed",
      "data": {
        "result": {
          "stories": [
            { "title": "Show HN: ...", "url": "https://...", "score": 312 }
          ]
        },
        "latency_ms": 1842
      },
      "credits_used": 5,
      "credits_remaining": 495,
      "request_id": "req_aB3xY9Kp"
    }
    ```

    Your extracted data is at `data.result`. The `request_id` also comes back as the `X-Request-ID` response header — hold on to it so support can trace a specific call. See [Errors](/docs/concepts/errors) for the queued and error envelope shapes.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Pick the right product" icon="compass" href="/docs/concepts/products">
    SmartScraper isn't always the answer. Compare the three.
  </Card>

  <Card title="Credits & pricing" icon="coins" href="/docs/concepts/credits">
    Per-endpoint costs and stealth surcharges.
  </Card>

  <Card title="Stealth mode" icon="user-secret" href="/docs/concepts/stealth-mode">
    When to set `stealth: true` and what it costs.
  </Card>

  <Card title="API reference" icon="code" href="/docs/api-reference/introduction">
    Full request and response schemas for every endpoint.
  </Card>
</CardGroup>
