
OpenStreetMap Points of Interest Extractor
Under maintenance
Pricing
$10.00/month + usage

OpenStreetMap Points of Interest Extractor
Under maintenance
Extract OSM points of interest (restaurants, schools,...) in a specified area. Provide a place name or bounding box; pick a POI. Actor builds an Overpass query, retrieves JSON, parses name, address, metadata, coords, and outputs a table.
0.0 (0)
Pricing
$10.00/month + usage
0
Total users
2
Monthly users
2
Runs succeeded
>99%
Last modified
5 days ago
Overpass OSM Data Extractor in Python A template for extracting tagged points of interest from OpenStreetMap (OSM) within a specified area using Python. Provide either a place name or a bounding box and select an OSM tag value (e.g. “restaurant,” “school,” or “park”). The actor geocodes the place via Nominatim (if needed), constructs an Overpass QL query, and returns all matching items as a structured dataset.
Included features Apify SDK for actor initialization, input validation, and dataset storage
Nominatim geocoding (via requests) to convert a place name into a latitude/longitude bounding box
Overpass QL query builder to fetch nodes, ways, and relations matching an OSM tag key/value
HTTPX or requests (synchronous POST) to send the Overpass query and retrieve JSON
JSON normalization of OSM elements: extracts id, type, tags, and centroid coordinates
Clean dataset output: each item is pushed as a JSON object with standardized fields
Configurable input schema for “place,” “boundingBox,” and “value,” ensuring valid OSM‐tag selections
How it works Actor.get_input() retrieves user input, which may include:
place (e.g. “Amsterdam, Netherlands”) or
boundingBox (“south,west,north,east”)
value (one of the supported OSM‐tag values, e.g. “restaurant”)
If a place name is provided and no bounding box is given, geocode_place() calls Nominatim to obtain (south, west, north, east).
The actor looks up the corresponding OSM‐tag key via a VALUE_TO_KEY mapping (e.g. “restaurant” → amenity).
It builds an Overpass QL string:
overpass Kopiëren Bewerken [out:json][timeout:25]; ( nodesouth,west,north,east; waysouth,west,north,east; relationsouth,west,north,east; ); out center; The actor sends the query to https://overpass-api.de/api/interpreter via an HTTP POST.
When JSON returns, the code iterates through elements:
For nodes, uses lat/lon directly.
For ways/relations, reads center.lat/center.lon.
Extracts id, type, and full tags dictionary.
Each normalized feature is pushed to the dataset with:
jsonc Kopiëren Bewerken { "id": 123456, "type": "node", "tags": { "name": "Café de la Gare", "amenity": "cafe", … }, "centroid": { "lat": 52.3702, "lon": 4.8952 } } Input schema (input_schema.json) json Kopiëren Bewerken { "title": "Overpass Query Input", "type": "object", "schemaVersion": 1, "properties": { "place": { "title": "Place name", "type": "string", "description": "Enter a city or place (e.g. “Berlin, Germany”). If you don’t know the bbox, we’ll auto-geocode via Nominatim.", "editor": "textfield" }, "boundingBox": { "title": "Bounding box", "type": "string", "description": "Four comma-separated decimals: south,west,north,east (e.g. “52.5,13.3,52.6,13.4”). Only fill if you already know your bbox.", "editor": "textfield" }, "value": { "title": "OSM-tag value", "type": "string", "description": "Select one of the supported OSM tag values (e.g. “restaurant”, “school”, “park”).", "editor": "select", "enum": [ "restaurant", "cafe", "school", "hospital", "bank", "supermarket", "hotel", "park", "stadium" ] } }, "required": ["value"] }
With this actor, you can instantly pull up-to-date POI data (restaurants, schools, parks, etc.) from OpenStreetMap, filter by any supported tag value, and get a clean JSON table—no manual map inspection needed.
On this page
-
Overpass OSM Data Extractor in Python A template for extracting tagged points of interest from OpenStreetMap (OSM) within a specified area using Python. Provide either a place name or a bounding box and select an OSM tag value (e.g. “restaurant,” “school,” or “park”). The actor geocodes the place via Nominatim (if needed), constructs an Overpass QL query, and returns all matching items as a structured dataset.
Share Actor: