{
  "openapi": "3.0.1",
  "info": {
    "title": "Business Data Enricher — Clean, Match & Verify Listings",
    "description": "Business data enrichment against Overture Maps POI data. Cleans and deduplicates by name + location, assigns stable GERS global IDs, grades data quality, flags leads (no website, unbranded). Resale-safe records. Territory mode pulls in bulk and tracks openings, closures and rebrands over time.",
    "version": "1.0",
    "x-build-id": "I7vULdw9Kw9zyjO8z"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~business-data-enricher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-business-data-enricher",
        "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/ryanclinton~business-data-enricher/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-business-data-enricher",
        "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/ryanclinton~business-data-enricher/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-business-data-enricher",
        "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": {
          "places": {
            "title": "Places (bring-your-own list)",
            "type": "array",
            "description": "Your messy list of businesses/places to resolve. Each item: { \"name\": \"...\", \"lat\": 54.58, \"lng\": -5.93 } or { \"name\": \"...\", \"address\": \"...\" }. Optionally pass an \"id\" per row (echoed back as inputId), a \"category\" (improves precision), and a previously-stored \"gersId\" for an idempotent direct lookup. No row cap — scales to large national lists, resolved in a single run (bounded only by the run timeout). Leave empty and set Territory query for bulk pull mode."
          },
          "territoryQuery": {
            "title": "Territory query (bulk pull mode)",
            "type": "string",
            "description": "Alternative to Places. A bounding box \"minLng,minLat,maxLng,maxLat\" (e.g. \"-6.05,54.55,-5.80,54.65\") pulls all canonical entities in that area plus analytics. A bbox is REQUIRED — plain area names (e.g. \"Belfast\") are not supported and will return an error. Optionally append a category filter after a pipe, e.g. \"-6.05,54.55,-5.80,54.65 | coffee\"."
          },
          "outputProfile": {
            "title": "Output profile",
            "enum": [
              "enriched",
              "names",
              "gers_only",
              "audit",
              "territory"
            ],
            "type": "string",
            "description": "enriched = full record (default). names = lean { name, gersId, decomposed confidence, ambiguity, status }. gers_only = minimal join key. audit = adds every candidate considered + why rejected. territory = bulk-pull canonical entities + analytics summary.",
            "default": "enriched"
          },
          "matchProfile": {
            "title": "Match profile (threshold preset)",
            "enum": [
              "strict",
              "balanced",
              "lenient"
            ],
            "type": "string",
            "description": "Preset threshold packs (not a rule engine). strict = fewer, surer matches (dedup/KYC). balanced = default. lenient = recall-first (territory mapping). Per-field overrides below still win.",
            "default": "balanced"
          },
          "matchRadiusMeters": {
            "title": "Match radius (metres)",
            "minimum": 5,
            "maximum": 5000,
            "type": "integer",
            "description": "How close (in metres) a candidate must be to your point to count as a match. Default 150m. Tighten (e.g. 50) for premise-accurate matches.",
            "default": 150
          },
          "nameSimStrong": {
            "title": "Name similarity — strong tier",
            "minimum": 0.5,
            "maximum": 1,
            "type": "number",
            "description": "Name-similarity score (0–1) at or above which a match auto-accepts. matchProfile sets this; override for power tuning.",
            "default": 0.89
          },
          "nameSimWeak": {
            "title": "Name similarity — weak tier",
            "minimum": 0.5,
            "maximum": 1,
            "type": "number",
            "description": "Name-similarity score for a weaker, flagged match (also needs a compatible category and a close distance). Below this = no match.",
            "default": 0.83
          },
          "sources": {
            "title": "Data sources",
            "type": "array",
            "description": "Ground-truth sources. v1 supports Overture only; requesting foursquare logs a 'not yet supported' notice and proceeds with Overture (provenance is designed so FSQ grafting can be added later).",
            "default": [
              "overture"
            ],
            "items": {
              "type": "string"
            }
          },
          "overtureRelease": {
            "title": "Overture release",
            "type": "string",
            "description": "Overture Maps release id to read. The us-west-2 bucket retains only the latest ~2 releases; a pinned older release 404s once two newer ones publish.",
            "default": "2026-05-20.0"
          },
          "minConfidence": {
            "title": "Minimum Overture confidence",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Drop ground-truth candidates whose Overture confidence is below this. Default 0.5.",
            "default": 0.5
          },
          "includeClosed": {
            "title": "Include closed/non-operating places",
            "type": "boolean",
            "description": "By default places flagged closed/non-operating are excluded. Enable to include them (e.g. historical analysis).",
            "default": false
          },
          "includeLifecycle": {
            "title": "Include lifecycle signals",
            "type": "boolean",
            "description": "Single-run lifecycle band (operating | flagged | likely_closed | closed | new) from operating status + confidence + source signals. Cheap; on by default.",
            "default": true
          },
          "emitLeadSignals": {
            "title": "Emit lead signals",
            "type": "boolean",
            "description": "Digital-presence gap signals (NO_WEBSITE, NO_INSTAGRAM, UNBRANDED, INDEPENDENT, ...) off already-fetched data. Free; on by default.",
            "default": true
          },
          "includeMarketContext": {
            "title": "Include per-record market context",
            "type": "boolean",
            "description": "Per-place competitor counts (within 500m/1km, nearest competitor, same-brand within 5km). Free in territory mode; extra spatial reads per point in resolution mode.",
            "default": false
          },
          "includeGlobalBrandStats": {
            "title": "Include global brand footprint (computed)",
            "type": "boolean",
            "description": "Counts each matched brand's global location total across Overture keyed on brand.wikidata. Extra bounded query per distinct brand; cost stated in the startup log. Never asserts a market-share denominator.",
            "default": false
          },
          "includeGraphEdges": {
            "title": "Include graph edges on entity groups",
            "type": "boolean",
            "description": "Adds same_brand / co_located relationship edges on entity-group records (free). same_owner is not shipped (no ownership data in source).",
            "default": false
          },
          "enableRescuePass": {
            "title": "Extra rescue pass (v2 — inert)",
            "type": "boolean",
            "description": "Reserved for a future optional extra pass over the unmatched remainder. Not implemented yet; setting it has no effect.",
            "default": false
          },
          "emitEvents": {
            "title": "Event mode — emit commercial change events",
            "type": "boolean",
            "description": "Emit the commercial change stream for the territory. When on and Compare release is blank, the prior public Overture release is used as the baseline (logged).",
            "default": false
          },
          "compareRelease": {
            "title": "Compare release (baseline for the diff)",
            "type": "string",
            "description": "Earlier Overture release id to diff the current release against (e.g. \"2026-04-15.0\"). Leave blank with Event mode on to auto-use the prior public release. The us-west-2 bucket retains only the latest ~2 releases, so a much older id will 404.",
            "default": ""
          },
          "includeSuccessors": {
            "title": "Detect successor candidates",
            "type": "boolean",
            "description": "When a place closes and a new one opens at the same coordinates, flag it as a successor CANDIDATE (with a confidence, never asserted). Event mode only.",
            "default": false
          },
          "watchlistName": {
            "title": "Watchlist name (accumulate history)",
            "type": "string",
            "description": "Name a watchlist to persist a snapshot each run and diff against it next time — this builds change history (including per-entity category timelines) beyond the 2 public releases. First run captures a baseline; changes are reported from the next run. Needs a full-access token (restricted tokens can't open named stores).",
            "default": ""
          },
          "reviewDecisions": {
            "title": "Review decisions (persisted dispositions)",
            "type": "array",
            "description": "Watchlist mode only. Remembered human dispositions: [{ \"gersId\": \"08f2…\", \"status\": \"confirmed\" }]. Echoed back on the matching change events next run, so an analyst's call survives re-runs."
          },
          "demandLayer": {
            "title": "Demand layer (optional, for opportunity scoring)",
            "type": "object",
            "description": "Optional population/footfall layer. When supplied, the opportunity/whitespace score upgrades from supply-side-only to demand-aware. Leave empty for the honest supply-side score."
          },
          "notionConnector": {
            "title": "Notion connector (optional)",
            "type": "string",
            "description": "Optional. Connect a Notion workspace to receive a one-page resolution/territory report (and review worklist) at the end of the run. Apify proxies your credentials — this actor never sees your Notion token. Create one in Apify Console → Settings → MCP connectors (Notion is one-click)."
          },
          "notionArchiveProfile": {
            "title": "Notion archive profile",
            "enum": [
              "summary",
              "per-review"
            ],
            "type": "string",
            "description": "summary = one page per run (digest + top review items). per-review = one page per review-worklist item (capped at 50).",
            "default": "summary"
          },
          "notionDatabaseId": {
            "title": "Notion data source / database id (optional)",
            "type": "string",
            "description": "Optional. A Notion data source id to write pages into a specific database. Leave blank to create standalone workspace pages.",
            "default": ""
          },
          "slackConnector": {
            "title": "Slack connector (optional)",
            "type": "string",
            "description": "Optional. Connect Slack to post the resolution/territory digest plus high-priority review items to a channel. Apify proxies your credentials — this actor never sees your Slack token. (Slack connectors require you to register your own Slack OAuth app.)"
          },
          "slackChannel": {
            "title": "Slack channel (optional)",
            "type": "string",
            "description": "Optional channel id/name to post into (e.g. \"#data-ops\"). If omitted, the connector's default channel is used.",
            "default": ""
          },
          "slackMinReviewPriority": {
            "title": "Slack — minimum review priority to post",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only review-worklist items at or above this priority (0-100) are posted to Slack, to keep the channel signal-only. Default 50. The digest is always posted.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}