# Local Business Intelligence (`moving_beacon-owner1/local-business-intelligence`) Actor

Local Business Discovery & Market Monitor — finds businesses by keyword and location from public sources, removes duplicates, and optionally tracks new and disappeared businesses between runs.

- **URL**: https://apify.com/moving\_beacon-owner1/local-business-intelligence.md
- **Developed by:** [Jamshaid Arif](https://apify.com/moving_beacon-owner1) (community)
- **Categories:** Lead generation, Agents, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $9.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Local Business Intelligence

Discover local businesses for any keyword and location from **public sources**
(Bing Maps worldwide, Yellow Pages US), de-duplicated into clean canonical
records — and optionally **monitor the market between runs** to flag newly
appeared and disappeared businesses.

### What does this Actor do?

1. **Discovery** — searches Bing Maps and/or Yellow Pages for your keyword near
   a city / state / postal code / country.
2. **De-duplication** — merges records that refer to the same business (by
   name + website/phone/address) into one canonical entry.
3. **Change monitoring** *(optional)* — compares the current result set against
   the previous run (stored in the Apify key-value store) and marks each
   business `isNew`, plus emits a summary with `newCount` / `removedCount`.

Runs on the Apify platform with proxy rotation, scheduling, API access and
dataset export built in.

### Why use it?

- Build and maintain a **fresh local-business directory** for a market.
- Get alerted to **new entrants** (competitors, prospects, acquisition targets)
  by scheduling the Actor and reading the `isNew` flag.

### How to use it

1. Enter a **keyword** (e.g. `coffee shop`) and a location (`city`, `state`,
   `postalCode`, `country`).
2. Choose your **sources** and a **maxResults** cap.
3. Turn on **Monitor new businesses** and **schedule** the Actor to track the
   market over time.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `keyword` | string (required) | Business category/keyword to search. |
| `country` / `state` / `city` / `postalCode` | string | Where to search. |
| `sources` | array | `bing_maps`, `yellowpages` (default `bing_maps`). |
| `maxResults` | integer | Max businesses to return (default 100). |
| `monitorNewBusinesses` | boolean | Flag new/removed vs. the previous run (default false). |
| `proxyConfiguration` | object | Proxy settings (residential US recommended for Yellow Pages). |

#### Input example

```json
{
  "keyword": "coffee shop",
  "city": "Austin",
  "state": "TX",
  "country": "USA",
  "sources": ["bing_maps"],
  "maxResults": 100,
  "monitorNewBusinesses": true
}
```

### Output

One record per business plus, when monitoring is on, a `monitoringSummary`
record.

| Field | Description |
| --- | --- |
| `business` / `name` | Business name. |
| `category` | Category. |
| `address`, `city`, `state`, `country` | Location. |
| `phone`, `email`, `website` | Contact details. |
| `rating`, `reviewCount` | Public review signals. |
| `latitude`, `longitude`, `coordinates` | Geo coordinates. |
| `sourceUrl`, `source` | Where the record came from. |
| `isNew` | Only when monitoring: true if not seen in the previous run. |

#### Output example

```json
{
  "business": "Radio Coffee",
  "category": "coffee shop",
  "address": "1 Main St",
  "city": "Austin",
  "state": "TX",
  "phone": "(512) 555-0100",
  "website": "https://radiocoffee.com",
  "rating": 4.7,
  "reviewCount": 812,
  "latitude": 30.24,
  "longitude": -97.77,
  "coordinates": { "latitude": 30.24, "longitude": -97.77 },
  "sourceUrl": "https://www.bing.com/maps",
  "source": "bing_maps",
  "isNew": true
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Monitoring & state

- With `monitorNewBusinesses` enabled, the current result set is snapshotted in
  the Apify **key-value store** (namespaced per keyword + location). The next
  run diffs against it — `isNew` marks entrants and a `monitoringSummary`
  reports `newCount` and `removedCount`.
- The first run marks every business `isNew` (nothing to compare against yet).

### Sources & configuration

- **Bing Maps** — worldwide, no browser, fast.
- **Yellow Pages** — US only; needs a **US residential proxy** in practice.
- **Environment variables** — none required. Apify Proxy password is injected by the platform.

### Local execution

```bash
pip install -r requirements.txt
## put input in storage/key_value_stores/default/INPUT.json
python src/main.py
```

# Actor input Schema

## `keyword` (type: `string`):

Business category or keyword to search for, e.g. 'plumbers' or 'coffee shop'.

## `country` (type: `string`):

Country to search within (optional).

## `state` (type: `string`):

State or region (optional).

## `city` (type: `string`):

City to search within (optional).

## `postalCode` (type: `string`):

Postal or ZIP code to narrow the search (optional).

## `sources` (type: `array`):

Which business-discovery sources to query.

## `maxResults` (type: `integer`):

Maximum number of businesses to return.

## `monitorNewBusinesses` (type: `boolean`):

Compare against the previous run (stored in the key-value store) and flag newly appeared / disappeared businesses.

## `proxyConfiguration` (type: `object`):

Proxy settings. Residential US proxies are recommended for Yellow Pages.

## `cookies` (type: `string`):

Optional Cookie header string to replay on every request (for sites behind a challenge).

## Actor input object example

```json
{
  "keyword": "coffee shop",
  "city": "Austin",
  "sources": [
    "bing_maps"
  ],
  "maxResults": 100,
  "monitorNewBusinesses": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "keyword": "coffee shop",
    "city": "Austin"
};

// Run the Actor and wait for it to finish
const run = await client.actor("moving_beacon-owner1/local-business-intelligence").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 = {
    "keyword": "coffee shop",
    "city": "Austin",
}

# Run the Actor and wait for it to finish
run = client.actor("moving_beacon-owner1/local-business-intelligence").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "keyword": "coffee shop",
  "city": "Austin"
}' |
apify call moving_beacon-owner1/local-business-intelligence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,moving_beacon-owner1/local-business-intelligence"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/cqt9gcZsYRxGlYRjo/builds/28ITgpRF4gR95iMrS/openapi.json
