ИИ-извлечение и структурирование данных с веб-страниц
POST https://api.firecrawl.ru/api/v1/extract
# Вариант 1: X-API-Key заголовок (рекомендуемый) X-API-Key: YOUR_API_KEY # Вариант 2: Bearer токен Authorization: Bearer YOUR_API_KEY # Вариант 3: Query параметр ?api_key=YOUR_API_KEY
curl -X POST https://api.firecrawl.ru/api/v1/extract \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "urls": [ "https://example.com/product1", "https://example.com/product2" ], "prompt": "Извлеките информацию о товаре: название, цену, описание и рейтинг", "schema": { "type": "object", "properties": { "name": {"type": "string"}, "price": {"type": "number"}, "description": {"type": "string"}, "rating": {"type": "number", "minimum": 0, "maximum": 5} }, "required": ["name", "price"] } }'
Show data properties
Show возможная структура
local
cloud
{ "success": true, "url": "https://example.com/product1", "data": { "json": { "results": [ { "url": "https://example.com/product1", "name": "Умный телефон XYZ Pro", "price": 45990, "description": "Флагманский смартфон с тройной камерой и быстрой зарядкой", "rating": 4.7 }, { "url": "https://example.com/product2", "name": "Наушники ABC Wireless", "price": 12990, "description": "Беспроводные наушники с шумоподавлением", "rating": 4.3 } ], "summary": { "totalProducts": 2, "averagePrice": 29490, "averageRating": 4.5 }, "metadata": { "extractedAt": "2024-01-15T14:30:00Z", "processingModel": "gpt-4", "confidence": 0.95 } } }, "source": "local", "processingTime": 4560 }
{ "prompt": "Найдите контактную информацию: телефон, email, адрес компании", "schema": { "type": "object", "properties": { "phone": {"type": "string"}, "email": {"type": "string", "format": "email"}, "address": {"type": "string"} } } }
{ "prompt": "Извлеките информацию о мероприятиях: название, дата, место, цена билета", "schema": { "type": "object", "properties": { "events": { "type": "array", "items": { "type": "object", "properties": { "title": {"type": "string"}, "date": {"type": "string", "format": "date"}, "venue": {"type": "string"}, "price": {"type": "number"} } } } } } }
{ "prompt": "Извлеките основную информацию о статье: заголовок, автор, дата публикации, категория", "schema": { "type": "object", "properties": { "title": {"type": "string"}, "author": {"type": "string"}, "publishedDate": {"type": "string", "format": "date-time"}, "category": {"type": "string"}, "wordCount": {"type": "number"} } } }
{ "success": false, "url": "https://example.com/product1", "data": { "json": {} }, "error": "Не удалось извлечь данные: страница недоступна", "source": "local", "processingTime": 2000 }