{
  "openapi": "3.0.1",
  "info": {
    "title": "Shopify Price History & Fake Discount Tracker",
    "description": "Track Shopify product prices over time, get the 30-day lowest price, and flag inflated \"was\" prices. History starts with your first scheduled run.",
    "version": "0.2",
    "x-build-id": "sd5CbcVkYAVgqpJlV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kondasviktor~shopify-discount-promo-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kondasviktor-shopify-discount-promo-tracker",
        "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/kondasviktor~shopify-discount-promo-tracker/runs": {
      "post": {
        "operationId": "runs-sync-kondasviktor-shopify-discount-promo-tracker",
        "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/kondasviktor~shopify-discount-promo-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-kondasviktor-shopify-discount-promo-tracker",
        "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": [
          "storeUrls"
        ],
        "properties": {
          "storeUrls": {
            "title": "Shopify store URLs",
            "type": "array",
            "description": "Shopify stores to track: a homepage, a bare domain, any product URL (the whole store is read), a collection URL such as `/collections/sale` (only that collection), or a market sub-folder such as `/en-de`. You can also import a list from a text file or Google Sheet CSV. Prefilled with the Black Friday example shops.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "historyEnabled": {
            "title": "Keep price history",
            "type": "boolean",
            "description": "Saves every price change of every variant in a store in YOUR Apify account, so each scheduled run can tell you the 30-day lowest price and whether a \"was\" price is inflated. Leave it on. History starts with your first run and cannot be recovered for the time before it. Required for `changesOnly` output.",
            "default": true
          },
          "historyStoreName": {
            "title": "History store name",
            "minLength": 3,
            "maxLength": 63,
            "type": "string",
            "description": "Name of the key-value store in your account that holds the history, one record per shop (3–63 characters: lowercase letters, digits, hyphens). Named stores do not expire. Several tasks can share a name — their histories are merged. Use another name to keep separate watchlists apart.",
            "default": "shopify-price-history"
          },
          "outputMode": {
            "title": "Which items to return",
            "enum": [
              "all",
              "changesOnly"
            ],
            "type": "string",
            "description": "`all` returns every item selected by \"What to return\" below. `changesOnly` returns only variants that changed since the last check (price drop or rise, new, back in stock, out of stock, removed, new inflated discount) — so Apify's email, Slack or webhook integrations fire only on real changes. The first run is a baseline and returns nothing in this mode.",
            "default": "all"
          },
          "minDropPct": {
            "title": "Ignore price moves smaller than (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Price changes smaller than this are still saved in the history but are reported as `changeType: none`. 5 = ignore moves under 5%.",
            "default": 5
          },
          "maxProducts": {
            "title": "Max products per run (cost cap)",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Hard cap on products delivered across all stores — also your cost cap (200 products = $0.60, however many variants they have). Store summary rows are not counted. Reading the catalog itself is free.",
            "default": 200
          },
          "scanLimitPerStore": {
            "title": "Max products read per shop",
            "minimum": 50,
            "maximum": 25000,
            "type": "integer",
            "description": "How many products of each shop are read (250 per request, free). If a shop has more, the run says so and that day is NOT counted as a completed check, so nothing is wrongly marked as removed. Raise it for big catalogs.",
            "default": 5000
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "One JSON POST per run that had changes (a summary plus the changed items). Nothing is sent when nothing changed. Must be a public https/http URL."
          },
          "telegramBotToken": {
            "title": "Telegram bot token (optional)",
            "type": "string",
            "description": "Create a bot with @BotFather and paste its token. You get one summary message per run that had changes, nothing otherwise. Needs the chat ID below."
          },
          "telegramChatId": {
            "title": "Telegram chat ID (optional)",
            "type": "string",
            "description": "Chat or channel ID that receives the summary message."
          },
          "mode": {
            "title": "What to return",
            "enum": [
              "on-sale",
              "changes",
              "all",
              "summary"
            ],
            "type": "string",
            "description": "`on-sale` returns discounted variants, deepest first. `all` returns every variant. `changes` returns variants whose price or sale status changed since the previous run. `summary` returns store summaries only — the cheapest daily monitor. A product with many variants is one $0.003 charge.",
            "default": "on-sale"
          },
          "maxProductsPerStore": {
            "title": "Max product rows per store",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stops one big store from using the whole budget. Rows are picked deepest discount first.",
            "default": 50
          },
          "minDiscountPct": {
            "title": "Minimum discount (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Only return products discounted by at least this much. 0 = every sale item. Use 30–50 to find the deepest deals. Ignored in `changes` and `summary` mode.",
            "default": 0
          },
          "includeStoreSummary": {
            "title": "Include store summary row",
            "type": "boolean",
            "description": "One extra row per store ($0.02): share of the catalog on sale, average / median / deepest discount, promo level and trend, Black Friday detection, inflated compare-at prices.",
            "default": true
          },
          "referenceTolerancePct": {
            "title": "\"Was\" price tolerance (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "A \"was\" (compare-at) price is flagged `inflated_reference` when it is more than this many percent above the lowest price recorded in the 30 days before the sale started. 1 follows the EU 30-day rule. Needs 27+ checked days before the sale to give a verdict.",
            "default": 1
          },
          "trackHistory": {
            "title": "Track history (legacy name)",
            "type": "boolean",
            "description": "Older name of \"Keep price history\", kept so saved tasks still work. History is off when either one is switched off.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxy is recommended for big Shopify catalogs (Gymshark, Allbirds, …). Without a proxy, many stores return HTTP 429. Datacenter often works for small shops.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}