# OpenStreetMap Business Leads (`automatic/osm-business-leads`) Actor

Build local business lists from OpenStreetMap. Find mapped cafés, shops and trades by category and radius, with source links, addresses and websites where available. Schedule exports of new or changed places for your CRM or directory.

- **URL**: https://apify.com/automatic/osm-business-leads.md
- **Developed by:** [Philip Kirkbride](https://apify.com/automatic) (community)
- **Categories:** Lead generation, Business
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.75 / 1,000 business rows

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/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## OpenStreetMap Business Leads

Build local business lists by category and radius, with a source link for every place. Schedule a search to get newly mapped businesses and changes to records you already received. Use the results to update a CRM, build a directory, or see which businesses have a website listed on OpenStreetMap.

- **Choose a local market.** Search up to five areas for cafés, restaurants, shops, hospitality, or trades.
- **Export mapped business details.** Get names, addresses, coordinates, opening hours, and contact details when mapped. Filter your export using the `hasWebsite` column.
- **Keep lists current.** Reuse a state key on a schedule and receive only new or changed entries. Export the dataset as CSV, JSON, or Excel.

### Start with one search

Run the Actor with no input to sample five cafés in central London. The Console starts with the same example.

```json
{
  "searches": [
    {"region": "europe", "category": "cafe", "latitude": 51.5137, "longitude": -0.1367, "radiusMeters": 400}
  ],
  "maxItems": 5
}
```

Use decimal latitude and longitude at the center of your search and a radius of 100 to 5,000 metres. Choose the region that covers your coordinates. The search returns named places in the selected category.

| Region | Source extract |
| --- | --- |
| `europe` | Europe |
| `north-america` | North America |
| `asia` | Asia |
| `south-america` | South America |

Supported categories are `cafe`, `restaurant`, `fast_food`, `pub`, `bar`, `bakery`, `supermarket`, `convenience`, `hairdresser`, `beauty`, `florist`, `bicycle`, `car_repair`, `hotel`, `guest_house`, `fitness_centre`, `plumber`, and `electrician`.

Custom searches default to 100 delivered rows. Set `maxItems` between 1 and 1,000 for the entire run.

### Schedule new and changed places

Set `onlyNewSinceLastRun` to `true`, choose a `stateKey` such as `london-cafes`, and schedule the same searches. The first run labels places `new`. Later runs export new IDs and rows with changed mapped fields or tags. A quiet run reports `no_results` with the reason `No new or changed places`. Search lists with different categories or coordinates have separate history.

If a limit stops delivery, the next run can pick up changes that are still visible. Keep the same key and searches when changing `maxItems`. Different schedules can use different state keys.

### Dataset and run summary

Each row includes the type-qualified `osmId` (for example, `node/348871686`), its OpenStreetMap URL, name, mapped categories, coordinates, address, website, phone, email, opening hours, and source tags. Scheduled runs add `changeType` with `new` or `changed`.

The `OUTPUT` record lists results by search with the source snapshot timestamp, skipped searches, and any stop reason. Use it to distinguish a completed empty search, a partial run with the rows saved so far, and a source failure.

### Data coverage and limits

OpenStreetMap is edited by volunteers. Contact details depend on the mappings available. `hasWebsite=false` means the mapped record has no website value. Ways and relations use the center of their bounding box when available. Separately mapped elements may represent the same physical business. The regional extracts update periodically and may lag the live map.

A search checks up to 1,000 source elements. Use a smaller radius when a high-density area reaches that bound. A scheduled scope keeps up to 20,000 delivered IDs. Once full, it continues to deliver changes to tracked places and reports skipped new IDs in the affected searches. Use a new state key to start a fresh history. The monitor reports observed additions and changes. Missing places do not create removal rows.

Data © OpenStreetMap contributors, available under the Open Database License (ODbL). Keep appropriate attribution when displaying or sharing the data, and review the share-alike terms before redistributing a derivative database. [OpenStreetMap copyright and licence](https://www.openstreetmap.org/copyright)

### Use it as an API

Refresh one mapped business by its OpenStreetMap element ID. Get the answer in JSON from one HTTPS call. Call it from an AI agent through an HTTP-capable MCP tool, or add an HTTP request step in n8n, Make, or Zapier.

```bash
curl --get 'https://automatic--osm-business-leads.apify.actor/' \
  --header "Authorization: Bearer $APIFY_TOKEN" \
  --data-urlencode region=europe \
  --data-urlencode elementType=node \
  --data-urlencode elementId=348871686
```

Send the same fields as a JSON object with `POST /`. Results are in `data`. See `GET /openapi.json` for the request and response definitions.

Use the region of the place and the element type and ID in its OpenStreetMap link.

### Pricing

Batch runs cost $0.75 per 1,000 business rows saved, plus a $0.001 start fee per started GB of run memory. The start fee is $0.001 at 128 MB and applies even when a scheduled check finds no changes. The lookup API costs $0.001 per successful business lookup.

# Actor input Schema

## `searches` (type: `array`):

Add up to five searches with region, category, latitude, longitude, and radiusMeters (100 to 5000). See the README for regions and categories.

## `maxItems` (type: `integer`):

Total rows to save across searches. The sample returns up to five. The default for custom searches is 100.

## `onlyNewSinceLastRun` (type: `boolean`):

Compare against places delivered for this search set and state key.

## `stateKey` (type: `string`):

Required for scheduled change tracking. Reuse the key and search set for each repeat.

## Actor input object example

```json
{
  "searches": [
    {
      "region": "europe",
      "category": "cafe",
      "latitude": 51.5137,
      "longitude": -0.1367,
      "radiusMeters": 400
    }
  ],
  "maxItems": 5
}
```

# Actor output Schema

## `businesses` (type: `string`):

No description

## `summary` (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 = {
    "searches": [
        {
            "region": "europe",
            "category": "cafe",
            "latitude": 51.5137,
            "longitude": -0.1367,
            "radiusMeters": 400
        }
    ],
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("automatic/osm-business-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 = {
    "searches": [{
            "region": "europe",
            "category": "cafe",
            "latitude": 51.5137,
            "longitude": -0.1367,
            "radiusMeters": 400,
        }],
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("automatic/osm-business-leads").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 '{
  "searches": [
    {
      "region": "europe",
      "category": "cafe",
      "latitude": 51.5137,
      "longitude": -0.1367,
      "radiusMeters": 400
    }
  ],
  "maxItems": 5
}' |
apify call automatic/osm-business-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automatic/osm-business-leads"
        }
    }
}
```

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/zAVDTUpQe692g4IaU/builds/vtPDbbSRDOR95l5Py/openapi.json
