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

# Quickstart

> Extract structured data from any website in minutes with Wetrocloud's Data Extraction API

<Note>
  Before you begin!<br />
  Visit the [Wetrocloud console](https://wetrocloud.com/console) to get your API key. If you have trouble obtaining it, refer to this [guide](/how-to-access-your-API-Key).
</Note>

## Introduction

This quickstart guide will show you how to extract structured data from any website using the Wetrocloud API. In just a few minutes, you'll be able to:

* Extract data from any URL
* Define your own JSON schema for structured output
* Use AI-powered prompts to specify what data to extract

**Prerequisites:**

* An API key from the [Wetrocloud Console](https://wetrocloud.com/console)

## Your First Data Extraction

Let's extract billionaire names and net worth from a news article.

<Steps>
  <Step title="Make Your First Request">
    Extract structured data from a website by providing a link, prompt, and JSON schema.

    <CodeGroup>
      ```python Python theme={null}
      import requests
      import json

      url = "https://api.wetrocloud.com/v1/extract/"

      headers = {
          "Content-Type": "application/json",
          "Authorization": "Token <api_key>"
      }

      payload = {
          "link": "https://theweek.com/news/people/954994/billionaires-richest-person-in-the-world",
          "prompt": "Extract the names and networth of Billionares in the article",
          "json_schema": [
              {"name": "string"},
              {"networth": "number"}
          ],
          "delay": 2
      }

      response = requests.post(url, headers=headers, data=json.dumps(payload))
      print(response.json())
      ```

      ```javascript JavaScript theme={null}
      const url = "https://api.wetrocloud.com/v1/extract/";

      const headers = {
        "Content-Type": "application/json",
        "Authorization": "Token <api_key>"
      };

      const payload = {
        link: "https://theweek.com/news/people/954994/billionaires-richest-person-in-the-world",
        prompt: "Extract the names and networth of Billionares in the article",
        json_schema: [
          { name: "string" },
          { networth: "number" }
        ],
        delay: 2
      };

      fetch(url, {
        method: "POST",
        headers: headers,
        body: JSON.stringify(payload)
      })
        .then(response => response.json())
        .then(data => console.log(data))
        .catch(error => console.error("Error:", error));
      ```

      ```bash cURL theme={null}
      curl --location 'https://api.wetrocloud.com/v1/extract/' \
        --header 'Content-Type: application/json' \
        --header 'Authorization: Token <api_key>' \
        --data '{
          "link": "https://theweek.com/news/people/954994/billionaires-richest-person-in-the-world",
          "prompt": "Extract the names and networth of Billionares in the article",
          "json_schema": [
            {"name": "string"},
            {"networth": "number"}
          ],
          "delay": 2
        }'
      ```
    </CodeGroup>
  </Step>

  <Step title="Understanding the Response">
    The API returns a structured JSON response matching your schema:

    ```json theme={null}
    {
      "response": [
        {
          "name": "Elon Musk",
          "networth": "$462 billion"
        },
        {
          "name": "Larry Ellison",
          "networth": "$340 billion"
        },
        {
          "name": "Mark Zuckerberg",
          "networth": "$258 billion"
        },
        {
          "name": "Jeff Bezos",
          "networth": "$244 billion"
        },
        {
          "name": "Larry Page",
          "networth": "$221 billion"
        },
        {
          "name": "Sergey Brin",
          "networth": "$207 billion"
        },
        {
          "name": "Bernard Arnault",
          "networth": "$197 billion"
        },
        {
          "name": "Steve Ballmer",
          "networth": "$179 billion"
        },
        {
          "name": "Jensen Huang",
          "networth": "$158 billion"
        },
        {
          "name": "Michael Dell",
          "networth": "$156 billion"
        }
      ],
      "success": true
    }
    ```

    | Field      | Description                                         |
    | ---------- | --------------------------------------------------- |
    | `response` | Array of extracted data matching your JSON schema   |
    | `success`  | Boolean indicating if the extraction was successful |
  </Step>

  <Step title="Try Different Schemas or Plain Text">
    You can customize the JSON schema to extract different types of data, or omit it entirely for plain text responses.

    <Info>
      **Pro tip:** The `json_schema` parameter is optional. Omit it to get a plain text response instead of structured JSON.
    </Info>

    Here are some examples:

    **Extract product information:**

    <CodeGroup>
      ```python Python theme={null}
      import requests
      import json

      url = "https://api.wetrocloud.com/v1/extract/"

      headers = {
          "Content-Type": "application/json",
          "Authorization": "Token <api_key>"
      }

      payload = {
          "link": "https://example.com/products",
          "prompt": "Extract all product details",
          "json_schema": [
              {"product_name": "string"},
              {"price": "number"},
              {"rating": "number"}
          ]
      }

      response = requests.post(url, headers=headers, data=json.dumps(payload))
      print(response.json())
      ```

      ```javascript JavaScript theme={null}
      const payload = {
        link: "https://example.com/products",
        prompt: "Extract all product details",
        json_schema: [
          { product_name: "string" },
          { price: "number" },
          { rating: "number" }
        ]
      };

      fetch("https://api.wetrocloud.com/v1/extract/", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "Authorization": "Token <api_key>"
        },
        body: JSON.stringify(payload)
      })
        .then(response => response.json())
        .then(data => console.log(data));
      ```

      ```bash cURL theme={null}
      curl --location 'https://api.wetrocloud.com/v1/extract/' \
        --header 'Content-Type: application/json' \
        --header 'Authorization: Token <api_key>' \
        --data '{
          "link": "https://example.com/products",
          "prompt": "Extract all product details",
          "json_schema": [
            {"product_name": "string"},
            {"price": "number"},
            {"rating": "number"}
          ]
        }'
      ```
    </CodeGroup>

    **Extract contact information:**

    <CodeGroup>
      ```python Python theme={null}
      import requests
      import json

      url = "https://api.wetrocloud.com/v1/extract/"

      headers = {
          "Content-Type": "application/json",
          "Authorization": "Token <api_key>"
      }

      payload = {
          "link": "https://example.com/contact",
          "prompt": "Extract contact details",
          "json_schema": [
              {"name": "string"},
              {"email": "string"},
              {"phone": "string"}
          ]
      }

      response = requests.post(url, headers=headers, data=json.dumps(payload))
      print(response.json())
      ```

      ```javascript JavaScript theme={null}
      const payload = {
        link: "https://example.com/contact",
        prompt: "Extract contact details",
        json_schema: [
          { name: "string" },
          { email: "string" },
          { phone: "string" }
        ]
      };

      fetch("https://api.wetrocloud.com/v1/extract/", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "Authorization": "Token <api_key>"
        },
        body: JSON.stringify(payload)
      })
        .then(response => response.json())
        .then(data => console.log(data));
      ```

      ```bash cURL theme={null}
      curl --location 'https://api.wetrocloud.com/v1/extract/' \
        --header 'Content-Type: application/json' \
        --header 'Authorization: Token <api_key>' \
        --data '{
          "link": "https://example.com/contact",
          "prompt": "Extract contact details",
          "json_schema": [
            {"name": "string"},
            {"email": "string"},
            {"phone": "string"}
          ]
        }'
      ```
    </CodeGroup>

    **Get plain text response (without json\_schema):**

    <CodeGroup>
      ```python Python theme={null}
      import requests
      import json

      url = "https://api.wetrocloud.com/v1/extract/"

      headers = {
          "Content-Type": "application/json",
          "Authorization": "Token <api_key>"
      }

      payload = {
          "link": "https://theweek.com/news/people/954994/billionaires-richest-person-in-the-world",
          "prompt": "Extract the names and networth of Billionares in the article"
      }

      response = requests.post(url, headers=headers, data=json.dumps(payload))
      print(response.json())
      ```

      ```javascript JavaScript theme={null}
      const payload = {
        link: "https://theweek.com/news/people/954994/billionaires-richest-person-in-the-world",
        prompt: "Extract the names and networth of Billionares in the article"
      };

      fetch("https://api.wetrocloud.com/v1/extract/", {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          "Authorization": "Token <api_key>"
        },
        body: JSON.stringify(payload)
      })
        .then(response => response.json())
        .then(data => console.log(data));
      ```

      ```bash cURL theme={null}
      curl --location 'https://api.wetrocloud.com/v1/extract/' \
        --header 'Content-Type: application/json' \
        --header 'Authorization: Token <api_key>' \
        --data '{
          "link": "https://theweek.com/news/people/954994/billionaires-richest-person-in-the-world",
          "prompt": "Extract the names and networth of Billionares in the article"
        }'
      ```
    </CodeGroup>

    **Response:**

    ```json theme={null}
    {
      "response": "Here are the names and net worths of the billionaires...\n\n1. **Elon Musk:** $462 billion\n2. **Larry Ellison:** $340 billion...",
      "success": true
    }
    ```
  </Step>
</Steps>

## Next Steps

Great! You've successfully extracted structured data from a website.

Now you can:

* Learn more about the [Data Extraction API](/endpoint-explanations/data-extraction) and all available parameters
* Explore the complete [API Reference](/api-reference/introduction)
* Check out advanced features like custom delays and complex schemas

<Info>
  **Need help?** Email us at [hello@wetrocloud.com](mailto:hello@wetrocloud.com)
</Info>
