# Public Business Directory Leads (`staros_dev/public-business-directory-leads`) Actor

Fetch bounded public business-source URLs, use optional fallback URLs when retryable sources fail, rank candidate leads, and return a reviewable result envelope with source diagnostics and quality notes.

- **URL**: https://apify.com/staros\_dev/public-business-directory-leads.md
- **Developed by:** [Eder Morales](https://apify.com/staros_dev) (community)
- **Categories:** Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Public Business Directory Leads

Bounded public-source lead extraction actor for local business prospecting.

### Best fit

Use this actor when you already know which public pages you want checked and want reviewable lead rows instead of raw fetch output.

Best-fit operators:

- local agencies validating small lead batches before outreach
- operators normalizing direct business sites plus official public records
- human reviewers who need explicit source diagnostics when a directory blocks automation

### What it does

- fetches only the explicit public `sourceUrls` provided in the run input
- optionally replaces blocked or timed-out primary sources with bounded `fallbackSourceUrls`
- executes the Proteus `public_business_directory_leads_v1` workload
- ranks normalized lead rows into a generic public output shape
- pushes lead rows to the default dataset
- stores the full result envelope in the default key-value store under `OUTPUT`

### Input

- `sourceUrls` is required and must contain one or more explicit public URLs
- `fallbackSourceUrls` is optional and should contain direct business sites or official public records you want Proteus to try when a primary source fails with a blocked or timeout condition
- `region`, `businessCategories`, `maxResults`, `pageLimit`, and `idempotencyKey` are optional

### Quick Start

1. Put the main public pages you want checked in `sourceUrls`.
2. Put backup official records or direct business sites in `fallbackSourceUrls`.
3. Keep `pageLimit` close to the number of URLs you submitted unless you want extra retry room.
4. Start with a small `maxResults` like `5` while you validate the source mix.

Recommended source mix:

- use `sourceUrls` for the main business pages or directory pages you want checked first
- use `fallbackSourceUrls` for official records or direct business sites that can still produce a useful lead if a large directory blocks the run

Recommended first run:

- 1 blocked-prone directory page in `sourceUrls`
- 1 direct business website in `sourceUrls`
- 1 official public record in `fallbackSourceUrls`
- `maxResults = 5`
- `pageLimit = 6`

### Paid Actor Contract

Stable marketplace-facing input fields:

- `sourceUrls`
- `fallbackSourceUrls`
- `region`
- `businessCategories`
- `maxResults`
- `pageLimit`
- `idempotencyKey`

Stable marketplace-facing output sections:

- `records`
- `errors`
- `source_diagnostics`
- `quality_summary`
- `execution_plan`

Current limits:

- at least 1 primary source URL and at most 25
- at most 25 fallback source URLs
- `maxResults` between 1 and 25
- `pageLimit` between 1 and 25

Current non-goals:

- no login-backed scraping
- no CAPTCHA bypass
- no hidden-browser anti-bot evasion
- no enrichment beyond the submitted public URLs and bounded fallback queue
- no guaranteed email extraction

### Output

Dataset rows contain public lead fields such as:

- `business_name`
- `business`
- `category`
- `city`
- `state`
- `phone`
- `website`
- `source_url`
- `fetched_source`
- `listing_url`
- `listing_page`
- `review_summary`
- `website_weaknesses`
- `opportunity_score`
- `opportunity`
- `verification_status`
- `verification`

Default dataset views:

- `Lead Review` shows rank, business, contact path, fetched source, verification, and run metadata in one table
- `Buyer Review` trims the table to the main buyer-facing columns for quick scanning after a run

Dataset-row alias rule:

- raw row fields stay present for compatibility
- buyer-facing aliases are added beside them so dataset exports read more like a public product

The default key-value store `OUTPUT` record preserves the full adapter envelope, including:

- `job_id`
- `status`
- `record_count`
- `error_count`
- `records`
- `errors`
- `source_diagnostics`
- `quality_summary`
- `buyer_presentation`
- `execution_plan`

Additional key-value store artifacts:

- `RUN_SUMMARY` contains the compact run summary plus `output_key`
- `ERRORS` is written only when the run returns one or more top-level errors

How to read the run:

- review the dataset for the ranked lead rows
- review `OUTPUT` when you need the full result envelope
- use `buyer_presentation` when you want buyer-facing labels and a one-line review headline before reading the raw sections
- review `source_diagnostics` to see which submitted URL blocked, failed, or produced records
- review `quality_summary` to decide whether the run is good enough for manual follow-up
- use `Buyer Review` first when you want the shortest operator scan
- use `Lead Review` when you need the fetched source, run metadata, or listing path beside the lead row

Common blocked-source pattern:

- a large directory may fail with `directory-fetch-blocked`
- a direct business site may still return a usable lead row
- an official record in `fallbackSourceUrls` may preserve a second lead row instead of wasting the remaining page budget

### Guardrails

- public web only
- no login-backed scraping
- no CAPTCHA bypass
- results are bounded to the submitted URLs

# Actor input Schema

## `sourceUrls` (type: `array`):

Paste the public URLs Proteus should check first. Good inputs are directory pages you already use, direct business websites, or public listing pages. This actor does not discover URLs for you.
## `fallbackSourceUrls` (type: `array`):

Optional backup URLs to use only when a primary source is blocked or times out. Best choices are direct business websites or official public records that can still produce a useful lead row.
## `region` (type: `string`):

Plain-English region label carried into the execution plan and ranking context. It does not trigger search discovery by itself.
## `businessCategories` (type: `array`):

Optional ranking hints. Choose categories that match the URLs you submitted, or type your own labels.
## `maxResults` (type: `integer`):

Maximum number of ranked lead rows to return in the dataset and OUTPUT artifact.
## `pageLimit` (type: `integer`):

Total page budget for both primary and fallback URLs. Keep this close to the number of URLs you submit unless you need extra retry room.
## `idempotencyKey` (type: `string`):

Optional stable key for reruns of the same request. Leave blank unless you want to track or deduplicate a repeated run.

## Actor input object example

```json
{
  "sourceUrls": [
    "https://www.yellowpages.com/vero-beach-fl/plumbers",
    "https://www.oliversplumbinginc.com/",
    "https://www.myfloridalicense.com/LicenseDetail.asp?SID=&id=A6B0336F081FC99BD705173C7AD92762"
  ],
  "fallbackSourceUrls": [
    "https://www.myfloridalicense.com/LicenseDetail.asp?SID=&id=A6B0336F081FC99BD705173C7AD92762"
  ],
  "region": "Indian River County, FL",
  "businessCategories": [
    "plumbing"
  ],
  "maxResults": 5,
  "pageLimit": 6
}
````

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "sourceUrls": [
        "https://www.yellowpages.com/vero-beach-fl/plumbers",
        "https://www.oliversplumbinginc.com/",
        "https://www.myfloridalicense.com/LicenseDetail.asp?SID=&id=A6B0336F081FC99BD705173C7AD92762"
    ],
    "fallbackSourceUrls": [
        "https://www.myfloridalicense.com/LicenseDetail.asp?SID=&id=A6B0336F081FC99BD705173C7AD92762"
    ],
    "region": "Indian River County, FL",
    "businessCategories": [
        "plumbing"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("staros_dev/public-business-directory-leads").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "sourceUrls": [
        "https://www.yellowpages.com/vero-beach-fl/plumbers",
        "https://www.oliversplumbinginc.com/",
        "https://www.myfloridalicense.com/LicenseDetail.asp?SID=&id=A6B0336F081FC99BD705173C7AD92762",
    ],
    "fallbackSourceUrls": ["https://www.myfloridalicense.com/LicenseDetail.asp?SID=&id=A6B0336F081FC99BD705173C7AD92762"],
    "region": "Indian River County, FL",
    "businessCategories": ["plumbing"],
}

# Run the Actor and wait for it to finish
run = client.actor("staros_dev/public-business-directory-leads").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "sourceUrls": [
    "https://www.yellowpages.com/vero-beach-fl/plumbers",
    "https://www.oliversplumbinginc.com/",
    "https://www.myfloridalicense.com/LicenseDetail.asp?SID=&id=A6B0336F081FC99BD705173C7AD92762"
  ],
  "fallbackSourceUrls": [
    "https://www.myfloridalicense.com/LicenseDetail.asp?SID=&id=A6B0336F081FC99BD705173C7AD92762"
  ],
  "region": "Indian River County, FL",
  "businessCategories": [
    "plumbing"
  ]
}' |
apify call staros_dev/public-business-directory-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=staros_dev/public-business-directory-leads",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Public Business Directory Leads",
        "description": "Fetch bounded public business-source URLs, use optional fallback URLs when retryable sources fail, rank candidate leads, and return a reviewable result envelope with source diagnostics and quality notes.",
        "version": "0.1",
        "x-build-id": "wDOcUAdLIMZ8yakra"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/staros_dev~public-business-directory-leads/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-staros_dev-public-business-directory-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/staros_dev~public-business-directory-leads/runs": {
            "post": {
                "operationId": "runs-sync-staros_dev-public-business-directory-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/staros_dev~public-business-directory-leads/run-sync": {
            "post": {
                "operationId": "run-sync-staros_dev-public-business-directory-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": [
                    "sourceUrls"
                ],
                "properties": {
                    "sourceUrls": {
                        "title": "Primary source URLs",
                        "minItems": 1,
                        "maxItems": 25,
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Paste the public URLs Proteus should check first. Good inputs are directory pages you already use, direct business websites, or public listing pages. This actor does not discover URLs for you.",
                        "items": {
                            "type": "string",
                            "pattern": "^https?://.+"
                        }
                    },
                    "fallbackSourceUrls": {
                        "title": "Fallback source URLs (optional)",
                        "maxItems": 25,
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Optional backup URLs to use only when a primary source is blocked or times out. Best choices are direct business websites or official public records that can still produce a useful lead row.",
                        "items": {
                            "type": "string",
                            "pattern": "^https?://.+"
                        }
                    },
                    "region": {
                        "title": "Region label (optional)",
                        "minLength": 1,
                        "maxLength": 120,
                        "type": "string",
                        "description": "Plain-English region label carried into the execution plan and ranking context. It does not trigger search discovery by itself."
                    },
                    "businessCategories": {
                        "title": "Business categories (optional)",
                        "maxItems": 25,
                        "type": "array",
                        "description": "Optional ranking hints. Choose categories that match the URLs you submitted, or type your own labels.",
                        "items": {
                            "type": "string",
                            "enumSuggestedValues": [
                                "plumbing",
                                "hvac",
                                "roofing",
                                "electrical",
                                "dentists",
                                "med spas",
                                "legal"
                            ]
                        }
                    },
                    "maxResults": {
                        "title": "How many leads to return",
                        "minimum": 1,
                        "maximum": 25,
                        "type": "integer",
                        "description": "Maximum number of ranked lead rows to return in the dataset and OUTPUT artifact.",
                        "default": 5
                    },
                    "pageLimit": {
                        "title": "How many pages to fetch",
                        "minimum": 1,
                        "maximum": 25,
                        "type": "integer",
                        "description": "Total page budget for both primary and fallback URLs. Keep this close to the number of URLs you submit unless you need extra retry room.",
                        "default": 6
                    },
                    "idempotencyKey": {
                        "title": "Run key (optional)",
                        "minLength": 1,
                        "maxLength": 200,
                        "type": "string",
                        "description": "Optional stable key for reruns of the same request. Leave blank unless you want to track or deduplicate a repeated run."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
