Credit Optimization Guide
Minimize scraping costs by choosing the right tools, implementing smart caching strategies, and optimizing your workflows for maximum value.
Quick Wins (Save 50-80%)
💰 80% cost reduction
fetch_url (1 credit) before scrape_with_actions (5 credits)💰 80% cost reduction for static content
💰 90%+ reduction on repeated requests
⚡ 5x faster throughput
1. Tool Selection Strategy
Always start with the cheapest tool that meets your needs, then upgrade only if necessary.
- 1. Do you know the URL?
- ✅ Yes → Use
fetch_url(1 credit) - ❌ No → Use
search_web(5 credits)
- ✅ Yes → Use
- 2. Is the content in the initial HTML?
- ✅ Yes → Use
fetch_url(1 credit) + parse locally (free) - ❌ No (JavaScript-rendered) → Use
scrape_with_actions(5 credits)
- ✅ Yes → Use
- 3. Do you need structured extraction?
- ✅ Yes → Use
scrape_structured(2 credits) - ❌ No (raw HTML is fine) → Use
fetch_url(1 credit)
- ✅ Yes → Use
- 4. Do you need AI-powered research?
- ✅ Yes → Use
deep_research(10 credits) - ❌ No → Use cheaper alternatives
- ✅ Yes → Use
Cost Comparison by Use Case
| Use Case | Wrong Tool | Right Tool | Savings |
|---|---|---|---|
| Fetch HTML | search_web (5) | fetch_url (1) | 80% |
| Extract text | scrape_with_actions (5) | extract_text (1) | 80% |
| Get metadata | scrape_structured (2) | extract_metadata (1) | 50% |
| Research topic | deep_research (10) | search_web (5) + fetch_url (1×3) | 20% |
Example: Extracting Product Data
Wrong (10 credits)
// Using deep_research for simple task
const response = await fetch(
'https://crawlforge.dev/api/v1/tools/deep_research',
{
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({
topic: 'Product details',
sources: ['https://shop.com/product/123']
})
}
);
// Cost: 10 credits 💸Right (2 credits)
// Using scrape_structured for known URL
const response = await fetch(
'https://crawlforge.dev/api/v1/tools/scrape_structured',
{
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://shop.com/product/123',
selectors: {
title: 'h1.product-name',
price: 'span.price'
}
})
}
);
// Cost: 2 credits ✅ (80% savings)2. Caching Strategies
Avoid re-scraping the same content by implementing smart caching.
Redis Caching Example
Cache results for 24 hours to eliminate duplicate requests
import Redis from 'ioredis';
const redis = new Redis(process.env.REDIS_URL!);
async function fetchWithCache(url: string) {
// Try cache first
const cacheKey = `scrape:${url}`;
const cached = await redis.get(cacheKey);
if (cached) {
console.log('Cache hit! Saved 1 credit ✅');
return JSON.parse(cached);
}
// Cache miss - scrape the URL
console.log('Cache miss - scraping...');
const response = await fetch('https://crawlforge.dev/api/v1/tools/fetch_url', {
method: 'POST',
headers: {
'X-API-Key': process.env.CRAWLFORGE_API_KEY!,
'Content-Type': 'application/json',
},
body: JSON.stringify({ url }),
});
const data = await response.json();
// Cache for 24 hours
await redis.setex(cacheKey, 86400, JSON.stringify(data));
return data;
}
// Usage
const data1 = await fetchWithCache('https://example.com'); // Uses 1 credit
const data2 = await fetchWithCache('https://example.com'); // Uses 0 credits (cached)
const data3 = await fetchWithCache('https://example.com'); // Uses 0 credits (cached)
// Savings: 2 credits (66% reduction)3. Batch vs Individual Requests
Use batch processing for multiple URLs to improve throughput and reduce overhead.
- Individual Requests
- ⏱️ Time: ~5 seconds per URL
- 💰 Cost: 1 credit per URL
- 📊 Throughput: 12 URLs/minute
- Use for: <10 URLs
- Batch Requests (Recommended)
- ⏱️ Time: ~15 seconds for 50 URLs
- 💰 Cost: 1 credit per URL
- 📊 Throughput: 200 URLs/minute
- ✅ Use for: 10+ URLs (16x faster!)
Code Comparison
// Individual requests (SLOW)
const urls = [...]; // 50 URLs
const results = [];
for (const url of urls) {
const response = await fetch('https://crawlforge.dev/api/v1/tools/fetch_url', {
method: 'POST',
headers: {
'X-API-Key': process.env.CRAWLFORGE_API_KEY!,
'Content-Type': 'application/json',
},
body: JSON.stringify({ url }),
});
const data = await response.json();
results.push(data);
}
// Time: ~250 seconds (4+ minutes)
// Cost: 50 credits4. Cost/Benefit Analysis
Calculate the ROI of your scraping operations.
1,000 one-time trial credits — = 1,000 fetch_url requests
5,000 credits — = $0.0038/credit
50,000 credits — = $0.002/credit
Cost Per 1,000 URLs (Hobby Plan)
- ✅ Using
fetch_url(1 credit): $3.80 - ⚠️ Using
scrape_structured(2 credits): $7.60 - ❌ Using
scrape_with_actions(5 credits): $19.00 - ❌ Using
deep_research(10 credits): $38.00
Optimization Summary
- Always start with
fetch_url - Cache results for at least 1 hour
- Use
batch_scrapefor 10+ URLs - Avoid
deep_researchfor simple tasks - Parse HTML locally when possible
- Use
onlyMainContent: truefor batch scraping - Don't scrape same URL twice in 24h
- Check if site has API before scraping
- Use webhooks for large batches (100+ URLs)
- Monitor usage dashboard weekly