{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Maps Competitor Change Tracker",
    "description": "Compare structured Google Maps listing snapshots or persist a monitor baseline to detect explainable competitor changes, review velocity, closures, category moves, profile updates, and new or removed listings.",
    "version": "3.0",
    "x-build-id": "LDDrvdUnumneV3wG3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kayhermes~google-maps-competitor-change-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kayhermes-google-maps-competitor-change-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/kayhermes~google-maps-competitor-change-tracker/runs": {
      "post": {
        "operationId": "runs-sync-kayhermes-google-maps-competitor-change-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/kayhermes~google-maps-competitor-change-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-kayhermes-google-maps-competitor-change-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": [
          "runMode"
        ],
        "properties": {
          "runMode": {
            "title": "Run mode",
            "enum": [
              "demo",
              "compare",
              "monitor"
            ],
            "type": "string",
            "description": "Demo compares bundled offline fixtures. Compare evaluates two supplied snapshots. Monitor loads the previous baseline from the default key-value store and updates it after a successful run.",
            "default": "demo"
          },
          "previousSnapshot": {
            "title": "Previous snapshot (inline)",
            "type": "array",
            "description": "Optional array of historical Google Maps listing objects. Used in compare mode. Common fields from major Google Maps scrapers are normalized automatically.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "currentSnapshot": {
            "title": "Current snapshot (inline)",
            "type": "array",
            "description": "Optional array of current Google Maps listing objects. Used in compare or monitor mode.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "previousSnapshotUrl": {
            "title": "Previous snapshot URL",
            "type": "string",
            "description": "Optional public HTTPS URL returning JSON, JSONL/NDJSON, or CSV. Private-network and credential-bearing URLs are rejected."
          },
          "currentSnapshotUrl": {
            "title": "Current snapshot URL",
            "type": "string",
            "description": "Optional public HTTPS URL returning JSON, JSONL/NDJSON, or CSV."
          },
          "urlFormat": {
            "title": "URL response format",
            "enum": [
              "auto",
              "json",
              "jsonl",
              "csv"
            ],
            "type": "string",
            "description": "Auto detects from content type and extension. Set explicitly when the source does not send a useful content type.",
            "default": "auto"
          },
          "previousObservedAt": {
            "title": "Previous snapshot time",
            "type": "string",
            "description": "Optional ISO date-time used when historical rows do not include observedAt/scrapedAt/timestamp. Enables review velocity calculations Runtime validation requires a valid ISO 8601 date-time."
          },
          "currentObservedAt": {
            "title": "Current snapshot time",
            "type": "string",
            "description": "Optional ISO date-time used when current rows do not include a timestamp Runtime validation requires a valid ISO 8601 date-time."
          },
          "baselineKey": {
            "title": "Monitor baseline key",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$",
            "type": "string",
            "description": "Key used in the default key-value store for monitor state. Change it to maintain independent competitor sets.",
            "default": "COMPETITOR_BASELINE"
          },
          "updateBaseline": {
            "title": "Update baseline after success",
            "type": "boolean",
            "description": "When enabled, monitor mode replaces the saved baseline only after comparison and result persistence succeed.",
            "default": true
          },
          "firstRunBehavior": {
            "title": "First monitor run",
            "enum": [
              "store-and-exit",
              "emit-all-as-new"
            ],
            "type": "string",
            "description": "Choose whether the first run only stores a baseline or emits every current listing as a new competitor.",
            "default": "store-and-exit"
          },
          "matchingStrategy": {
            "title": "Entity matching strategy",
            "enum": [
              "safe",
              "balanced",
              "aggressive"
            ],
            "type": "string",
            "description": "Safe uses exact identifiers and strong keys. Balanced adds name/address/geo evidence. Aggressive lowers the threshold but still rejects ambiguous matches.",
            "default": "balanced"
          },
          "minimumMatchConfidence": {
            "title": "Minimum match confidence",
            "minimum": 0.5,
            "maximum": 1,
            "type": "number",
            "description": "Base confidence required for a fuzzy match. Safe/aggressive strategy applies a small additional adjustment.",
            "default": 0.72
          },
          "ambiguityMargin": {
            "title": "Ambiguity rejection margin",
            "minimum": 0,
            "maximum": 0.4,
            "type": "number",
            "description": "Reject a fuzzy match when the best and runner-up scores are closer than this margin.",
            "default": 0.08
          },
          "maximumMatchDistanceMeters": {
            "title": "Maximum fuzzy match distance",
            "minimum": 50,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum distance for non-exact matching unless a strong phone match exists.",
            "default": 5000
          },
          "minimumSeverity": {
            "title": "Minimum alert severity",
            "enum": [
              "info",
              "low",
              "medium",
              "high",
              "critical"
            ],
            "type": "string",
            "description": "Only alerts at or above this severity are written as qualified results.",
            "default": "low"
          },
          "minimumRatingDelta": {
            "title": "Minimum rating change",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Ignore smaller average-rating movements.",
            "default": 0.1
          },
          "minimumReviewCountDelta": {
            "title": "Minimum review-count change",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Absolute review-count movement required unless the percentage threshold is met.",
            "default": 3
          },
          "minimumReviewPercentDelta": {
            "title": "Minimum review percentage change",
            "minimum": 0,
            "maximum": 10000,
            "type": "number",
            "description": "Percentage review-count movement required unless the absolute threshold is met.",
            "default": 2
          },
          "minimumPhotoCountDelta": {
            "title": "Minimum photo-count change",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Ignore smaller photo-count movements.",
            "default": 5
          },
          "maximumResults": {
            "title": "Maximum qualified results",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Hard cap on sorted alert results. Highest-severity and highest-impact alerts are kept first.",
            "default": 1000
          },
          "maxRecords": {
            "title": "Maximum records per snapshot",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Reject unexpectedly large inputs before expensive processing.",
            "default": 25000
          },
          "maxInvalidRecordRatio": {
            "title": "Maximum invalid row ratio",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Fail the run if invalid rows exceed this fraction of a snapshot.",
            "default": 0.1
          },
          "requestTimeoutSecs": {
            "title": "URL request timeout",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Timeout applied to each public snapshot URL request attempt.",
            "default": 30
          },
          "maxRetries": {
            "title": "URL request retries",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Retries transient network, HTTP 408/425/429, and 5xx failures with exponential backoff and jitter.",
            "default": 3
          },
          "maxResponseBytes": {
            "title": "Maximum URL response size",
            "minimum": 1024,
            "maximum": 250000000,
            "type": "integer",
            "description": "Reject responses larger than this byte limit.",
            "default": 25000000
          },
          "emitErrorItems": {
            "title": "Emit invalid rows as dataset error items",
            "type": "boolean",
            "description": "Off by default. Invalid-row details always remain in OUTPUT diagnostics; enable this for downstream row-level remediation. Error items are not charged with the custom result event.",
            "default": false
          },
          "includeDiagnostics": {
            "title": "Include detailed diagnostics",
            "type": "boolean",
            "description": "Include matching, invalid-row, duplicate, filtering, and truncation diagnostics in OUTPUT.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}