Purpose
Discovers NEW products from a Shopify store using hash-based change detection. This endpoint handles the complete product discovery pipeline internally - fetching, saving, prompt generation, and LLMs file generation.Batch 1b: This endpoint runs in parallel with Batch 1a (update-ai-site).
Itβs completely decoupled - no scraped content needed.
Architecture
Why Shopify products.json?
Shopify stores expose a publicproducts.json API endpoint that returns all product data:
- Faster - Direct API call vs scraping/AI extraction
- More reliable - Structured JSON data, no parsing errors
- Complete data - Title, description, variants, images, pricing
- No AI costs - No Gemini/OpenAI API calls needed for product discovery
Hash-Based Change Detection
Instead of re-processing all products every time, we use efficient change detection:| Column | Type | Purpose |
|---|---|---|
products_hash | TEXT | MD5 hash of sorted product handles for quick comparison |
products_snapshot | JSONB | Full product list from last sync |
Product Data Extracted
Each product from Shopify includes:What This Endpoint Does (All-in-One)
This endpoint handles the complete product pipeline internally:Standalone endpoints exist for manual use: The separate endpoints
(
generate-product-prompts, generate-product-llms-txt) exist for
manual triggering and debugging, but are NOT called by the cron job.