Skip to main content
Before you begin!
Visit the Wetrocloud console to get your API key. If you have trouble obtaining it, refer to this guide.

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:

Your First Data Extraction

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

Make Your First Request

Extract structured data from a website by providing a link, prompt, and JSON schema.
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())
2

Understanding the Response

The API returns a structured JSON response matching your schema:
{
  "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
}
FieldDescription
responseArray of extracted data matching your JSON schema
successBoolean indicating if the extraction was successful
3

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.
Pro tip: The json_schema parameter is optional. Omit it to get a plain text response instead of structured JSON.
Here are some examples:Extract product information:
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())
Extract contact information:
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())
Get plain text response (without json_schema):
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())
Response:
{
  "response": "Here are the names and net worths of the billionaires...\n\n1. **Elon Musk:** $462 billion\n2. **Larry Ellison:** $340 billion...",
  "success": true
}

Next Steps

Great! You’ve successfully extracted structured data from a website. Now you can:
  • Learn more about the Data Extraction API and all available parameters
  • Explore the complete API Reference
  • Check out advanced features like custom delays and complex schemas
Need help? Email us at [email protected]