Extract structured fields from a web page using a CSS selector schema.
Endpoint
/v1/web/extract
No parameters for this endpoint.
const response = await fetch( "https://api.socialfetch.dev/v1/web/extract", { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": "YOUR_API_KEY" }, body: JSON.stringify({ url: "https://example.com/products", schema: { name: "products", baseSelector: "div.product", fields: [ { name: "name", selector: "h2", type: "text" }, { name: "price", selector: ".price", type: "text" } ] } }) } ); const data = await response.json(); console.log(data);