{
  "openapi": "3.0.1",
  "info": {
    "title": "Thomson Local Data: UK Business Leads in Real Time",
    "description": "Live Thomson Local UK business directory data: keyword + location search, full business profiles, and lead enrichment with websites and emails. Checkbox features stream structured JSON to your dataset in real time. Free plans get a 2-result trial.",
    "version": "0.0",
    "x-build-id": "fsOnYB7lq4Agocdb5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/b2b_leads~Thomson-Local-Real-Time-Data-Scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-b2b_leads-Thomson-Local-Real-Time-Data-Scraper",
        "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/b2b_leads~Thomson-Local-Real-Time-Data-Scraper/runs": {
      "post": {
        "operationId": "runs-sync-b2b_leads-Thomson-Local-Real-Time-Data-Scraper",
        "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/b2b_leads~Thomson-Local-Real-Time-Data-Scraper/run-sync": {
      "post": {
        "operationId": "run-sync-b2b_leads-Thomson-Local-Real-Time-Data-Scraper",
        "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": {
          "enableSearch": {
            "title": "Business search",
            "type": "boolean",
            "description": "Live keyword + location search across the Thomson Local UK directory. On by default and prefilled so you can click Start and get results in seconds.",
            "default": true
          },
          "searchTasks": {
            "title": "Search tasks",
            "type": "array",
            "description": "One row per search: a trade/keyword plus a UK location. Required when Business search is on.",
            "items": {
              "type": "object",
              "properties": {
                "keyword": {
                  "title": "Keyword / trade",
                  "type": "string",
                  "description": "e.g. plumbers, electricians, restaurants, solicitors",
                  "editor": "textfield"
                },
                "location": {
                  "title": "Location",
                  "type": "string",
                  "description": "UK town or city, e.g. Bristol, London, Manchester",
                  "editor": "textfield"
                },
                "maxResults": {
                  "title": "Max results",
                  "type": "integer",
                  "description": "Max businesses for this row (1–200).",
                  "minimum": 1,
                  "maximum": 200,
                  "default": 10,
                  "editor": "number"
                }
              }
            },
            "default": [
              {
                "keyword": "plumbers",
                "location": "Bristol",
                "maxResults": 10
              },
              {
                "keyword": "electricians",
                "location": "London",
                "maxResults": 10
              }
            ]
          },
          "maxResultsPerTask": {
            "title": "Default max results per task",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Fallback cap used when a search row has no maxResults. Default 10 — perfect for instant demo runs.",
            "default": 10
          },
          "maxPagesPerTask": {
            "title": "Max result pages per task",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Safety cap on result pages per search row (25 results per page).",
            "default": 5
          },
          "enableBusinessDetails": {
            "title": "Business details enrich",
            "type": "boolean",
            "description": "Enrich every business with its full profile (description, opening hours, extra contacts, photos). Adds a little extra time per business — the same row is enriched, never duplicated or dropped.",
            "default": true
          },
          "enableContactDiscovery": {
            "title": "Lead details enrich",
            "type": "boolean",
            "description": "Enrich each business with lead details (website, extra phones, socials) where available. Adds a little extra time per business.",
            "default": false
          },
          "fetchEmails": {
            "title": "Email discovery",
            "type": "boolean",
            "description": "Read each business's own website for a contact email. Runs last and adds a little extra time per business with a website.",
            "default": false
          },
          "maxReviewsPerBusiness": {
            "title": "Max reviews per business",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Cap on reviews kept per business profile (0–20).",
            "default": 3
          },
          "enableScrapeByUrl": {
            "title": "Scrape By URL",
            "type": "boolean",
            "description": "Collect specific Thomson Local business pages by pasting their links.",
            "default": false
          },
          "scrapeUrls": {
            "title": "Business page links",
            "type": "array",
            "description": "Full Thomson Local business page URLs, e.g. https://www.thomsonlocal.com/search/plumbers/bristol-avon/lloyd-s-plumbing/3294904/07968577251. Required when Scrape By URL is on.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max total items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Global safety cap for this run. Free-trial runs are capped at 2 results.",
            "default": 10000
          },
          "delayBetweenRequestsMs": {
            "title": "Delay between requests (ms)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Politeness pause between page reads (0–5000 ms).",
            "default": 800
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Parallel detail workers (1–8). Search stays sequential for reliability.",
            "default": 4
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "Optional https URL — every saved record is also POSTed here (JSON or Slack format). Best-effort: delivery failures never stop the run.",
            "default": ""
          },
          "webhookFormat": {
            "title": "Webhook format",
            "enum": [
              "json",
              "slack"
            ],
            "type": "string",
            "description": "Payload shape for webhook posts.",
            "default": "json"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Connection settings. Defaults to Apify Residential (GB) — recommended for this UK directory.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "GB"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}