Advanced Usage
Learn advanced features and optimization techniques for Scrapezy
Advanced Usage Guide
This guide covers advanced features and optimization techniques for getting the most out of Scrapezy's API.
Caching and Performance
Using the Cache
By default, Scrapezy caches extraction results to improve performance and reduce costs. You can bypass the cache when needed:
POST https://scrapezy.com/api/extract
Content-Type: application/json
x-api-key: your_api_key
{
"url": "https://example.com/products",
"prompt": "Extract all product information",
"options": {
"bypassCache": true
}
}
Advanced Prompting Techniques
Structured Data Extraction
For complex data structures, be specific about the format you need:
POST https://scrapezy.com/api/extract
Content-Type: application/json
x-api-key: your_api_key
{
"url": "https://example.com/product",
"prompt": "Extract the following product details:\n- Full product name\n- Base price (without currency symbol)\n- Currency used\n- All available color options\n- Technical specifications in a structured format\n- Shipping information including:\n - Available countries\n - Estimated delivery times\n - Shipping costs"
}
Example response:
{
"jobId": "job_abc123",
"status": "completed",
"result": {
"productName": "iPhone 15 Pro",
"basePrice": 999,
"currency": "USD",
"colors": ["Natural Titanium", "Blue Titanium", "White Titanium", "Black Titanium"],
"specifications": {
"display": "6.1-inch Super Retina XDR",
"chip": "A17 Pro",
"camera": "48MP Main",
"storage": ["128GB", "256GB", "512GB", "1TB"]
},
"shipping": {
"availableCountries": ["US", "UK", "CA", "AU"],
"deliveryTimes": {
"US": "1-3 business days",
"International": "5-7 business days"
},
"costs": {
"US": "Free",
"International": "From $20"
}
}
}
}
Contextual Extraction
Provide context in your prompts for more accurate results:
POST https://scrapezy.com/api/extract
Content-Type: application/json
x-api-key: your_api_key
{
"url": "https://example.com/article",
"prompt": "This is a news article. Extract:\n1. The main headline\n2. Author's name and their role if mentioned\n3. Publication date in ISO format\n4. The article's main topic or category\n5. Any quoted sources or experts mentioned\n6. Key statistics or numerical data points"
}
Example response:
{
"jobId": "job_def456",
"status": "completed",
"result": {
"headline": "Global AI Market Expected to Reach $190B by 2025",
"author": {
"name": "Jane Smith",
"role": "Senior Technology Analyst"
},
"publicationDate": "2024-02-14T09:00:00Z",
"category": "Technology",
"quotedSources": [
{
"name": "Dr. John Doe",
"title": "AI Research Director at Tech Institute",
"quote": "AI adoption is accelerating faster than predicted"
}
],
"statistics": [
{
"metric": "Market Size",
"value": 190,
"unit": "billion USD",
"year": 2025
},
{
"metric": "Annual Growth Rate",
"value": 37.3,
"unit": "percent"
}
]
}
}