{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Maps New Openings Monitor",
    "description": "Monitor cities or map areas for newly appeared Google Maps businesses — delta vs last run plus likely-new signals (low reviews). Ideal B2B leads for agencies selling to fresh local businesses.",
    "version": "1.0",
    "x-build-id": "5y3NdftIePDH7yIIe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/natural_lease~google-maps-new-openings-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-natural_lease-google-maps-new-openings-monitor",
        "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/natural_lease~google-maps-new-openings-monitor/runs": {
      "post": {
        "operationId": "runs-sync-natural_lease-google-maps-new-openings-monitor",
        "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/natural_lease~google-maps-new-openings-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-natural_lease-google-maps-new-openings-monitor",
        "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": [
          "categories"
        ],
        "properties": {
          "cities": {
            "title": "Cities / locations",
            "type": "array",
            "description": "List of cities or free-text locations (e.g. \"Moscow, Russia\", \"Austin, TX\"). One nested Maps search per city × category.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories / search terms",
            "type": "array",
            "description": "What to search on Maps (e.g. cafe, dentist, roofing). One search per category per city.",
            "items": {
              "type": "string"
            }
          },
          "bbox": {
            "title": "Bounding box (optional)",
            "type": "object",
            "description": "Optional map rectangle instead of cities. JSON object with west, south, east, north (numbers). Example: {\"west\":-97.9,\"south\":30.1,\"east\":-97.5,\"north\":30.5}. Overrides cities when all four fields are set."
          },
          "maxResultsPerCity": {
            "title": "Max places scanned per city × category",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Passed to nested Google Maps scraper (default 40 for denser city scans). Keep small for cheap smoke tests.",
            "default": 40
          },
          "mode": {
            "title": "Detection mode",
            "enum": [
              "monitor",
              "likely_new",
              "both"
            ],
            "type": "string",
            "description": "monitor = only places not seen in previous runs (KVS baseline). likely_new = filter by low review count. both = new-to-monitor AND likely-new heuristic.",
            "default": "both"
          },
          "maxReviewsLikelyNew": {
            "title": "Max reviews for likely-new",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Places with more reviews than this are treated as established (skipped in likely_new / both).",
            "default": 25
          },
          "lookbackDays": {
            "title": "Lookback days (heuristic)",
            "minimum": 1,
            "maximum": 730,
            "type": "integer",
            "description": "Reserved for review-age filtering. Nested scrape does not always expose openingDate; when reviews are fetched later this can tighten freshness. Currently used only as metadata on output.",
            "default": 90
          },
          "includeBaselineInOutput": {
            "title": "Include first-run baseline in dataset",
            "type": "boolean",
            "description": "On the first monitor run there is no prior state. If true, emit all matching places flagged isFirstRunBaseline=true. If false, first run only seeds the store and returns 0 rows.",
            "default": true
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Isolates baselines in named KVS. Use one ID per territory/niche you schedule.",
            "default": "default"
          },
          "countryCode": {
            "title": "Country code",
            "type": "string",
            "description": "Hint for nested scraper (ISO-ish lowercase, e.g. us, ru, de).",
            "default": "us"
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Language",
            "default": "en"
          },
          "scrapeContactFromWebsite": {
            "title": "Scrape contacts from website",
            "type": "boolean",
            "description": "Nested contacts enrichment (emails/social). Costs extra on compass — leave off for cheap monitoring.",
            "default": false
          },
          "skipClosedPlaces": {
            "title": "Skip closed places",
            "type": "boolean",
            "description": "Skip closed places",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy (residential rotation recommended for Maps). Nested compass manages its own proxies; this is kept for Store UX / future direct crawls.",
            "default": {
              "useApifyProxy": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}