Skip to main content

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 public products.json API endpoint that returns all product data:
  1. Faster - Direct API call vs scraping/AI extraction
  2. More reliable - Structured JSON data, no parsing errors
  3. Complete data - Title, description, variants, images, pricing
  4. 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:

Product Data Extracted

Each product from Shopify includes:
Meta title and description are always fetched from each product page (with rate limiting to be respectful).

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.

Code Location