# OpenStreetMap Business Search (Overpass) (`crawlerbros/openstreetmap-business-search`) Actor

Search for businesses, amenities, and points of interest from OpenStreetMap using the free Overpass API. Find restaurants, hotels, pharmacies, hospitals, and 20+ other amenity types near a location or in any city worldwide.

- **URL**: https://apify.com/crawlerbros/openstreetmap-business-search.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Developer tools, Travel
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

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

## OpenStreetMap Business Search (Overpass)

Search for businesses, amenities, and points of interest from **OpenStreetMap** using the free Overpass API. Find restaurants, hotels, pharmacies, hospitals, and 25+ other place types in any city worldwide — no API key required.

### What you can search

- **Restaurants, cafes, bars, pubs, fast food**
- **Hotels, museums, cinemas, theatres, libraries**
- **Hospitals, clinics, pharmacies, dentists, doctors**
- **Banks, ATMs, post offices**
- **Schools, gyms, supermarkets, fuel stations, parking**
- And 10+ more amenity types

### Input

| Field | Type | Description | Default |
|---|---|---|---|
| `mode` | select | Search mode (see modes below) | `searchInCity` |
| `amenityType` | select | Type of place to search for | `restaurant` |
| `cityName` | string | City name (mode=searchInCity) | `New York` |
| `latitude` | number | Center latitude (mode=searchNearby) | — |
| `longitude` | number | Center longitude (mode=searchNearby) | — |
| `radiusMeters` | integer | Search radius in meters (100–50000) | `5000` |
| `country` | string | Optional ISO-2 country code filter (e.g. `US`, `GB`) | — |
| `maxItems` | integer | Maximum results to return (1–500) | `50` |

#### Modes

| Mode | Description |
|---|---|
| `searchNearby` | Find places near a latitude/longitude point within a radius |
| `searchInCity` | Find places in a city by name (e.g. "London", "New York") |
| `searchByType` | Search globally for an amenity type (add a country filter to limit scope) |

#### Supported Amenity Types

restaurant, cafe, hotel, hospital, pharmacy, school, bank, supermarket, parking, fuel, gym, cinema, theatre, museum, library, post_office, dentist, doctor, hairdresser, laundry, fast_food, bar, pub, clinic, atm

### Output

Each output record represents one place from OpenStreetMap:

```json
{
  "osmId": "123456789",
  "osmType": "node",
  "name": "Joe's Diner",
  "amenityType": "restaurant",
  "address": "100 Broadway, New York 10001, US",
  "street": "Broadway",
  "city": "New York",
  "state": "NY",
  "postcode": "10001",
  "country": "US",
  "phone": "+1 212 555 1234",
  "website": "https://joesdiner.com",
  "openingHours": "Mo-Fr 08:00-22:00",
  "latitude": 40.7128,
  "longitude": -74.006,
  "scrapedAt": "2026-06-03T10:00:00+00:00"
}
````

| Field | Type | Description |
|---|---|---|
| `osmId` | string | OpenStreetMap element ID |
| `osmType` | string | OSM element type: node, way, or relation |
| `name` | string | Name of the place |
| `amenityType` | string | OSM amenity/shop/tourism category |
| `address` | string | Full formatted address |
| `street` | string | Street name |
| `city` | string | City or town |
| `state` | string | State or province |
| `postcode` | string | Postal code |
| `country` | string | ISO country code |
| `phone` | string | Phone number |
| `website` | string | Website URL |
| `openingHours` | string | OSM opening hours string |
| `latitude` | float | Latitude coordinate |
| `longitude` | float | Longitude coordinate |
| `scrapedAt` | string | ISO 8601 timestamp of scrape |

### Data Source

Data is sourced from **OpenStreetMap** via the free **Overpass API** at `https://overpass-api.de/api/interpreter`. OpenStreetMap is a collaborative open-data map of the world. The Overpass API provides a free query interface — no registration or API key is required. A backup endpoint (`overpass.kumi.systems`) is used automatically if the primary is unavailable.

### FAQs

**How current is the data?**
OpenStreetMap data is updated continuously by volunteers worldwide. The Overpass API typically reflects changes within a few minutes.

**Why are some places missing contact info or addresses?**
OpenStreetMap is community-edited, so completeness varies. Urban areas in well-mapped regions (e.g. Western Europe, major US cities) tend to have more complete data.

**What is the `opening_hours` format?**
OSM uses a standard human-readable format like `Mo-Fr 08:00-22:00; Sa 09:00-20:00`. You can parse it with OSM opening-hours libraries.

**Can I search globally without a city?**
Yes, use `mode=searchByType`. For best results, add a `country` filter (2-letter ISO code) to limit scope — unconstrained global queries can time out on the Overpass API.

**Does this require an API key?**
No. The Overpass API is completely free to use. The actor respects rate limits with built-in delays between requests.

**What are `way` and `relation` osmTypes?**
Most individual businesses are `node` elements. Larger features (e.g. supermarket buildings, hospital campuses) may be `way` (polygon outline) or `relation` (complex area). The actor extracts center coordinates for ways so the location is always available.

