- Hashing Service (free) - Fetch raw HTML and hash to find changes
- Firecrawl Batch Scrape (paid) - Only scrape pages that actually changed
Batch 1a:
detect-changes + update-ai-site run together.
Batch 1b: discover-products runs in parallel (completely decoupled).- detect-changes (this endpoint) - Find what changed
update-ai-site- Update the AI website
How It Works
Cost Efficiency
| Step | Cost | Description |
|---|---|---|
| Custom Mapper | Free | Our internal service |
| Hashing Service | Free | Raw HTTP GET + SHA-256 |
| Batch Scrape | ~$0.01/page | Only for new + changed pages |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
business_id | string | Yes | Clerk org ID |
Response
Key difference:
unchanged_pages does NOT have markdown - they werenβt
batch scraped. Only new_pages and changed_pages have markdown content.Status Values
| Status | Meaning |
|---|---|
success | Changes detected, proceed with update |
unchanged | No changes detected, skip update |
error | Something went wrong |
Usage in Cron
Decoupled architecture: Product discovery (Batch 1b) now runs in parallel
and uses the Shopify
products.json API directly - it doesnβt depend on
scraped content from detect-changes.Database Reads
entitiestable - Get business entity infoai_sitestable - Getsite_mapandpage_hashes
External API Calls
- Custom Website Mapper (
src/app/shared/mapping) - Get URL list [FREE] - Hashing Service (
src/app/shared/hashing) - Fetch raw HTML + hash [FREE] - Firecrawl Batch Scrape API (
/v2/batch/scrape) - Get markdown [PAID, only for changed pages]