Skip to main content
Discovers NEW products from a Shopify store using hash-based change detection.
Batch 1b: This endpoint runs in parallel with Batch 1a (update-ai-site). It’s completely decoupled - no scraped content needed.

What This Endpoint Does

  1. βœ… Fetch products from Shopify /products.json
  2. βœ… Compare hash to detect changes
  3. βœ… Save NEW products to database
  4. βœ… Generate prompts for NEW products (calls generate_prompts_for_product internally)
  5. βœ… Generate /llms/{slug}.txt for NEW products (calls generate_product_llms_txt internally)
  6. βœ… Return files for combined deploy (when skip_deploy=True)

How It Works

Hash-Based Change Detection

Instead of re-processing all products every time, we use efficient change detection:
  1. products_hash - MD5 hash of sorted product handles
  2. products_snapshot - Full product list from last sync
This means we only process truly NEW products, not all products.

Request Body

Response

Database Updates

Database Columns Used (ai_sites)

Code Location

Internal Services Called

This endpoint internally calls these shared services:
Why all-in-one? For the cron job, we want a single endpoint that handles the entire product discovery flow. The separate endpoints (generate-product-prompts, generate-product-llms-txt) exist for manual triggering and debugging.