# Actor input Schema

## `mode` (type: `string`):

How to search. searchNearby uses lat/lng + radius, searchInCity uses a city name, searchByType searches globally for a type.

## `amenityType` (type: `string`):

Type of place to search for. Select from 20+ common OSM amenity/shop types.

## `cityName` (type: `string`):

Name of the city to search in (e.g. 'London', 'New York', 'Paris', 'Tokyo'). Used when mode=searchInCity.

## `latitude` (type: `number`):

Latitude of the center point for nearby search. Used when mode=searchNearby.

## `longitude` (type: `number`):

Longitude of the center point for nearby search. Used when mode=searchNearby.

## `radiusMeters` (type: `integer`):

Radius around the center point to search (mode=searchNearby only). Larger radii may return more results but are slower.

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

Optional 2-letter ISO country code to filter results (e.g. 'US', 'GB', 'DE', 'FR'). Leave empty for all countries.

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

Maximum number of places to return per run.

## Actor input object example

```json
{
  "mode": "searchInCity",
  "amenityType": "restaurant",
  "cityName": "New York",
  "latitude": 40.7128,
  "longitude": -74.006,
  "radiusMeters": 5000,
  "maxItems": 30
}
```

# Actor output Schema

## `places` (type: `string`):

Dataset containing all scraped OpenStreetMap places, one record per location.

# 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 = {
    "mode": "searchInCity",
    "amenityType": "restaurant",
    "cityName": "New York",
    "latitude": 40.7128,
    "longitude": -74.006,
    "radiusMeters": 5000,
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/openstreetmap-business-search").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 = {
    "mode": "searchInCity",
    "amenityType": "restaurant",
    "cityName": "New York",
    "latitude": 40.7128,
    "longitude": -74.006,
    "radiusMeters": 5000,
    "maxItems": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/openstreetmap-business-search").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 '{
  "mode": "searchInCity",
  "amenityType": "restaurant",
  "cityName": "New York",
  "latitude": 40.7128,
  "longitude": -74.006,
  "radiusMeters": 5000,
  "maxItems": 30
}' |
apify call crawlerbros/openstreetmap-business-search --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "OpenStreetMap Business Search (Overpass)",
        "description": "Search for businesses, amenities, and points of interest from OpenStreetMap using the free Overpass API. Find restaurants, hotels, pharmacies, hospitals, and 20+ other amenity types near a location or in any city worldwide.",
        "version": "1.0",
        "x-build-id": "VYjzzB6MlRWDb9BM6"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~openstreetmap-business-search/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-openstreetmap-business-search",
                "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/crawlerbros~openstreetmap-business-search/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-openstreetmap-business-search",
                "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/crawlerbros~openstreetmap-business-search/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-openstreetmap-business-search",
                "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": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "searchNearby",
                            "searchInCity",
                            "searchByType"
                        ],
                        "type": "string",
                        "description": "How to search. searchNearby uses lat/lng + radius, searchInCity uses a city name, searchByType searches globally for a type.",
                        "default": "searchInCity"
                    },
                    "amenityType": {
                        "title": "Amenity / Place Type",
                        "enum": [
                            "restaurant",
                            "cafe",
                            "hotel",
                            "hospital",
                            "pharmacy",
                            "school",
                            "bank",
                            "supermarket",
                            "parking",
                            "fuel",
                            "gym",
                            "cinema",
                            "theatre",
                            "museum",
                            "library",
                            "post_office",
                            "dentist",
                            "doctor",
                            "hairdresser",
                            "laundry",
                            "fast_food",
                            "bar",
                            "pub",
                            "clinic",
                            "atm"
                        ],
                        "type": "string",
                        "description": "Type of place to search for. Select from 20+ common OSM amenity/shop types.",
                        "default": "restaurant"
                    },
                    "cityName": {
                        "title": "City Name (mode=searchInCity)",
                        "type": "string",
                        "description": "Name of the city to search in (e.g. 'London', 'New York', 'Paris', 'Tokyo'). Used when mode=searchInCity."
                    },
                    "latitude": {
                        "title": "Latitude (mode=searchNearby)",
                        "minimum": -90,
                        "maximum": 90,
                        "type": "number",
                        "description": "Latitude of the center point for nearby search. Used when mode=searchNearby."
                    },
                    "longitude": {
                        "title": "Longitude (mode=searchNearby)",
                        "minimum": -180,
                        "maximum": 180,
                        "type": "number",
                        "description": "Longitude of the center point for nearby search. Used when mode=searchNearby."
                    },
                    "radiusMeters": {
                        "title": "Search Radius (meters)",
                        "minimum": 100,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Radius around the center point to search (mode=searchNearby only). Larger radii may return more results but are slower.",
                        "default": 5000
                    },
                    "country": {
                        "title": "Country Filter (optional ISO code)",
                        "type": "string",
                        "description": "Optional 2-letter ISO country code to filter results (e.g. 'US', 'GB', 'DE', 'FR'). Leave empty for all countries."
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of places to return per run.",
                        "default": 50
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
