{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Local Business Opportunity Finder",
    "description": "Find local businesses, enrich contacts, audit websites, score sales opportunities, and create personalized outreach angles.",
    "version": "1.0",
    "x-build-id": "L5BQHjryvgoef4ptk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kayhermes~ai-local-business-opportunity-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kayhermes-ai-local-business-opportunity-finder",
        "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~ai-local-business-opportunity-finder/runs": {
      "post": {
        "operationId": "runs-sync-kayhermes-ai-local-business-opportunity-finder",
        "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~ai-local-business-opportunity-finder/run-sync": {
      "post": {
        "operationId": "run-sync-kayhermes-ai-local-business-opportunity-finder",
        "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": {
          "searchQueries": {
            "title": "Business types or search queries",
            "type": "array",
            "description": "Examples: dentists, roofing contractors, bubble tea shops, salons. Each query is combined with every location below.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "Cities, ZIP codes, counties, or regions. Leave empty when the location is already included in each query.",
            "items": {
              "type": "string"
            }
          },
          "directGoogleMapsUrls": {
            "title": "Direct Google Maps place URLs",
            "type": "array",
            "description": "Optional specific Google Maps place pages to enrich and audit.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "businessWebsiteUrls": {
            "title": "Direct business website URLs",
            "type": "array",
            "description": "Optional websites to audit without using Google Maps discovery.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxResultsPerSearch": {
            "title": "Maximum businesses per search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum Google Maps place pages collected for each query/location combination.",
            "default": 25
          },
          "maxSearchScrolls": {
            "title": "Maximum Google Maps scrolls",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Higher values may find more businesses but increase run time.",
            "default": 30
          },
          "searchScrollWaitMs": {
            "title": "Wait between result scrolls",
            "minimum": 200,
            "maximum": 5000,
            "type": "integer",
            "description": "Delay that allows more Google Maps results to load.",
            "default": 900
          },
          "languageCode": {
            "title": "Google Maps language code",
            "pattern": "^[A-Za-z-]{2,10}$",
            "type": "string",
            "description": "Two-letter language code used for Google Maps pages. English provides the most reliable field parsing.",
            "default": "en"
          },
          "includeClosedBusinesses": {
            "title": "Include closed businesses",
            "type": "boolean",
            "description": "Include places detected as temporarily or permanently closed.",
            "default": false
          },
          "includeBusinessesWithoutWebsite": {
            "title": "Include businesses without websites",
            "type": "boolean",
            "description": "Businesses without a website are often strong web-design leads.",
            "default": true
          },
          "minRating": {
            "title": "Minimum Google rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Businesses with no detected rating are not removed by this filter.",
            "default": 0
          },
          "maxRating": {
            "title": "Maximum Google rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Use a lower value to focus on reputation-management prospects.",
            "default": 5
          },
          "minReviews": {
            "title": "Minimum review count",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Minimum review count",
            "default": 0
          },
          "maxReviews": {
            "title": "Maximum review count",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Maximum review count",
            "default": 1000000
          },
          "auditWebsites": {
            "title": "Audit each business website",
            "type": "boolean",
            "description": "Checks contacts, mobile setup, SEO, booking, ordering, lead forms, analytics, social profiles, and conversion signals.",
            "default": true
          },
          "maxSupplementalPages": {
            "title": "Extra contact pages per website",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Visit a small number of contact, about, booking, or ordering pages to improve email and phone enrichment.",
            "default": 2
          },
          "websiteWaitAfterLoadMs": {
            "title": "Extra website load wait",
            "minimum": 0,
            "maximum": 15000,
            "type": "integer",
            "description": "Extra website load wait",
            "default": 500
          },
          "serviceFocus": {
            "title": "Your service focus",
            "enum": [
              "all",
              "website",
              "seo",
              "reputation",
              "booking",
              "marketing"
            ],
            "type": "string",
            "description": "Opportunity scoring gives more weight to issues that match what you sell.",
            "default": "all"
          },
          "minimumOpportunityScore": {
            "title": "Minimum opportunity score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only output leads at or above this 0–100 score.",
            "default": 30
          },
          "requireEmail": {
            "title": "Require a public email",
            "type": "boolean",
            "description": "Remove leads when no email is found on the website or contact pages.",
            "default": false
          },
          "maxOutputLeads": {
            "title": "Maximum qualified leads",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Highest-scoring leads are output first.",
            "default": 500
          },
          "onlyNewLeads": {
            "title": "Output only leads not seen before",
            "type": "boolean",
            "description": "Uses the persistent history store below, making scheduled runs useful for fresh lead delivery.",
            "default": false
          },
          "leadHistoryStoreName": {
            "title": "Persistent lead history store",
            "pattern": "^[A-Za-z0-9._-]{1,63}$",
            "type": "string",
            "description": "Reuse the same named key-value store across scheduled runs.",
            "default": "local-business-opportunity-history"
          },
          "generateOutreach": {
            "title": "Generate outreach copy",
            "type": "boolean",
            "description": "Creates a subject line, first line, and concise message for each qualified lead.",
            "default": true
          },
          "sellerBusinessName": {
            "title": "Your business name",
            "type": "string",
            "description": "Used in outreach messages.",
            "default": ""
          },
          "sellerOffer": {
            "title": "What you sell",
            "type": "string",
            "description": "Example: websites, local SEO, appointment booking, or reputation management.",
            "default": "website, local SEO, and online booking improvements"
          },
          "senderName": {
            "title": "Sender name",
            "type": "string",
            "description": "Sender name",
            "default": ""
          },
          "outreachTone": {
            "title": "Outreach tone",
            "enum": [
              "friendly",
              "professional",
              "direct"
            ],
            "type": "string",
            "description": "Outreach tone",
            "default": "friendly"
          },
          "useAiForOutreach": {
            "title": "Use an OpenAI-compatible model",
            "type": "boolean",
            "description": "When off, truthful template outreach is generated without external AI cost.",
            "default": false
          },
          "maxAiOutreachLeads": {
            "title": "Maximum AI-written leads",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Limits external model cost. Remaining leads use the built-in template.",
            "default": 25
          },
          "aiBaseUrl": {
            "title": "OpenAI-compatible API base URL",
            "type": "string",
            "description": "Usually https://api.openai.com/v1. A private model endpoint must be reachable from the Apify cloud.",
            "default": "https://api.openai.com/v1"
          },
          "aiModel": {
            "title": "AI model name",
            "type": "string",
            "description": "Required only when AI outreach is enabled.",
            "default": ""
          },
          "aiApiKey": {
            "title": "AI API key",
            "type": "string",
            "description": "Encrypted secret input. Never place API keys in source code."
          },
          "aiOrganization": {
            "title": "AI organization header",
            "type": "string",
            "description": "Optional OpenAI organization value."
          },
          "aiTimeoutSecs": {
            "title": "AI request timeout",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "AI request timeout",
            "default": 45
          },
          "saveWebsiteScreenshots": {
            "title": "Save high-opportunity website screenshots",
            "type": "boolean",
            "description": "Stores full-page screenshots in the run key-value store.",
            "default": false
          },
          "screenshotMinimumScore": {
            "title": "Screenshot minimum score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Screenshot minimum score",
            "default": 60
          },
          "webhookUrl": {
            "title": "Completion webhook URL",
            "type": "string",
            "description": "Optional Slack workflow, Make, Zapier, n8n, CRM, or custom webhook endpoint."
          },
          "webhookHeadersJson": {
            "title": "Webhook headers JSON",
            "type": "string",
            "description": "Optional secret headers, for example {\"Authorization\":\"Bearer ...\"}."
          },
          "webhookLeadLimit": {
            "title": "Maximum leads included in webhook",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum leads included in webhook",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Google Maps can block repeated traffic. Apify Proxy or a residential proxy improves reliability.",
            "default": {
              "useApifyProxy": false
            }
          },
          "maxConcurrency": {
            "title": "Maximum browser concurrency",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Maximum browser concurrency",
            "default": 5
          },
          "maxRequestRetries": {
            "title": "Request retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Request retries",
            "default": 2
          },
          "navigationTimeoutSecs": {
            "title": "Navigation timeout",
            "minimum": 5,
            "maximum": 300,
            "type": "integer",
            "description": "Navigation timeout",
            "default": 45
          },
          "requestHandlerTimeoutSecs": {
            "title": "Request processing timeout",
            "minimum": 30,
            "maximum": 600,
            "type": "integer",
            "description": "Request processing timeout",
            "default": 120
          },
          "blockHeavyResources": {
            "title": "Block fonts and media",
            "type": "boolean",
            "description": "Reduces browser cost while keeping scripts, styles, and page content available.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}