{
  "openapi": "3.0.1",
  "info": {
    "title": "Shopify Store Price, Discount & Restock Monitor",
    "description": "Monitor any public Shopify store or collection for price drops, back-in-stock restocks, new products, and newly started sales via public products.json. Zero proxies, stateful delta tracking, exact discount math, and instant n8n/Make/MCP alerts.",
    "version": "1.0",
    "x-build-id": "X8VEslTY3ntEYvKN7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/simon_kundrik~shopify-price-restock-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-simon_kundrik-shopify-price-restock-monitor",
        "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/simon_kundrik~shopify-price-restock-monitor/runs": {
      "post": {
        "operationId": "runs-sync-simon_kundrik-shopify-price-restock-monitor",
        "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/simon_kundrik~shopify-price-restock-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-simon_kundrik-shopify-price-restock-monitor",
        "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",
        "required": [
          "stores"
        ],
        "properties": {
          "stores": {
            "title": "Shopify Store or Collection URLs",
            "type": "array",
            "description": "List of Shopify store domains, collection URLs (e.g. 'https://allbirds.co.uk/collections/sale'), or objects like {\"url\": \"https://allbirds.co.uk\", \"collection\": \"sale\"}.",
            "default": [
              "https://deathwishcoffee.com",
              "https://allbirds.co.uk"
            ]
          },
          "watchEvents": {
            "title": "Change Events to Emit",
            "type": "array",
            "description": "Which variant-level state transitions should trigger an emitted dataset item in delta mode.",
            "items": {
              "type": "string",
              "enum": [
                "new",
                "price_drop",
                "price_increase",
                "back_in_stock",
                "out_of_stock",
                "sale_started"
              ],
              "enumTitles": [
                "New product / variant",
                "Price drop",
                "Price increase",
                "Back in stock (restock)",
                "Out of stock",
                "Sale started (compare_at_price added)"
              ]
            },
            "default": [
              "new",
              "price_drop",
              "back_in_stock",
              "sale_started"
            ]
          },
          "deltaMode": {
            "title": "Stateful Delta Mode (emit ONLY changes since previous run)",
            "type": "boolean",
            "description": "When enabled, seen variant prices and stock flags are persisted in a named Key-Value Store so scheduled runs only emit and charge for changes.",
            "default": true
          },
          "stateStoreName": {
            "title": "Named Key-Value Store for Delta Persistence",
            "type": "string",
            "description": "Apify Key-Value Store name used to remember variant prices and availability between scheduled runs.",
            "default": "shopify-monitor-state"
          },
          "stateNamespace": {
            "title": "State Namespace",
            "type": "string",
            "description": "Separate state key if you run multiple independent Shopify monitoring schedules against the same Key-Value Store.",
            "default": "default"
          },
          "firstRunMode": {
            "title": "First-Run Behavior (when no baseline exists yet)",
            "enum": [
              "emit_limited",
              "seed_only",
              "emit_all"
            ],
            "type": "string",
            "description": "Choose whether run 1 emits up to firstRunEmitLimit items per store, seeds silently with 0 emissions, or emits all matching variants.",
            "default": "emit_limited"
          },
          "firstRunEmitLimit": {
            "title": "Max Items Emitted per Store on First Run",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Caps emitted variants per store on run 1 when firstRunMode is 'emit_limited' so seeding a large catalog stays cheap.",
            "default": 10
          },
          "minPriceChangePercent": {
            "title": "Minimum Price Change (%)",
            "minimum": 0,
            "maximum": 99,
            "type": "number",
            "description": "Ignore tiny price fluctuations smaller than this percentage threshold (e.g. 5 ignores price changes under 5%).",
            "default": 0
          },
          "includeKeywords": {
            "title": "Include Keywords (match ANY, case-insensitive)",
            "type": "array",
            "description": "Only emit variants whose title, variant title, vendor, product type, tags, or SKU contain at least one of these terms.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude Keywords (reject ANY, case-insensitive)",
            "type": "array",
            "description": "Skip variants whose metadata contains any of these terms (e.g. 'gift card', 'sample', 'kids').",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "vendors": {
            "title": "Filter by Vendors (exact, case-insensitive)",
            "type": "array",
            "description": "Optional list of exact Shopify vendor names to include.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "productTypes": {
            "title": "Filter by Product Types (exact, case-insensitive)",
            "type": "array",
            "description": "Optional list of exact Shopify product_type values to include.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minPrice": {
            "title": "Minimum Price",
            "minimum": 0,
            "type": "number",
            "description": "Only emit variants priced at or above this amount in the store's currency."
          },
          "maxPrice": {
            "title": "Maximum Price",
            "minimum": 0,
            "type": "number",
            "description": "Only emit variants priced at or below this amount in the store's currency."
          },
          "minDiscountPercent": {
            "title": "Minimum Discount (%)",
            "minimum": 0,
            "maximum": 99,
            "type": "number",
            "description": "Only emit variants whose compare_at_price discount is at least this percentage."
          },
          "onlyAvailable": {
            "title": "In-Stock Variants Only",
            "type": "boolean",
            "description": "When enabled, only emit variants currently marked available=true.",
            "default": false
          },
          "includeDescription": {
            "title": "Include Plain-Text Product Description",
            "type": "boolean",
            "description": "Include HTML-stripped plain-text product description (up to 1,500 chars) on each emitted variant.",
            "default": false
          },
          "maxPagesPerStore": {
            "title": "Max Catalog Pages per Store (250 products/page)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Safety limit on products.json pages fetched per store (10 pages = up to 2,500 products).",
            "default": 10
          },
          "maxItemsPerStore": {
            "title": "Max Items Emitted per Store",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Upper limit on dataset rows emitted from any single store in one run.",
            "default": 200
          },
          "maxTotalItems": {
            "title": "Max Total Items Emitted per Run",
            "minimum": 1,
            "maximum": 25000,
            "type": "integer",
            "description": "Hard ceiling on total dataset rows emitted across all stores in one run.",
            "default": 1000
          },
          "requestTimeoutSecs": {
            "title": "HTTP Request Timeout (seconds)",
            "minimum": 5,
            "maximum": 60,
            "type": "integer",
            "description": "Timeout in seconds for each Shopify storefront JSON request.",
            "default": 20
          },
          "dryRun": {
            "title": "Dry Run (do not persist updated delta state)",
            "type": "boolean",
            "description": "Preview detected changes without saving updated variant baselines to the Key-Value Store.",
            "default": false
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}