BuildE2EBuildE2E
DocsStart Free
ScrapingExtract
Extract Endpoint

Extract (Structured Data)

Extract structured data from one or more web pages using AI. Scrapes the provided URLs, combines content, and uses an LLM to return JSON matching your schema.
POST/v1/extract
Scrape URLs and extract structured data using an LLM with schema-constrained output.

Request Body

ParameterTypeDescription
urlsrequired
string[]URLs to extract data from (1-10)
schemarequired
Record<string, any>JSON Schema describing the desired output structure
promptrequired
stringNatural language extraction instruction (e.g., "Extract product name, price, and rating")
type
"html" | "markdown"Content format fed to the LLM. Defaults to "markdown"
proxy
{ country: string }Proxy for geo-targeted requests. See supported countries

Example Request

curl -X POST https://api.builde2e.com/api/v1/extract \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer uc-YOUR-API-KEY' \
  -d '{
    "urls": ["https://example.com/product/laptop-x1"],
    "schema": {
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "price": { "type": "number" },
        "features": { "type": "array", "items": { "type": "string" } }
      }
    },
    "prompt": "Extract the product details from this page"
  }'

Example Response

json
{
  "success": true,
  "data": {
    "products": [
      { "name": "Widget Pro", "price": 29.99, "rating": 4.5 },
      { "name": "Widget Max", "price": 49.99, "rating": 4.8 }
    ]
  },
  "sources": ["https://example.com/product-1", "https://example.com/product-2"],
  "cost": 0.009,
  "timestamp": "2026-03-04T10:15:30.123Z"
}

Response Structure

FieldTypeDescription
successbooleanWhether extraction succeeded
dataanyExtracted structured data matching your schema. null on failure.
sourcesstring[]URLs that were successfully scraped and used for extraction
costnumberCost in USD ($0.002 per successfully scraped URL + $0.005 per extraction)
errorstringError message if extraction failed
timestampstringISO timestamp of the response

Using Zod Schemas — SDK Only

The Node.js SDK supports Zod schemas for type-safe extraction. Pass a Zod schema instead of JSON Schema and get fully typed results.
Node.js
import { z } from 'zod';

const ProductSchema = z.object({
  name: z.string(),
  price: z.number(),
  currency: z.string(),
  features: z.array(z.string()),
  inStock: z.boolean()
});

const result = await BuildE2E.extract({
  urls: ['https://example.com/product/laptop-x1'],
  schema: ProductSchema,
  prompt: 'Extract the product details'
});

// result.data is typed as z.infer<typeof ProductSchema>
console.log(result.data.name);
console.log(result.data.price);

Pricing

Extraction is charged in two parts:
ComponentCost (USD)Description
Per URL scraped$0.002Charged per successfully scraped URL (failed URLs are free)
Per extraction$0.005One-time LLM extraction fee per request
Example: extracting from 2 URLs costs 2 x $$0.002 + $$0.005 = $$0.009.