{
  "openapi": "3.0.1",
  "info": {
    "title": "Product Price History & Deal Quality Scorer",
    "description": "Track marketplaces and storefront product pages, build price history, detect fake discounts, and score whether deals are real, weak, or inflated.",
    "version": "0.3",
    "x-build-id": "pPZVmOt5Q7FJGpaUL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/trovevault~deal-quality-scorer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-trovevault-deal-quality-scorer",
        "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/trovevault~deal-quality-scorer/runs": {
      "post": {
        "operationId": "runs-sync-trovevault-deal-quality-scorer",
        "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/trovevault~deal-quality-scorer/run-sync": {
      "post": {
        "operationId": "run-sync-trovevault-deal-quality-scorer",
        "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": {
          "productUrls": {
            "title": "Product URLs",
            "type": "array",
            "description": "One or more product page URLs to score. Use real product-detail-page URLs, not category or search pages. The actor supports major marketplaces, common storefront platforms, and generic product pages through structured data, platform-specific extractors, visible prices, and optional CSS selectors.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "historyDatasetName": {
            "title": "History Dataset Name",
            "type": "string",
            "description": "Name of the shared dataset that stores price observations across runs. Keep the same value over time to turn one-off checks into a reusable price-history product.",
            "default": "deal-quality-history"
          },
          "historyDatasetId": {
            "title": "History Dataset ID (optional)",
            "type": "string",
            "description": "Existing dataset ID to use instead of the named history dataset. Best when another workflow already owns the history dataset for a client, category, or long-running monitor."
          },
          "historyLookbackDays": {
            "title": "History Lookback Days",
            "minimum": 1,
            "type": "integer",
            "description": "Number of days of stored observations to use when scoring each deal. Use 90 for campaign monitoring or 365 for stronger fake-markup detection.",
            "default": 365
          },
          "minimumHistoryPoints": {
            "title": "Minimum History Points",
            "minimum": 1,
            "type": "integer",
            "description": "Minimum number of prior observations before the actor treats a score as mature instead of provisional. Lower values make the actor faster to trust, but less conservative.",
            "default": 3
          },
          "dedupeWindowHours": {
            "title": "Dedupe Window Hours",
            "minimum": 1,
            "type": "integer",
            "description": "If the latest saved observation for a product has the same current price and claimed reference price within this many hours, the actor skips writing a duplicate history row. This keeps the history dataset clean and cheap.",
            "default": 12
          },
          "persistObservation": {
            "title": "Persist Observation",
            "type": "boolean",
            "description": "When enabled, each successful extraction is appended to the history dataset so future runs become smarter. Leave this on unless you only want a one-off QA run.",
            "default": true
          },
          "includeHistorySnapshot": {
            "title": "Include History Snapshot",
            "type": "boolean",
            "description": "Include a compact array of recent observations in each output row. Useful for QA, dashboards, audit trails, and downstream interfaces.",
            "default": true
          },
          "maxHistoryEntriesInOutput": {
            "title": "Max History Entries In Output",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of recent observations to include in the historySnapshot array when snapshots are enabled. Lower values keep outputs lighter.",
            "default": 8
          },
          "platformHint": {
            "title": "Platform Hint",
            "enum": [
              "auto",
              "amazon",
              "walmart",
              "ebay",
              "etsy",
              "target",
              "bestbuy",
              "shopify",
              "woocommerce",
              "magento",
              "bigcommerce",
              "prestashop",
              "shopware",
              "generic"
            ],
            "type": "string",
            "description": "Force a platform if you already know the storefront type. Leave this on auto for mixed or unknown URLs so the actor can choose the cheapest working path.",
            "default": "auto"
          },
          "enableHtmlFallback": {
            "title": "Enable HTML Fallback",
            "type": "boolean",
            "description": "If enabled, the actor falls back to HTML extraction using JSON-LD, meta tags, common price selectors, and optional custom selectors when platform-specific endpoints are unavailable.",
            "default": true
          },
          "titleSelector": {
            "title": "Title Selector (optional)",
            "type": "string",
            "description": "Optional CSS selector for product title extraction on generic or custom storefronts. You can provide multiple selectors separated by commas or new lines."
          },
          "currentPriceSelector": {
            "title": "Current Price Selector (optional)",
            "type": "string",
            "description": "Optional CSS selector for the current live price. Use this when a custom storefront shows the price in HTML but not in JSON-LD or common classes."
          },
          "regularPriceSelector": {
            "title": "Regular Price Selector (optional)",
            "type": "string",
            "description": "Optional CSS selector for the original, compare-at, list, or regular price. Use this to strengthen fake-markup detection on non-standard storefronts."
          },
          "currencySelector": {
            "title": "Currency Selector (optional)",
            "type": "string",
            "description": "Optional CSS selector for currency codes or symbols on custom storefronts when the actor cannot infer currency cleanly."
          },
          "availabilitySelector": {
            "title": "Availability Selector (optional)",
            "type": "string",
            "description": "Optional CSS selector for stock status, such as in stock or out of stock, on custom storefronts."
          },
          "canonicalUrlSelector": {
            "title": "Canonical URL Selector (optional)",
            "type": "string",
            "description": "Optional CSS selector for canonical product URLs on custom storefronts. Use this when multiple URLs point to the same product and you want cleaner history matching."
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings for fetching product pages and lightweight APIs. Leave disabled for most runs to keep costs low. Enable Apify Proxy only when the target site blocks direct requests.",
            "default": {
              "useApifyProxy": false
            }
          },
          "datasetId": {
            "title": "Dataset ID (optional)",
            "type": "string",
            "description": "Existing Apify dataset to append scored deal rows to in addition to the default run dataset. Useful for client pipelines or shared reporting datasets."
          },
          "runId": {
            "title": "Run ID (optional)",
            "type": "string",
            "description": "Pipeline or parent run ID to carry through the output for downstream orchestration, joins, or QA tracing."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}