{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon Price History Scraper - ASIN Price Alerts",
    "description": "Track Amazon product prices over time from ASINs or product URLs. Stores observed history in a named KV store and returns deltas, lows, highs, stock, seller, and optional drop alerts. MCP/API-ready.",
    "version": "0.1",
    "x-build-id": "ps0J4Ch86xh9KODYL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~amazon-price-history-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-amazon-price-history-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/khadinakbar~amazon-price-history-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-amazon-price-history-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/khadinakbar~amazon-price-history-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-amazon-price-history-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",
        "required": [
          "products"
        ],
        "properties": {
          "products": {
            "title": "Amazon ASINs or product URLs",
            "type": "array",
            "description": "Use this when you know the exact Amazon products to monitor. Accepts 10-character ASINs like B0CHWRXH8B or product URLs like https://www.amazon.com/dp/B0CHWRXH8B. Defaults to one working ASIN for a quick smoke test. Not a keyword search field.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Amazon marketplace",
            "enum": [
              "US",
              "UK",
              "DE",
              "FR",
              "CA",
              "ES",
              "IT",
              "JP",
              "AU",
              "IN",
              "MX",
              "BR",
              "NL",
              "SE",
              "PL",
              "TR",
              "AE",
              "SG"
            ],
            "type": "string",
            "description": "Use this when the product should be checked on a specific Amazon marketplace. Accepted values include US, UK, DE, FR, CA, JP, IN, AU, and more. Defaults to US. This does not auto-detect the country from a URL.",
            "default": "US"
          },
          "maxProducts": {
            "title": "Max products",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Use this to cap how many unique products are processed from the products list. The actor stops at this count before crawling or charging product events. Defaults to 20 and maxes at 100. This is not a page-count setting.",
            "default": 20
          },
          "historyStoreName": {
            "title": "History store name",
            "pattern": "^[a-zA-Z0-9_-]{3,80}$",
            "type": "string",
            "description": "Use this to keep price history across scheduled runs. The same named key-value store is opened every run, for example amazon-price-history. Defaults to amazon-price-history. This is not the output dataset name.",
            "default": "amazon-price-history"
          },
          "outputHistoryPoints": {
            "title": "Recent history points in output",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Use this to control how many recent observations are embedded in each dataset row. The full retained history stays in the named KV store. Defaults to 30 and maxes at 365. This does not delete older stored history.",
            "default": 30
          },
          "historyRetentionPoints": {
            "title": "Stored history points per ASIN",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Use this to cap stored observations per ASIN in the history KV store. Defaults to 365 and maxes at 2000. Older observations roll off only after this limit is reached. This is not measured in days.",
            "default": 365
          },
          "resetHistory": {
            "title": "Reset history for these ASINs",
            "type": "boolean",
            "description": "Use this when you want to discard prior stored observations for the submitted ASINs before writing this run. Defaults to false for normal scheduled tracking. Set true only for a clean restart. This does not delete unrelated ASIN keys.",
            "default": false
          },
          "alertWebhookUrl": {
            "title": "Price-drop webhook URL",
            "type": "string",
            "description": "Use this to POST a JSON alert when the current price drops below the previous observed price by the threshold. Must be an HTTPS URL, for example a Slack, Make, Zapier, n8n, or custom endpoint. Empty by default. This is not required for scraping."
          },
          "alertDropPercent": {
            "title": "Alert drop threshold (%)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Use this with alertWebhookUrl to avoid noisy small-price-change alerts. A value of 5 means alert when price falls at least five percent versus the previous stored price. Defaults to 5 and maxes at 90. Ignored when no webhook URL is set.",
            "default": 5
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Use this to tune request parallelism for Amazon product pages. Lower values are slower but gentler on proxies and reduce intermittent blocks. Defaults to 5 and maxes at 10. This is not a product limit.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional custom or Apify proxy settings. When left blank, the actor uses its managed mobile proxy targeted to the selected Amazon marketplace. Supply your own proxy only when you need to control egress or billing.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}