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));