{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon Competitor Price Tracker",
    "description": "Track Amazon competitor prices against your reference ASIN, with price delta, Buy Box winner, FBA or FBM, stock and webhook alerts on undercuts. Covers 18 marketplaces; works with Apify MCP and the API.",
    "version": "0.1",
    "x-build-id": "Rg02hNQoCp8CWENbT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~amazon-competitor-price-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-amazon-competitor-price-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/khadinakbar~amazon-competitor-price-tracker/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-amazon-competitor-price-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/khadinakbar~amazon-competitor-price-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-amazon-competitor-price-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": [
          "referenceAsin"
        ],
        "properties": {
          "referenceAsin": {
            "title": "Reference ASIN or URL (your product)",
            "type": "string",
            "description": "The product you compare competitors against, usually your own (for example 'B0CHWRXH8B'). Paste the 10-character ASIN or the full Amazon product URL containing /dp/<ASIN>. Required. For a keyword use 'searchQuery' instead."
          },
          "competitorAsins": {
            "title": "Competitor ASINs or URLs (manual list)",
            "type": "array",
            "description": "Up to 100 competitor ASINs or Amazon product URLs to track against the reference (for example ['B0BDHWDR12']). Duplicates and the reference itself are skipped. Leave empty to auto-discover competitors with 'searchQuery'. Free plan: up to 9 competitors (10 ASINs per run in total).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "searchQuery": {
            "title": "Search query (auto-discover competitors)",
            "type": "string",
            "description": "Free-text Amazon search keyword (e.g. 'wireless earbuds noise cancelling'). The top results from the marketplace search are tracked as competitors against the reference ASIN. Use this when you want category-level competitor monitoring rather than a fixed list. Ignored if 'competitorAsins' is provided."
          },
          "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": "Which Amazon marketplace to track. Pricing, currency, and availability are localized — match this to where your reference product sells. Defaults to US (amazon.com).",
            "default": "US"
          },
          "maxCompetitors": {
            "title": "Max competitors (when auto-discovering)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many competitors to take from the search results when 'searchQuery' is used. Ignored if 'competitorAsins' is provided. Free plan: up to 9. Each product with a readable price is billed as one 'asin-tracked' event; products with no price, not found or blocked are free.",
            "default": 10
          },
          "alertWebhookUrl": {
            "title": "Alert webhook URL (optional)",
            "type": "string",
            "description": "Optional HTTPS endpoint that receives a POST whenever a competitor undercuts the reference by at least 'alertUndercutPercent'. Works with Slack, Discord, Zapier, Make, n8n or your own endpoint. 5-second timeout, 1 retry; webhook failures never fail the run. Each successful POST is billed as one 'alert-dispatched' event."
          },
          "alertUndercutPercent": {
            "title": "Alert undercut threshold (%)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Minimum percentage by which a competitor must undercut the reference to fire a webhook (e.g. 5 = alert when competitor is ≥5% cheaper). Lower = noisier alerts; higher = only big movers. Ignored if 'alertWebhookUrl' is empty. Defaults to 5%.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Leave empty (recommended): the Actor picks the cheapest working route for each marketplace automatically. Set this only if you need your own proxy."
          },
          "trackChanges": {
            "title": "Show changes since last run",
            "type": "boolean",
            "description": "Compares each price, stock state and Buy Box winner with the previous run for the same reference ASIN and marketplace, and adds changeType, previousPrice, priceChange and related fields. The first run has nothing to compare, so it reports 'first-seen'.",
            "default": true
          },
          "routeMode": {
            "title": "Route mode (advanced)",
            "enum": [
              "auto",
              "unlocker",
              "pool",
              "apify",
              "legacy"
            ],
            "type": "string",
            "description": "How pages are fetched. 'auto' tries the cheapest route first and falls back if a route is blocked. Change only for troubleshooting.",
            "default": "auto"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}