# OSM Business Lead Generator — Free B2B Leads from OpenStreetMap (`yuchiaoniu/osm-business-lead-generator`) Actor

Generate B2B business leads from OpenStreetMap open data. Search by category (dentist, restaurant, hotel) and city. Free data, no API key needed.

- **URL**: https://apify.com/yuchiaoniu/osm-business-lead-generator.md
- **Developed by:** [Niu Yuchiao](https://apify.com/yuchiaoniu) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 33.3% 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

## OSM Business Lead Generator — Free B2B Leads from OpenStreetMap

Generate verified B2B business leads from **OpenStreetMap** open data — completely free, no API key required, no anti-scraping limitations. Search by business category and city, and get name, address, phone, website, coordinates, and more.

### Why OpenStreetMap?

| Feature | OSM (This Actor) | Google Maps Scraper |
|---------|-----------------|---------------------|
| Cost | Free data | Expensive compute |
| Reliability | 100% (open API) | Varies (blocks) |
| Legal | ODbL open license | TOS grey area |
| Speed | Very fast | Slow (browser) |
| Coverage | 190+ countries | 190+ countries |

OpenStreetMap has **over 1 billion nodes** of business data contributed by millions of volunteers worldwide. For B2B prospecting, this is often more current than Google Maps because local businesses update their own OSM listings.

### Use Cases

- **Sales prospecting**: Find dental clinics, law firms, restaurants, hotels in any city
- **Market research**: Count competitors by category and location  
- **CRM enrichment**: Add addresses, phones, websites to your lead lists
- **Local SEO agencies**: Audit business listing coverage in any area
- **Healthcare outreach**: Find hospitals, pharmacies, clinics, doctors

### Supported Business Types

#### Healthcare
`dentist` · `doctor` · `hospital` · `pharmacy` · `clinic` · `optician` · `physiotherapist`

#### Food & Hospitality
`restaurant` · `cafe` · `bar` · `fast_food` · `hotel` · `hostel` · `guest_house`

#### Professional Services
`lawyer` · `accountant` · `insurance` · `bank` · `post_office`

#### Retail
`supermarket` · `convenience` · `bakery` · `hairdresser` · `beauty` · `electronics`

#### Education & Fitness
`school` · `university` · `gym` · `sports_centre` · `swimming_pool`

*Any valid OpenStreetMap `amenity=` or `shop=` tag is supported.*

### Input

```json
{
  "businessType": "dentist",
  "city": "Taipei",
  "country": "TW",
  "maxResults": 100,
  "includeCoordinates": true
}
````

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `businessType` | String | ✅ | OSM amenity/shop tag (e.g., `dentist`, `restaurant`, `hotel`) |
| `city` | String | ✅ | English city name (e.g., `Taipei`, `Tokyo`, `Berlin`) |
| `country` | String | | ISO country code (e.g., `TW`, `US`, `JP`) — improves accuracy |
| `maxResults` | Integer | | Max leads to return, 1–1000 (default: 100) |
| `includeCoordinates` | Boolean | | Include lat/lon in output (default: true) |

### Output

Each record in the dataset:

```json
{
  "name": "Dr. Chen Dental Clinic",
  "category": "dentist",
  "address": "123 Zhongshan N. Rd., Zhongshan District",
  "street": "Zhongshan N. Rd.",
  "city": "Taipei",
  "postcode": "10401",
  "country": "TW",
  "phone": "+886 2 1234 5678",
  "website": "https://example.com",
  "email": "contact@example.com",
  "openingHours": "Mo-Fr 09:00-18:00",
  "lat": 25.0639,
  "lon": 121.5278,
  "osmId": 1234567890,
  "osmType": "node",
  "sourceUrl": "https://www.openstreetmap.org/node/1234567890"
}
```

After the run, a summary is also saved to the Key-Value store (`OUTPUT_SUMMARY`) with total count and stats on how many leads have phone, website, and email.

### Tips for Best Results

1. **Use English city names** — `Taipei` not `台北市`, `Tokyo` not `東京`
2. **Large cities return more results** — `London` beats `Kensington`
3. **Combine with other data** — Use the `sourceUrl` to link back to OSM for the most up-to-date info
4. **Export to CSV** — In the dataset view, click "Export to CSV" for use in Excel or CRM

### Data License

All data is sourced from [OpenStreetMap](https://www.openstreetmap.org/) under the [Open Database License (ODbL)](https://opendatacommons.org/licenses/odbl/). You are free to use this data commercially, with attribution to OpenStreetMap contributors.

### Integrate with Your Stack

#### Export to CSV (no code)

Click "Export" → "CSV" in the Apify Console dataset view.

#### Via Apify API

```javascript
const { ApifyClient } = require('apify-client');
const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('yuchiaoniu/osm-business-lead-generator').call({
    businessType: 'dentist',
    city: 'Tokyo',
    country: 'JP',
    maxResults: 500,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items); // Array of business leads
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("yuchiaoniu/osm-business-lead-generator").call(run_input={
    "businessType": "restaurant",
    "city": "Berlin",
    "country": "DE",
    "maxResults": 200,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
```

### FAQ

**Is this legal?**
Yes. OpenStreetMap data is licensed under ODbL, which permits commercial use with attribution. No website is being scraped; we query the official Overpass API.

**Why is my city returning 0 results?**
Try using the English name of the city, and check that the `businessType` is a valid OSM tag. Smaller cities may have less coverage in OSM.

**What's the maximum results I can get?**
The Actor supports up to 1,000 results per run. For larger datasets, run multiple queries with different cities.

**Does this data include emails?**
Only if the business has listed their email on OpenStreetMap. Coverage varies — expect about 5–15% of records to have email addresses.

**How fresh is the data?**
OpenStreetMap is updated continuously by contributors. Major cities are typically updated within days to weeks of real-world changes.

# Actor input Schema

## `businessType` (type: `string`):

OpenStreetMap amenity or shop type. Examples: dentist, restaurant, hotel, pharmacy, gym, supermarket, lawyer, doctor, hospital, school

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

City name to search in. Examples: Taipei, Tokyo, New York, London, Berlin

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

ISO 3166-1 alpha-2 country code. Examples: TW, US, JP, GB, DE

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

Maximum number of business leads to return (1–1000)

## `includeCoordinates` (type: `boolean`):

Include latitude/longitude in output

## `outputFormat` (type: `string`):

Choose output format

## Actor input object example

```json
{
  "businessType": "dentist",
  "city": "Taipei",
  "country": "TW",
  "maxResults": 100,
  "includeCoordinates": true,
  "outputFormat": "dataset"
}
```

# 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 = {
    "businessType": "dentist",
    "city": "Taipei"
};

// Run the Actor and wait for it to finish
const run = await client.actor("yuchiaoniu/osm-business-lead-generator").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 = {
    "businessType": "dentist",
    "city": "Taipei",
}

# Run the Actor and wait for it to finish
run = client.actor("yuchiaoniu/osm-business-lead-generator").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 '{
  "businessType": "dentist",
  "city": "Taipei"
}' |
apify call yuchiaoniu/osm-business-lead-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=yuchiaoniu/osm-business-lead-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "OSM Business Lead Generator — Free B2B Leads from OpenStreetMap",
        "description": "Generate B2B business leads from OpenStreetMap open data. Search by category (dentist, restaurant, hotel) and city. Free data, no API key needed.",
        "version": "1.0",
        "x-build-id": "kUMXkQXJkR0C0eQPC"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/yuchiaoniu~osm-business-lead-generator/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-yuchiaoniu-osm-business-lead-generator",
                "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/yuchiaoniu~osm-business-lead-generator/runs": {
            "post": {
                "operationId": "runs-sync-yuchiaoniu-osm-business-lead-generator",
                "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/yuchiaoniu~osm-business-lead-generator/run-sync": {
            "post": {
                "operationId": "run-sync-yuchiaoniu-osm-business-lead-generator",
                "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": [
                    "businessType",
                    "city"
                ],
                "properties": {
                    "businessType": {
                        "title": "Business Type",
                        "type": "string",
                        "description": "OpenStreetMap amenity or shop type. Examples: dentist, restaurant, hotel, pharmacy, gym, supermarket, lawyer, doctor, hospital, school",
                        "default": "dentist"
                    },
                    "city": {
                        "title": "City / Region",
                        "type": "string",
                        "description": "City name to search in. Examples: Taipei, Tokyo, New York, London, Berlin",
                        "default": "Taipei"
                    },
                    "country": {
                        "title": "Country Code",
                        "type": "string",
                        "description": "ISO 3166-1 alpha-2 country code. Examples: TW, US, JP, GB, DE",
                        "default": "TW"
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of business leads to return (1–1000)",
                        "default": 100
                    },
                    "includeCoordinates": {
                        "title": "Include GPS Coordinates",
                        "type": "boolean",
                        "description": "Include latitude/longitude in output",
                        "default": true
                    },
                    "outputFormat": {
                        "title": "Output Format",
                        "enum": [
                            "dataset",
                            "csv-compatible"
                        ],
                        "type": "string",
                        "description": "Choose output format",
                        "default": "dataset"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
