{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Business Leads Companies House Lookup, AI Scoring & Outreach",
    "description": "Scrape UK businesses from Google Maps with AI lead scoring, Companies House director lookup, and personalised outreach templates. More data per lead than any other Google Maps scraper.",
    "version": "1.0",
    "x-build-id": "5A24IPe72LyyrIt2C"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/automationnation~uk-business-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-automationnation-uk-business-leads",
        "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/automationnation~uk-business-leads/runs": {
      "post": {
        "operationId": "runs-sync-automationnation-uk-business-leads",
        "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/automationnation~uk-business-leads/run-sync": {
      "post": {
        "operationId": "run-sync-automationnation-uk-business-leads",
        "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": [
          "cities",
          "category"
        ],
        "properties": {
          "cities": {
            "title": "Cities / Regions",
            "type": "array",
            "description": "UK cities or regions to search. E.g. London, Manchester, Birmingham. Ignored if Postcodes are set.",
            "default": [
              "London"
            ],
            "items": {
              "type": "string"
            }
          },
          "postcodes": {
            "title": "Postcodes (precise targeting)",
            "type": "array",
            "description": "UK postcodes to search around. E.g. M1 1AA, SW1A 1AA. When set, overrides Cities and uses Radius Miles for geographic targeting.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "radiusMiles": {
            "title": "Search Radius (miles)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Search radius around each postcode in miles. Only used when Postcodes are set. 1–20 recommended.",
            "default": 5
          },
          "category": {
            "title": "Business Category",
            "enum": [
              "all",
              "restaurant",
              "gym",
              "hair salon",
              "beauty salon",
              "retail shop",
              "cafe",
              "bar",
              "trades"
            ],
            "type": "string",
            "description": "Type of business to find. Use 'all' to search across every category. Ignored if Custom Search Terms are set.",
            "default": "restaurant"
          },
          "customSearchTerms": {
            "title": "Custom Search Terms (override category)",
            "type": "array",
            "description": "Search for any business type. E.g. [\"accountant\", \"web design agency\", \"marketing agency\", \"solicitor\", \"mortgage broker\"]. Overrides the Category setting above.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateRangeDays": {
            "title": "Filter: First Review Within (days)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Optional. Set to 30, 60 or 90 to filter for businesses whose first Google Maps review is within that window — a proxy for recently opened. Leave at 0 (default) to return all businesses.",
            "default": 0
          },
          "minReviews": {
            "title": "Minimum Reviews",
            "minimum": 0,
            "type": "integer",
            "description": "Skip businesses with fewer than this many reviews. Use 0 to include brand-new listings.",
            "default": 0
          },
          "maxReviews": {
            "title": "Maximum Reviews (new businesses filter)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip businesses with more than this many reviews. Set to 10–30 to target brand-new businesses still building their reputation. Leave at 0 (default) for no cap.",
            "default": 0
          },
          "requireWebsite": {
            "title": "Must Have Website",
            "type": "boolean",
            "description": "Only return businesses that have a website listed on Google Maps.",
            "default": false
          },
          "requireUnclaimed": {
            "title": "Only Unclaimed Listings",
            "type": "boolean",
            "description": "Only return businesses that haven't claimed their Google Maps listing — easiest outreach targets.",
            "default": false
          },
          "scrapeEmails": {
            "title": "Scrape Emails from Websites",
            "type": "boolean",
            "description": "Visit each business website and extract email addresses. Adds ~5 seconds per business.",
            "default": true
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of businesses to return across all cities and queries.",
            "default": 50
          },
          "incrementalMode": {
            "title": "Incremental Mode (new businesses only)",
            "type": "boolean",
            "description": "Skip businesses already seen in previous runs. Perfect for weekly scheduling — wake up to only new businesses each time.",
            "default": false
          },
          "anthropicApiKey": {
            "title": "Anthropic API Key (optional — Claude built-in)",
            "type": "string",
            "description": "Claude Haiku is built-in — you do not need this. Only add your own key if you are running thousands of businesses per month and want dedicated API capacity. Get one at console.anthropic.com."
          },
          "geminiApiKey": {
            "title": "Gemini API Key (optional fallback override)",
            "type": "string",
            "description": "Gemini is the built-in fallback — you do not need this. Only add your own key if you hit rate limits on very large runs. Free at aistudio.google.com."
          },
          "hunterApiKey": {
            "title": "Hunter.io API Key (optional)",
            "type": "string",
            "description": "Boosts email discovery from ~30% to ~60%. Get a free key at hunter.io."
          },
          "companiesHouseApiKey": {
            "title": "Companies House API Key (UK — free)",
            "type": "string",
            "description": "Free UK government API. Returns director name, company number, incorporation date and SIC codes. Register at developer.companieshouse.gov.uk."
          },
          "yourName": {
            "title": "Your Name",
            "type": "string",
            "description": "Your name — used to sign outreach templates.",
            "default": ""
          },
          "yourBusiness": {
            "title": "Your Business Name",
            "type": "string",
            "description": "Your company name — used in outreach templates.",
            "default": ""
          },
          "yourService": {
            "title": "Your Service / Pitch",
            "type": "string",
            "description": "What you offer — e.g. 'digital marketing for new restaurants in London'.",
            "default": ""
          },
          "yourEmail": {
            "title": "Your Email",
            "type": "string",
            "description": "Your contact email — included in outreach templates.",
            "default": ""
          },
          "yourPhone": {
            "title": "Your Phone",
            "type": "string",
            "description": "Your phone number — used in SMS templates.",
            "default": ""
          },
          "competitors": {
            "title": "Competitor Businesses to Monitor",
            "type": "array",
            "description": "List of competitors to monitor for rating changes and new reviews. Each entry: { \"name\": \"Joe's Bistro\", \"mapsUrl\": \"https://maps.google.com/...\" }",
            "default": []
          },
          "deliverEmail": {
            "title": "Deliver via Email (CSV attachment)",
            "type": "boolean",
            "description": "Send results as a CSV file to your email after each run.",
            "default": false
          },
          "smtpHost": {
            "title": "SMTP Host",
            "type": "string",
            "description": "SMTP server hostname, e.g. smtp.gmail.com",
            "default": ""
          },
          "smtpPort": {
            "title": "SMTP Port",
            "type": "integer",
            "description": "SMTP port, typically 587 (TLS) or 465 (SSL).",
            "default": 587
          },
          "smtpUser": {
            "title": "SMTP Username",
            "type": "string",
            "description": "SMTP login username."
          },
          "smtpPass": {
            "title": "SMTP Password",
            "type": "string",
            "description": "SMTP login password."
          },
          "toEmail": {
            "title": "Send CSV To",
            "type": "string",
            "description": "Recipient email address for the CSV delivery.",
            "default": ""
          },
          "fromEmail": {
            "title": "From Email",
            "type": "string",
            "description": "Sender email address for the CSV delivery.",
            "default": ""
          },
          "deliverSheets": {
            "title": "Deliver to Google Sheets",
            "type": "boolean",
            "description": "Append results automatically to a Google Spreadsheet after each run.",
            "default": false
          },
          "serviceAccountJson": {
            "title": "Google Service Account JSON",
            "type": "string",
            "description": "Paste the full service account credentials JSON from Google Cloud Console."
          },
          "spreadsheetId": {
            "title": "Google Spreadsheet ID",
            "type": "string",
            "description": "The ID from the Google Sheets URL: /spreadsheets/d/{ID}/edit",
            "default": ""
          },
          "sheetName": {
            "title": "Sheet Name",
            "type": "string",
            "description": "Tab name to append data to. Created if it doesn't exist.",
            "default": "Leads"
          },
          "deliverWebhook": {
            "title": "Deliver via Webhook (Zapier / Make / CRM)",
            "type": "boolean",
            "description": "POST leads as JSON to a webhook URL — connect to HubSpot, Salesforce, Notion, or 1,000+ other tools via Zapier.",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Zapier catch hook, Make webhook, or any other HTTP endpoint.",
            "default": ""
          },
          "webhookFormat": {
            "title": "Webhook Payload Format",
            "enum": [
              "json",
              "csv"
            ],
            "type": "string",
            "description": "Send each lead as a JSON object or as a CSV row.",
            "default": "json"
          },
          "webhookPerRecord": {
            "title": "One Request Per Lead (Zapier mode)",
            "type": "boolean",
            "description": "Send one POST request per lead instead of all leads in one payload. Required for Zapier catch hooks and most CRM integrations.",
            "default": false
          },
          "deliverHubSpot": {
            "title": "Push Contacts to HubSpot",
            "type": "boolean",
            "description": "Create a contact in HubSpot for each lead found. Requires a HubSpot private app token.",
            "default": false
          },
          "hubspotToken": {
            "title": "HubSpot Private App Token",
            "type": "string",
            "description": "Create a private app in HubSpot → Settings → Integrations → Private Apps. Needs contacts write scope."
          },
          "deliverSlack": {
            "title": "Deliver Summary to Slack",
            "type": "boolean",
            "description": "Post a weekly summary of new businesses and competitor alerts to a Slack channel.",
            "default": false
          },
          "slackWebhookUrl": {
            "title": "Slack Incoming Webhook URL",
            "type": "string",
            "description": "Create one at api.slack.com/messaging/webhooks"
          },
          "slackChannel": {
            "title": "Slack Channel (optional)",
            "type": "string",
            "description": "Override channel, e.g. #leads. Leave blank to use webhook default.",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}