{
  "openapi": "3.0.1",
  "info": {
    "title": "Local Lead Engine: Business Leads with Buying Signals",
    "description": "Local business leads for any US city, county or state (and worldwide): 110 categories, MX-checked emails and valid phones, ad-spend and reputation signals, chain filtering. Only qualified leads are charged: from $4 per 1,000 (phone), $7 (email), $15 (buying-signal leads); lower on paid Apify plans.",
    "version": "1.0",
    "x-build-id": "XK1atuWp7oGgWPnTS"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/emeraldnerds~local-lead-engine/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-emeraldnerds-local-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/emeraldnerds~local-lead-engine/runs": {
      "post": {
        "operationId": "runs-sync-emeraldnerds-local-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/emeraldnerds~local-lead-engine/run-sync": {
      "post": {
        "operationId": "run-sync-emeraldnerds-local-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",
        "required": [
          "markets"
        ],
        "properties": {
          "markets": {
            "title": "Markets",
            "type": "array",
            "description": "Any place on Earth: postcode, town, city, county, state/province or country, e.g. \"Austin, Texas, USA\", \"Ontario, Canada\", \"Germany\", \"98250\". Countries are processed state by state.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Business categories",
            "type": "array",
            "description": "Category ids (plumber, dentist, restaurant, real-estate…), whole groups (home-services, construction, health, beauty, food, auto, professional, real-estate, retail, fitness, hospitality, education, pets, events, community) or \"all\". Unknown words become Google searches when you add a Google key. Full list in the README.",
            "items": {
              "type": "string"
            }
          },
          "sweepTowns": {
            "title": "Sweep every town in the market",
            "type": "boolean",
            "description": "For counties, states and countries: list every city, town and village inside and tag each lead with its town. With a Google key, each town is searched separately (far more coverage).",
            "default": false
          },
          "includeVillages": {
            "title": "Include villages",
            "type": "boolean",
            "description": "Include villages and small places in the town sweep.",
            "default": true
          },
          "minPopulation": {
            "title": "Minimum town population",
            "minimum": 0,
            "type": "integer",
            "description": "Skip towns smaller than this in the sweep (0 = all; towns without population data are skipped when this is above 0).",
            "default": 0
          },
          "maxTownsPerMarket": {
            "title": "Max towns per market",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper limit on towns swept per market (largest first).",
            "default": 200
          },
          "radiusKm": {
            "title": "Radius for point locations (km)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Used when a market has no boundary, such as a postcode or a point-only place.",
            "default": 10
          },
          "customOsmTags": {
            "title": "Extra OpenStreetMap tags",
            "type": "array",
            "description": "Advanced: extra key=value tags to include, e.g. \"craft=boatbuilder\" or \"shop=~^(farm|garden_centre)$\".",
            "items": {
              "type": "string"
            }
          },
          "useOpenStreetMap": {
            "title": "Use OpenStreetMap (free, worldwide)",
            "type": "boolean",
            "description": "Open data with global coverage. Coverage is best in Europe and in North American cities.",
            "default": true
          },
          "googleMaps": {
            "title": "Google Maps source",
            "enum": [
              "auto",
              "always",
              "off"
            ],
            "type": "string",
            "description": "Adds Google Maps places. OpenStreetMap covers only 1–19% of US trades, dentists and lawyers, so Auto adds Google Maps for those niches. With the built-in engine this costs nothing extra.",
            "default": "auto"
          },
          "lookupEngine": {
            "title": "Google Maps & Facebook lookup engine",
            "enum": [
              "built-in",
              "apify-actors"
            ],
            "type": "string",
            "description": "Built-in: our own Google Maps search and Meta Ad Library check, with no extra charges in your account. It returns rating and review count but not review text, because Google now hides review text from signed-out visitors. Apify helper Actors: compass/crawler-google-places and apify/facebook-ads-scraper run in your account at their own prices (capped by maxSubActorSpendUsd).",
            "default": "built-in"
          },
          "maxPlacesPerSearch": {
            "title": "Google Maps places per category per area",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper bound of Google Maps places per category for each market (or town in a sweep).",
            "default": 100
          },
          "maxGoogleMapsSearches": {
            "title": "Max Google Maps areas",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "How many markets/towns are searched on Google Maps per run (one sub-run each).",
            "default": 25
          },
          "reviewsPerPlace": {
            "title": "Newest reviews to check per place",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Apify helper Actors engine only: newest Google reviews to read per place (0 = automatic: 10 for the reputation filter). Reviews cost extra in your account. The built-in engine scores reputation from rating and review volume.",
            "default": 0
          },
          "checkFacebookAds": {
            "title": "Verify active Facebook ads",
            "type": "boolean",
            "description": "For leads with a Facebook page, count active ads in the public Meta Ad Library. Built-in engine: no extra cost (about 2–4 seconds per page). Helper-Actor engine: apify/facebook-ads-scraper at its own price.",
            "default": false
          },
          "maxSubActorSpendUsd": {
            "title": "Spending cap for Google Maps / Facebook lookups (USD)",
            "minimum": 0.1,
            "maximum": 1000,
            "type": "number",
            "description": "Apify helper Actors engine only: hard cap on what compass/crawler-google-places and apify/facebook-ads-scraper may charge in your account during this run.",
            "default": 5
          },
          "googlePlacesApiKey": {
            "title": "Google Places API key (optional)",
            "type": "string",
            "description": "Your own Google Maps Platform key with Places API (New) enabled. Adds Google listings, ratings and review counts. Google bills your key for each search; you are responsible for Google's terms."
          },
          "customQueries": {
            "title": "Extra Google search phrases",
            "type": "array",
            "description": "Free-text searches run in every market with a Google key, e.g. \"kitchen remodeling\", \"dog daycare\".",
            "items": {
              "type": "string"
            }
          },
          "maxGoogleQueries": {
            "title": "Max Google searches per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Protects your Google bill: each search returns up to 60 places.",
            "default": 200
          },
          "leadFilter": {
            "title": "Lead filter",
            "enum": [
              "contactable",
              "email",
              "phone",
              "no-website",
              "outdated-website",
              "running-ads",
              "no-ads",
              "reputation"
            ],
            "type": "string",
            "description": "Which businesses count as billable leads. Ad and reputation filters work best with Google Maps on; Facebook ad verification needs checkFacebookAds.",
            "default": "contactable"
          },
          "minReputationScore": {
            "title": "Minimum reputation score (reputation filter)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "0–100 score from rating, unanswered negative reviews, owner reply rate, review volume vs market, unclaimed profile and review recency. 50 flags about 1 in 4 businesses in our tests; raise it for only the strongest prospects. When review text isn't available (built-in Google lookups), half this value is used because only rating, review volume and claim status can be scored.",
            "default": 50
          },
          "chains": {
            "title": "Chains and franchises",
            "enum": [
              "auto",
              "include",
              "exclude"
            ],
            "type": "string",
            "description": "Detects franchise brands (Roto-Rooter, Aspen Dental, State Farm…), domains shared by 3+ locations and location pages. Each lead gets a chain field either way.",
            "default": "auto"
          },
          "crawlWebsites": {
            "title": "Visit business websites",
            "type": "boolean",
            "description": "Reads the homepage and up to two contact or about pages for emails, phones, social links and tech stack.",
            "default": true
          },
          "maxPagesPerSite": {
            "title": "Max pages per website",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "Pages read per website (homepage first).",
            "default": 3
          },
          "checkEmailMx": {
            "title": "Check email domains (MX)",
            "type": "boolean",
            "description": "Emails whose domain cannot receive mail are discarded.",
            "default": true
          },
          "includeUnqualified": {
            "title": "Also return unqualified businesses (free)",
            "type": "boolean",
            "description": "Adds businesses that failed the filter, uncharged, with the reason.",
            "default": false
          },
          "onlyNewLeads": {
            "title": "Only new leads (monitor mode)",
            "type": "boolean",
            "description": "Schedule this run weekly: leads delivered before are skipped for free, so you only pay for newly opened or newly listed businesses.",
            "default": false
          },
          "monitorId": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional name for the only-new history. Defaults to a hash of markets, categories and filter."
          },
          "maxLeads": {
            "title": "Max charged leads",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Hard cap. The run stops once this many qualified leads are charged.",
            "default": 500
          },
          "concurrency": {
            "title": "Parallel website checks",
            "minimum": 1,
            "maximum": 40,
            "type": "integer",
            "description": "Websites checked at once.",
            "default": 10
          },
          "overpassUrl": {
            "title": "Private Overpass server URL (advanced)",
            "type": "string",
            "description": "Optional: your own Overpass API endpoint (e.g. https://my-overpass.example.com/api/interpreter) for faster, unthrottled OpenStreetMap queries on very large sweeps."
          },
          "spreadsheet": {
            "title": "Google Sheet URL or ID",
            "type": "string",
            "description": "Upserts by leadId so repeat runs update rows. Share the sheet with your service account as Editor."
          },
          "sheetName": {
            "title": "Sheet tab",
            "type": "string",
            "description": "Sheet tab.",
            "default": "Local leads"
          },
          "serviceAccountJson": {
            "title": "Google service account key (JSON)",
            "type": "string",
            "description": "Google service account key (JSON)."
          },
          "airtableBaseId": {
            "title": "Airtable base ID",
            "type": "string",
            "description": "Airtable base ID."
          },
          "airtableTable": {
            "title": "Airtable table",
            "type": "string",
            "description": "Airtable table."
          },
          "airtableToken": {
            "title": "Airtable token",
            "type": "string",
            "description": "Airtable token."
          },
          "webhookUrl": {
            "title": "Webhook URL (Zapier, Make, n8n, CRM)",
            "type": "string",
            "description": "Receives the charged leads as JSON."
          },
          "webhookSecret": {
            "title": "Webhook signing secret",
            "type": "string",
            "description": "HMAC-SHA256 signature in X-Signature."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}