{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Maps Scraper + Email Extractor & AI Lead Enrichment",
    "description": "Scrape Google Maps businesses, extract & verify emails from their websites, and let AI score which leads to contact first. CRM-ready B2B lead output.",
    "version": "1.0",
    "x-build-id": "E7rMbJsyAQUr3wRxw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/entranced_gelato~google-maps-lead-engine/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-entranced_gelato-google-maps-lead-engine",
        "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/entranced_gelato~google-maps-lead-engine/runs": {
      "post": {
        "operationId": "runs-sync-entranced_gelato-google-maps-lead-engine",
        "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/entranced_gelato~google-maps-lead-engine/run-sync": {
      "post": {
        "operationId": "run-sync-entranced_gelato-google-maps-lead-engine",
        "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": {
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Business queries to search on Google Maps, e.g. <code>dentist</code>, <code>roofing contractor</code>. Each term is searched against the location below.",
            "items": {
              "type": "string"
            }
          },
          "locationQuery": {
            "title": "Location",
            "type": "string",
            "description": "City, region, postal area, or country, e.g. <code>Malmö, Sweden</code> or <code>Austin, TX</code>. Required when using search terms."
          },
          "maxPlaces": {
            "title": "Max places",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of unique places to process per run (cost control).",
            "default": 100
          },
          "startUrls": {
            "title": "Direct Google Maps URLs (optional)",
            "type": "array",
            "description": "Direct Google Maps search or place URLs. Note: a single Maps search URL may be capped at ~120 results by Google; structured location search covers more.",
            "items": {
              "type": "string"
            }
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Skip places rated below this value (0 = no filter).",
            "default": 0
          },
          "minReviews": {
            "title": "Minimum review count",
            "minimum": 0,
            "type": "integer",
            "description": "Skip places with fewer reviews (0 = no filter).",
            "default": 0
          },
          "skipClosed": {
            "title": "Skip closed businesses",
            "type": "boolean",
            "description": "Exclude permanently or temporarily closed businesses.",
            "default": true
          },
          "categoryFilters": {
            "title": "Category filters",
            "type": "array",
            "description": "Keep only places whose Google Maps category contains one of these strings (case-insensitive).",
            "items": {
              "type": "string"
            }
          },
          "excludeCategories": {
            "title": "Exclude categories",
            "type": "array",
            "description": "Drop places whose category contains one of these strings.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Preferred results locale (hl parameter), e.g. <code>en</code>, <code>sv</code>, <code>de</code>.",
            "default": "en"
          },
          "crawlWebsite": {
            "title": "Crawl business websites",
            "type": "boolean",
            "description": "Visit each first-party business website to extract emails, phones, forms, socials, and quality signals.",
            "default": true
          },
          "maxWebsitePages": {
            "title": "Max pages per website",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Pages inspected per domain (homepage + contact/about/team pages first).",
            "default": 8
          },
          "contactPagePriority": {
            "title": "Contact page keywords",
            "type": "array",
            "description": "Path keywords crawled first, in priority order.",
            "default": [
              "contact",
              "about",
              "team",
              "impressum",
              "kontakt"
            ],
            "items": {
              "type": "string"
            }
          },
          "discoverEmails": {
            "title": "Discover emails",
            "type": "boolean",
            "description": "Extract emails from mailto links, visible text, obfuscations, and JSON-LD.",
            "default": true
          },
          "verifyEmails": {
            "title": "Verify emails",
            "type": "boolean",
            "description": "Verify discovered emails (syntax, disposable-domain, and MX checks). Only decisive results (ok / invalid / disposable) are billed.",
            "default": true
          },
          "extractSocialLinks": {
            "title": "Extract social links",
            "type": "boolean",
            "description": "Capture LinkedIn, Facebook, Instagram, YouTube, TikTok, and X profiles.",
            "default": true
          },
          "extractContactForms": {
            "title": "Extract contact forms",
            "type": "boolean",
            "description": "Capture contact form URLs as a fallback outreach path.",
            "default": true
          },
          "enableAiEnrichment": {
            "title": "Enable AI enrichment",
            "type": "boolean",
            "description": "Run AI qualification: niche classification, website quality, opportunity tags, personalization hooks, and lead scores.",
            "default": false
          },
          "aiProvider": {
            "title": "AI provider",
            "enum": [
              "none",
              "anthropic",
              "openai",
              "openrouter"
            ],
            "type": "string",
            "description": "LLM provider for enrichment. 'Built-in heuristics' produces rule-based enrichment without any API key.",
            "default": "none"
          },
          "aiModel": {
            "title": "AI model",
            "type": "string",
            "description": "Model identifier, e.g. <code>claude-haiku-4-5-20251001</code> or <code>gpt-4o-mini</code>. Leave empty for a sensible default."
          },
          "aiApiKey": {
            "title": "AI provider API key",
            "type": "string",
            "description": "Your API key for the selected provider. Stored encrypted; used only for enrichment calls."
          },
          "aiPromptProfile": {
            "title": "Enrichment profile",
            "enum": [
              "sales-outreach",
              "local-seo",
              "market-research",
              "generic"
            ],
            "type": "string",
            "description": "Tunes AI outputs to your use case.",
            "default": "sales-outreach"
          },
          "maxAiEnrichments": {
            "title": "Max AI enrichments per run",
            "minimum": 0,
            "type": "integer",
            "description": "Cost control for LLM calls.",
            "default": 500
          },
          "includeAiRationale": {
            "title": "Include AI score rationale",
            "type": "boolean",
            "description": "Include the reasoning behind lead quality scores in output.",
            "default": true
          },
          "requireWebsite": {
            "title": "Require website",
            "type": "boolean",
            "description": "Keep only businesses that have a website.",
            "default": false
          },
          "requireEmailOrForm": {
            "title": "Require email or contact form",
            "type": "boolean",
            "description": "Keep only businesses with at least one direct outreach path.",
            "default": false
          },
          "minLeadQualityScore": {
            "title": "Minimum lead quality score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Drop leads scoring below this composite score (0 = keep all).",
            "default": 0
          },
          "excludeDomains": {
            "title": "Exclude domains",
            "type": "array",
            "description": "Skip businesses whose website is on these domains (chains, directories, aggregators).",
            "items": {
              "type": "string"
            }
          },
          "batchId": {
            "title": "Batch ID",
            "type": "string",
            "description": "Optional identifier for multi-run orchestration; echoed on every record."
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "POSTs the run summary JSON here when the run finishes."
          },
          "includeRawHtml": {
            "title": "Include raw HTML samples",
            "type": "boolean",
            "description": "Keep raw page text samples for debugging (increases output size).",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxies for Google Maps and website crawling. Residential proxies recommended for large runs.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}