Web Scraping
AI Extraction
Extract structured data from any webpage using AI — no selectors needed.
POST
$0.03/call/v1/scrape/ai-extractUsage
const res = await fetch('https://api.yepapi.com/v1/scrape/ai-extract', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://example.com/product/123',
prompt: 'Extract the product name, price, and description',
}),
});
const { data } = await res.json();
console.log(data.extracted);curl -X POST https://api.yepapi.com/v1/scrape/ai-extract \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/product/123", "prompt": "Extract product name, price, and description"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
url | string | Yes | URL to extract data from | — |
prompt | string | Yes | What data to extract | — |
schema | object | No | JSON Schema for structured output | — |
Info
Pass a schema object for strongly typed responses. Without it, the AI will infer the best structure.
Response
{
"ok": true,
"data": {
"url": "https://example.com/product/123",
"extracted": {
"productName": "Wireless Headphones Pro",
"price": 149.99,
"currency": "USD",
"description": "Premium noise-cancelling wireless headphones with 30-hour battery life"
}
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data | object | Response payload |
data.url | string | The URL that was scraped |
data.extracted | object | AI-extracted structured data. Fields are determined by your prompt or schema |
Under the Hood
This combines our scraping infrastructure with AI extraction. Perfect for building data pipelines without writing CSS selectors.