{
  "openapi": "3.0.1",
  "info": {
    "title": "Shopify Product Monitor — MCP, Prices, Drop Alerts",
    "description": "Scrape any Shopify store via /products.json — 99%+ run success. Feed RAG agents fresh products, prices, variants, inventory. $0.004/product vs Prisync $99-299/mo or Visualping $14/mo (Price2Spy/Pricer24/Wisepricer). MCP+n8n webhooks, AI via 5 LLMs, x402-ready.",
    "version": "1.7",
    "x-build-id": "mESVHNa49Jc7Cg62l"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/harvestlab~shopify-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-harvestlab-shopify-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/harvestlab~shopify-scraper/runs": {
      "post": {
        "operationId": "runs-sync-harvestlab-shopify-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/harvestlab~shopify-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-harvestlab-shopify-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "storeUrls": {
            "title": "Shopify Store URLs",
            "type": "array",
            "description": "List of Shopify store URLs to scrape (e.g. https://kith.com, https://hydrogen-preview.myshopify.com). The actor auto-detects the /products.json endpoint. Accepts aliases: 'shopUrls' (array), 'shopUrl'/'storeUrl'/'url' (single URL).",
            "items": {
              "type": "string"
            }
          },
          "shopUrl": {
            "title": "Single Store URL (CLI alias)",
            "type": "string",
            "description": "CLI alias for storeUrls (single URL). Hidden from Console form."
          },
          "storeUrl": {
            "title": "Store URL (CLI alias)",
            "type": "string",
            "description": "CLI alias for shopUrl/storeUrls (single URL). Hidden from Console form."
          },
          "url": {
            "title": "URL (CLI alias)",
            "type": "string",
            "description": "CLI alias for shopUrl/storeUrls (single URL). Hidden from Console form."
          },
          "shopUrls": {
            "title": "Shop URLs (CLI alias)",
            "type": "array",
            "description": "CLI alias for storeUrls (array of URLs). Hidden from Console form.",
            "items": {
              "type": "string"
            }
          },
          "maxProducts": {
            "title": "Max Products Per Store",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of products to scrape per store (1-500). Shopify stores can have thousands of products — start small to test. Accepts alias: 'maxItems'.",
            "default": 100
          },
          "maxItems": {
            "title": "Max Items (CLI alias)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "CLI alias for maxProducts. Hidden from Console form."
          },
          "includeVariants": {
            "title": "Include Variants",
            "type": "boolean",
            "description": "Include all product variants (sizes, colors, etc.) with individual pricing and inventory data. Recommended for price monitoring.",
            "default": true
          },
          "includeImages": {
            "title": "Include Images",
            "type": "boolean",
            "description": "Include product image URLs in the output (primary image plus gallery images).",
            "default": true
          },
          "includeCollections": {
            "title": "Include Collections",
            "type": "boolean",
            "description": "Also scrape the store's public /collections.json endpoint. Each collection (title, handle, description, products_count, image) is emitted as a dataset item with type='collection'. Useful for category-mapping and navigation analysis.",
            "default": false
          },
          "maxCollections": {
            "title": "Max Collections Per Store",
            "minimum": 1,
            "maximum": 250,
            "type": "integer",
            "description": "Maximum number of collections to scrape per store when includeCollections=true (1-250). Shopify paginates at 250 per page.",
            "default": 100
          },
          "discountedOnly": {
            "title": "Discounted Products Only",
            "type": "boolean",
            "description": "If true, only emit products that have at least one variant on sale (compare_at_price > price). Useful for bargain-hunting, reseller arbitrage, and sale-tracking workflows.",
            "default": false
          },
          "fetchCollectionProducts": {
            "title": "Build Product-to-Collection Graph",
            "type": "boolean",
            "description": "If true, walk each collection's /collections/{handle}/products.json endpoint to build a product-to-collection membership graph. Every product gets a 'collection_memberships' array ({collection_handle, collection_title, position}) and 'collection_count'. Every collection gets a 'discount_stats' block (per-collection discount heatmap). When AI analysis is enabled, adds 'collection_discount_heatmap' and 'merchandising_signals' to the output. Auto-enables includeCollections. Cost: one extra HTTP per collection — no existing Apify Shopify competitor exposes this graph.",
            "default": false
          },
          "maxProductsPerCollection": {
            "title": "Max Products Per Collection (graph mode)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "When fetchCollectionProducts=true, cap the number of products fetched per individual collection (1-1000). Default 250 covers most mid-size collections in a single API call.",
            "default": 250
          },
          "watchMode": {
            "title": "Price-Watch Mode (track price changes across runs)",
            "type": "boolean",
            "description": "Persist each product's min/max/avg price across runs in a named Apify key-value store (shopify-price-history). Every product receives a `price_watch` block with {price_previous, price_now, price_delta_pct, direction (up/down/flat), price_drop, first_seen_at, history_sample_count}. 60-snapshot FIFO per product (~2 months at daily cadence). Bills the `price-drop-detected` event ($0.005) when a product's price falls by ≥ alertMinDropPct (default 5%). First-run products emit direction='new' and are not billed.",
            "default": false
          },
          "alertWebhookUrl": {
            "title": "Alert Webhook URL (POST on price drop)",
            "type": "string",
            "description": "HTTPS webhook URL that receives a JSON POST for every product whose price falls ≥ alertMinDropPct. Payload: {store_domain, product_id, title, handle, vendor, price_previous, price_now, price_delta_pct, direction, currency, on_sale, url}. Works with Slack Incoming Webhooks, Zapier, Make/Integromat, n8n, or any HTTP endpoint. Fire-and-forget with 5s timeout + 1 retry — webhook failures never fail the scraper. Setting this auto-enables watchMode. Bills `alert-dispatched` ($0.002) per successfully delivered webhook."
          },
          "alertMinDropPct": {
            "title": "Alert Minimum Drop %",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Minimum price drop (in percent) required to fire a webhook and bill price-drop-detected. Default 5% — fires when a product's min_price falls at least 5% vs. its last snapshot. Set higher (e.g. 10) for fewer, bigger alerts, or lower (e.g. 2) to catch smaller moves. Requires watchMode=true.",
            "default": 5
          },
          "enableAiAnalysis": {
            "title": "Enable AI Analysis",
            "type": "boolean",
            "description": "Run AI-powered analysis on the store's product catalog. Provides pricing strategy insights, product gap analysis, and competitive positioning. Requires an API key.",
            "default": false
          },
          "llmProvider": {
            "title": "LLM Provider",
            "enum": [
              "openrouter",
              "anthropic",
              "google",
              "openai",
              "ollama"
            ],
            "type": "string",
            "description": "Choose the LLM provider for AI analysis. OpenRouter is cheapest.",
            "default": "openrouter"
          },
          "llmModel": {
            "title": "LLM Model Override",
            "type": "string",
            "description": "Specific model to use. Leave empty for the provider default (google/gemini-2.0-flash-001 for OpenRouter, claude-sonnet-4-20250514 for Anthropic, gemini-2.0-flash for Google AI, gpt-4o-mini for OpenAI, llama3.1 for Ollama)."
          },
          "openrouterApiKey": {
            "title": "OpenRouter API Key",
            "type": "string",
            "description": "API key for OpenRouter. Get one free at openrouter.ai/keys."
          },
          "anthropicApiKey": {
            "title": "Anthropic API Key",
            "type": "string",
            "description": "API key for Anthropic. Get one at console.anthropic.com."
          },
          "googleApiKey": {
            "title": "Google AI API Key",
            "type": "string",
            "description": "API key for Google AI (Gemini). Get one at aistudio.google.com/app/apikey."
          },
          "openaiApiKey": {
            "title": "OpenAI API Key",
            "type": "string",
            "description": "API key from platform.openai.com. Required if using OpenAI provider."
          },
          "ollamaBaseUrl": {
            "title": "Ollama Base URL",
            "type": "string",
            "description": "Base URL for Ollama API (self-hosted). Default: http://localhost:11434."
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Apify proxy configuration. Shopify stores generally work without residential proxies — datacenter proxies are sufficient."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}