Skip to main content

Endpoints

EndpointMethodDescription
/v1/extract/POSTExtract structured data from any website using AI-powered extraction with custom JSON schemas.

Data Extraction Endpoint

POST /v1/extract/

Extract specific information from any web page and receive it in a structured JSON format that matches your requirements. Request Parameters:
ParameterTypeRequiredDescription
linkStringYesThe URL of the website to extract data from
promptStringYesInstructions describing what data to extract
json_schemaArrayNoThe structure defining your desired output format. If not provided, returns plain text
delayIntegerNoDelay in seconds before extraction (useful for dynamic content). Default: 0
Example Request:
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())
Response Format (Structured Output):
{
  "response": [
    {
      "name": "Elon Musk",
      "networth": "$462 billion"
    },
    {
      "name": "Larry Ellison",
      "networth": "$340 billion"
    }
    // ... more results
  ],
  "success": true
}
Response Format (Plain Text - when json_schema is omitted):
{
  "response": "Here are the names and net worths of the billionaires listed in the article:\n\n1. **Elon Musk:** $462 billion\n2. **Larry Ellison:** $340 billion...",
  "success": true
}
FieldTypeDescription
responseArray or StringExtracted data matching your JSON schema (array) or plain text (string) if no schema provided
successBooleanIndicates whether the extraction was successful
Status Codes:
  • 200 OK - Request successful
  • 400 Bad Request - Invalid parameters or malformed JSON schema
  • 401 Unauthorized - Invalid or missing API key
  • 404 Not Found - URL not accessible
Error Response:
{
  "error": "Error message describing what went wrong",
  "success": false
}