{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon Competitor Price Tracker",
    "description": "Track Amazon competitor prices vs your reference ASIN: priceDelta, Buy Box winner, FBA/FBM, stock + webhook alerts on undercut. MCP-ready. 18 marketplaces. $0.020/ASIN.",
    "version": "0.1",
    "x-build-id": "4p8zNxeMPX3jkxhqm"
  },
  "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 (your product)",
            "pattern": "^[A-Z0-9]{10}$",
            "type": "string",
            "description": "The ASIN you want to compare competitors against — usually your own product (e.g. 'B08N5WRWNW'). Every other ASIN's priceDelta is computed relative to this one. Required. NOT a URL — paste the 10-character ASIN code from the URL `/dp/<ASIN>`. NOT a search keyword — use 'searchQuery' for that."
          },
          "competitorAsins": {
            "title": "Competitor ASINs (manual list)",
            "type": "array",
            "description": "Up to 100 specific competitor ASINs to track against the reference (e.g. ['B09G9HD6PD','B0BDHWDR12']). Use this when you already know who you're competing with. Leave empty to auto-discover competitors via 'searchQuery'. NOT a URL list — for direct URLs use 'startUrls'. Each ASIN must be exactly 10 alphanumeric characters.",
            "items": {
              "type": "string",
              "pattern": "^[A-Z0-9]{10}$"
            },
            "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 pull from the search results when 'searchQuery' is used. Ignored if 'competitorAsins' is provided. Each tracked ASIN is billed as one 'asin-tracked' event at $0.005. The reference ASIN is also billed (1 + N events total).",
            "default": 10
          },
          "alertWebhookUrl": {
            "title": "Alert webhook URL (optional)",
            "type": "string",
            "description": "Optional HTTPS endpoint that receives a POST with the alert payload whenever a competitor undercuts the reference by at least 'alertUndercutPercent'. Use to wire into Slack/Discord/Zapier/Make/n8n/your own endpoint. Fire-and-forget: 5s timeout, 1 retry, webhook failures never fail the run. Adds an 'alert-dispatched' charge ($0.002) per successful POST."
          },
          "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": "Amazon blocks datacenter IPs — residential proxies are required and are the default. Override only if you have a specific compliance reason.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}