# OpenStreetMap POI Extractor (`cardinal_radiance_bce/apify-openstreetmap-poi-extractor`) Actor

Extract points-of-interest (cafes, restaurants, shops, estate agents, hotels, pharmacies, gyms, pubs) from OpenStreetMap via the public Overpass API. Filter by bounding box, point radius or UK postcode. ODbL data — free commercial reuse with attribution.

- **URL**: https://apify.com/cardinal_radiance_bce/apify-openstreetmap-poi-extractor.md
- **Developed by:** [Tristan Evans](https://apify.com/cardinal_radiance_bce) (community)
- **Categories:** Business, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 per poi extracteds

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/running/actors-in-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 POI Extractor

Extract points-of-interest (POIs) from OpenStreetMap via the public Overpass API — cafes, restaurants, shops, estate agents, hotels, pharmacies, gyms, pubs and more — for lead generation, local business lists and market research.

### Data

All data comes from OpenStreetMap and is licensed under the **Open Database License (ODbL)** — free to reuse commercially with attribution and share-alike.

- https://wiki.openstreetmap.org/wiki/Open_Database_License
- https://overpass-api.de (public Overpass API, no API key required)

### Search modes

| Mode | Description | Example input |
|------|-------------|---------------|
| `bbox` | POIs inside a bounding box | `{ "mode": "bbox", "minLat": 51.49, "minLon": -0.14, "maxLat": 51.51, "maxLon": -0.10, "categories": "cafe,restaurant" }` |
| `point` | POIs within N metres of a lat/lon point | `{ "mode": "point", "lat": 51.5074, "lon": -0.1278, "radius": 500 }` |
| `postcode` | UK postcode geocoded via postcodes.io, then radius search | `{ "mode": "postcode", "postcode": "SW1A 1AA", "radius": 500 }` |

Categories (comma-separated): `cafe`, `restaurant`, `shop`, `estate_agent`, `hotel`, `pharmacy`, `gym`, `pub`.

### Output

Each record: `osm_type`, `osm_id`, `lat`, `lon`, `name`, `category`, `brand`, `street`, `housenumber`, `postcode`, `city`, `country`, `phone`, `website`, `opening_hours`, `wheelchair`.

### Pricing

**Pay-per-event**: $0.005 per POI record extracted ($5 per 1,000 POIs). Apify keeps a 20% platform margin; you keep ~80% of each run fee. There is no listing fee, no monthly charge, and no free allowance — every POI record saved to the dataset is metered.

Example costs (owner's ~80% share):

- 100 POIs: $0.40 listed ($0.32 to you)
- 500 POIs: $2.50 listed ($2.00 to you)
- 1000 POIs: $5.00 listed ($4.00 to you)

### Local run

```bash
python main.py --check
python main.py --run --mode postcode --postcode SW1A1AA --radius 500 --categories cafe,restaurant
python main.py --earnings
```

`--check` validates the setup, `--run` performs a live extraction against the public Overpass API and prints the POIs found, `--earnings` reports lifetime earnings through the shared earnings report.

### Attribution

Contains OpenStreetMap data © OpenStreetMap contributors, licensed under ODbL.
Contains data from postcodes.io (https://postcodes.io/) used only for UK postcode geocoding.

### Example output

Example input:

```json
{
  "mode": "postcode",
  "postcode": "SW1A 1AA",
  "radius": 300,
  "categories": "cafe,restaurant,shop",
  "maxResults": 3
}
```

One record per POI, saved to the Apify dataset. Example rows illustrate the output shape; values are typical of real OpenStreetMap entries near Westminster.

| osm_type | osm_id | lat | lon | name | category | brand | street | housenumber | postcode | city | country | phone | website | opening_hours | wheelchair |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Way | 12345678 | 51.5007 | -0.1246 | The Wolseley | restaurant | The Wolseley | 160 | Piccadilly | W1J 9DJ | London | GB | +44 20 7499 6996 | https://www.thewolseley.com | Mo-Su 08:00-23:00 | yes |
| Node | 98765432 | 51.5014 | -0.1419 | Pret A Manger | cafe | Pret A Manger | 23 | ... | SW1A ... | London | GB | +44 20 7xxx xxxx | ... | Mo-Fr 07:00-19:00 | yes |
| Way | 11223344 | 51.5072 | -0.1275 | Tesco Express | shop | Tesco | ... | ... | ... | London | GB | ... | ... | Mo-Su 06:00-23:00 | no |

Records with no value for a field (e.g. phone or opening_hours) have that field left null. Category is one of `cafe`, `restaurant`, `shop`, `estate_agent`, `hotel`, `pharmacy`, `gym`, `pub`.

### FAQ

**Q: What does it cost?**\
A: Pay-per-event on Apify Store: $0.005 per POI record extracted. Apify keeps a 20% platform margin; you keep ~80% of each run fee. There is no listing fee or monthly charge. No "first N free" allowance is set on this listing.

**Q: Do I need an API key or an OpenStreetMap account?**\
A: No. It calls the public Overpass API directly (no key required) and geocodes UK postcodes via the free postcodes.io API.

**Q: Which sources does it cover?**\
A: OpenStreetMap, worldwide — so it works anywhere, not just the UK. The postcode mode is UK-only because it uses postcodes.io.

**Q: Can I use the data commercially?**\
A: Yes. OpenStreetMap data is under the Open Database License (ODbL): free to reuse commercially with attribution and share-alike (see the Attribution section).

**Q: Why did my run return 0 POIs?**\
A: Try a wider radius, more categories, or drop the category filter. OpenStreetMap is volunteer-mapped, so some areas simply have few POIs of a given category.

### Price comparison

**OpenStreetMap POI Extractor (this actor)** — public OSM data is free; pay-per-event on Apify Store at $0.005 per POI record extracted, ~80% to you after Apify's 20% margin, no listing fee or monthly charge. Listing price set by the owner on publication and shown on the Store page (Apify subscription/credits apply per your plan).

**automation-lab/openstreetmap-poi-extractor** — real rival listing (112 total users, 2,129 total runs); public rate card $0.005 per **run start**, not per POI.

**Why this one** — same data source (public Overpass API), so the differentiator is ease of use, UK postcode input, and the worked example table — not a price we can verify against the rival's hidden per-POI rate.

### Also see

- [UK Food Hygiene Ratings Scraper](../uk-food-hygiene-ratings/README.md) — FSA food hygiene ratings ($0.003/record, first 50 free)
- [UK Public Sector Tender Tracker](../apify-uk-tender-tracker/README.md) — UK public tenders from Find a Tender + Contracts Finder ($0.003/tender)
- [UK Asbestos Register](../apify-uk-asbestos-register/README.md) — HSE-licensed asbestos contractors ($0.005/contractor)
- [Career Site Jobs API](../career-jobs/README.md) — Greenhouse, Lever, Ashby, Workable, SmartRecruiters, Recruitee jobs ($3/1k jobs)
- [Workday Jobs API](../workday-jobs/README.md) — every job from any Workday career site ($1/1k jobs)
- [Website Contact Extractor](../contact-extractor/README.md) — business emails, phones and socials per domain ($1.50/1k sites)
- [Article Scraper](../web-scraper/README.md) — article titles, authors, dates, tags and CTA links ($2/1k articles)
- [Bulk Domain Check](../domain-check/README.md) — domain availability, RDAP, DNS and SPF/DMARC in bulk ($1/1k domains)

# Actor input Schema

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

How to find POIs: bounding box, point radius, or UK postcode

## `minLat` (type: `number`):

Southern edge of bounding box (bbox mode)

## `minLon` (type: `number`):

Western edge of bounding box (bbox mode)

## `maxLat` (type: `number`):

Northern edge of bounding box (bbox mode)

## `maxLon` (type: `number`):

Eastern edge of bounding box (bbox mode)

## `lat` (type: `number`):

Centre latitude (point mode)

## `lon` (type: `number`):

Centre longitude (point mode)

## `radius` (type: `integer`):

Search radius around the point or postcode (point/postcode modes)

## `postcode` (type: `string`):

UK postcode to geocode and search around (postcode mode)

## `categories` (type: `string`):

Comma-separated categories: cafe, restaurant, shop, estate_agent, hotel, pharmacy, gym, pub

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

Maximum number of POIs to extract per run

## `dryRun` (type: `boolean`):

Build and validate the query without calling Overpass (no records extracted)

## Actor input object example

```json
{
  "mode": "point",
  "minLat": 51.5,
  "minLon": -0.13,
  "maxLat": 51.52,
  "maxLon": -0.11,
  "lat": 51.5074,
  "lon": -0.1278,
  "radius": 1000,
  "postcode": "SW1A 1AA",
  "categories": "cafe,restaurant,shop,estate_agent",
  "maxResults": 500,
  "dryRun": false
}
```

# Actor output Schema

## `pois` (type: `string`):

Every POI extracted in this run

## `overview` (type: `string`):

Name, category, address and contact details

# 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 = {
    "postcode": "SW1A 1AA"
};

// Run the Actor and wait for it to finish
const run = await client.actor("cardinal_radiance_bce/apify-openstreetmap-poi-extractor").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 = { "postcode": "SW1A 1AA" }

# Run the Actor and wait for it to finish
run = client.actor("cardinal_radiance_bce/apify-openstreetmap-poi-extractor").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 '{
  "postcode": "SW1A 1AA"
}' |
apify call cardinal_radiance_bce/apify-openstreetmap-poi-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cardinal_radiance_bce/apify-openstreetmap-poi-extractor"
        }
    }
}
```

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/wd9Mdr6UjPy0OS7N9/builds/Tx42SBnLX30gy3J93/openapi.json
