Places API: Nearby Cafes, Restaurants, Pharmacies, and Opening Hours
Search nearby cafes, restaurants, pharmacies, ATMs, EV chargers, schools, and hospitals on OSM tags. Opening hours, nearest-first rank, and a live playground.
Try it now
Most local-search apps need the same three answers: what is around this point, is it open, and how far is it. MapLark now has dedicated endpoints for that. They sit on the same planet-scale OSM database as /v2/osm_features, but they are shaped for places: tagged points of interest, opening hours, and nearest-first ranking.
You keep OSM tags. Query cafes, restaurants, pharmacies, ATMs, EV charging stations, schools, hospitals, banks, fuel stations, toilets, and the rest of the amenity key with the same amenity=cafe strings mappers already use. You do not adopt a proprietary category tree.
How places differ from the Features API
GET /v2/osm_features is the generic layer: buildings, roads, park polygons, any tag and geometry shape. Places is the POI layer on top of that data.
- Always points plus polygon POIs. Polygon venues come back as a Point at the centroid.
- Every hit includes
properties.openingHours(open,closed, orunknown). - No client-facing cursor. Raise
limitif you need a larger page. openNow=truekeeps only places known open. Missing or unparseable hours are dropped, same as Google Places.
POST /v1/places/search takes a bounding box or a location plus radius. POST /v1/places/nearby requires tags and ranks by straight-line spheroid distance. Nearby is not a walking route.
Popular amenity tags you can query
The densest POI key in OpenStreetMap is amenity. The list below is the 100 most common amenity=* values from Taginfo (counts current as of Aug 31, 2026). Send any of them as tags on search or nearby, for example ["amenity=school"] or ["amenity=hospital"]. Combine several with orTags when you want cafes, restaurants, and fast food in one call.
- Parking
amenity=parking6,832,162 - Parking space
amenity=parking_space4,967,532 - Bench
amenity=bench3,378,328 - Place of worship
amenity=place_of_worship1,618,000 - Restaurant
amenity=restaurant1,613,278 - School
amenity=school1,444,857 - Waste basket
amenity=waste_basket1,237,631 - Bicycle parking
amenity=bicycle_parking931,878 - Shelter
amenity=shelter681,881 - Fast food
amenity=fast_food661,199 - Cafe
amenity=cafe647,179 - Recycling
amenity=recycling583,209 - Fuel
amenity=fuel567,357 - Toilets
amenity=toilets519,626 - Pharmacy
amenity=pharmacy439,400 - Bank
amenity=bank411,842 - Post box
amenity=post_box411,623 - Drinking water
amenity=drinking_water365,973 - Vending machine
amenity=vending_machine365,497 - Kindergarten
amenity=kindergarten338,911 - Waste disposal
amenity=waste_disposal316,086 - Hunting stand
amenity=hunting_stand307,825 - Parking entrance
amenity=parking_entrance280,747 - Bar
amenity=bar243,496 - Atm
amenity=atm242,891 - Community centre
amenity=community_centre219,739 - Clinic
amenity=clinic219,297 - Post office
amenity=post_office217,723 - Hospital
amenity=hospital217,185 - Doctors
amenity=doctors207,601 - Charging station
amenity=charging_station201,732 - Fountain
amenity=fountain201,428 - Pub
amenity=pub199,343 - Social facility
amenity=social_facility179,112 - Townhall
amenity=townhall177,538 - Police
amenity=police162,380 - Grave yard
amenity=grave_yard159,775 - Dentist
amenity=dentist159,533 - Fire station
amenity=fire_station148,133 - Car wash
amenity=car_wash125,059 - Library
amenity=library112,947 - Parcel locker
amenity=parcel_locker99,267 - Marketplace
amenity=marketplace98,339 - Bicycle rental
amenity=bicycle_rental94,192 - Childcare
amenity=childcare76,263 - Telephone
amenity=telephone75,148 - College
amenity=college71,618 - Bus station
amenity=bus_station67,889 - Ice cream
amenity=ice_cream66,259 - Veterinary
amenity=veterinary65,089 - University
amenity=university57,885 - Theatre
amenity=theatre53,204 - Taxi
amenity=taxi51,894 - Public bookcase
amenity=public_bookcase47,072 - Motorcycle parking
amenity=motorcycle_parking46,955 - Bbq
amenity=bbq46,849 - Letter box
amenity=letter_box46,240 - Water point
amenity=water_point42,688 - Grit bin
amenity=grit_bin40,751 - Loading dock
amenity=loading_dock40,384 - Ferry terminal
amenity=ferry_terminal37,286 - Shower
amenity=shower37,082 - Events venue
amenity=events_venue35,977 - Clock
amenity=clock35,440 - Driving school
amenity=driving_school35,382 - Public building
amenity=public_building33,833 - Car rental
amenity=car_rental32,710 - Courthouse
amenity=courthouse32,020 - Cinema
amenity=cinema31,557 - Watering place
amenity=watering_place29,929 - Arts centre
amenity=arts_centre28,477 - Trolley bay
amenity=trolley_bay26,189 - Nightclub
amenity=nightclub24,275 - Bicycle repair station
amenity=bicycle_repair_station23,288 - Bureau de change
amenity=bureau_de_change21,001 - Studio
amenity=studio17,959 - Lounger
amenity=lounger17,765 - Food court
amenity=food_court17,431 - Monastery
amenity=monastery16,178 - Prison
amenity=prison15,510 - Internet cafe
amenity=internet_cafe15,484 - Social centre
amenity=social_centre15,078 - Ticket validator
amenity=ticket_validator14,863 - Payment terminal
amenity=payment_terminal13,741 - Music school
amenity=music_school13,679 - Vehicle inspection
amenity=vehicle_inspection13,540 - Compressed air
amenity=compressed_air13,314 - Animal breeding
amenity=animal_breeding13,237 - Public bath
amenity=public_bath13,055 - Prep school
amenity=prep_school12,794 - Car sharing
amenity=car_sharing12,406 - Weighbridge
amenity=weighbridge12,309 - Lavoir
amenity=lavoir12,220 - Nursing home
amenity=nursing_home12,097 - Sanitary dump station
amenity=sanitary_dump_station11,348 - Mobile money agent
amenity=mobile_money_agent11,140 - Language school
amenity=language_school10,531 - Biergarten
amenity=biergarten10,375 - Dojo
amenity=dojo9,558 - Vacuum cleaner
amenity=vacuum_cleaner9,134
Food and drink: restaurants, cafes, fast food, bars, pubs, and ice cream. Health: pharmacies, hospitals, clinics, doctors, dentists, and veterinary. Money and post: ATMs, banks, post boxes, and post offices. Transport: parking, fuel, charging stations, bicycle parking, bicycle rental, and bus stations. Education and civic: schools, kindergartens, libraries, town halls, police, and fire stations. Everyday map features: benches, toilets, drinking water, recycling, and waste baskets.
Places is not limited to amenity. Hotels are tourism=hotel. Transit stops are often highway=bus_stop or railway=station. Shops use values such as shop=supermarket and shop=convenience. Load hotels, transit stops, toilets, drinking water, or bike parking in the playground.
Nearby cafes and restaurants
A cafe finder is one call. Filter with OSM tags you already know, pin a location, and read names and hours from the FeatureCollection. The same pattern covers restaurants and fast food: amenity=restaurant, amenity=fast_food, or all three via orTags.
import os
from osmfeatures import OSMFeaturesClient
client = OSMFeaturesClient(
api_key=os.environ["MAPLARK_API_KEY"],
base_url=os.environ.get("MAPLARK_BASE_URL", "https://api.maplark.com"),
)
cafes = client.places_search(
location={"lat": 59.316, "lng": 18.075},
radius=800,
or_tags=["amenity=cafe"],
open_now=True,
)
print(cafes)
import { OSMFeatures } from 'osmfeatures';
const client = new OSMFeatures(process.env.MAPLARK_API_KEY!, {
apiBaseUrl: process.env.MAPLARK_BASE_URL,
});
const cafes = await client.places_search({
location: { lat: 59.316, lng: 18.075 },
radius: 800,
orTags: ['amenity=cafe'],
openNow: true,
});
console.log(cafes);
Source: Python · TypeScript
Try cafes in the playground or load restaurants.
Places open now
Set openNow=true when you only want known-open hits. Optional asOf pins the evaluation instant. A naive timestamp (no offset) is that clock at the search location. Hours use each place's IANA timezone from its coordinates.
OSM coverage of opening_hours varies by city. If a bar has no hours tag, openNow will not return it. That is the filter, not a missing result. See bars open now. The same filter applies to restaurants, pharmacies, and other amenities that mappers tag with hours.
Pharmacy, ATM, hospital, and store locator
Nearby is the store-locator primitive: one tagged set, ranked from a point, each item carrying distance_m. Pharmacies, ATMs, hospitals, clinics, banks, and similar amenities map cleanly onto OSM tags.
import os
from osmfeatures import OSMFeaturesClient
client = OSMFeaturesClient(
api_key=os.environ["MAPLARK_API_KEY"],
base_url=os.environ.get("MAPLARK_BASE_URL", "https://api.maplark.com"),
)
nearby = client.places_nearby(
location={"lat": 59.316, "lng": 18.075},
or_tags=["amenity=pharmacy"],
radius=1000,
limit=5,
)
print(nearby)
import { OSMFeatures } from 'osmfeatures';
const client = new OSMFeatures(process.env.MAPLARK_API_KEY!, {
apiBaseUrl: process.env.MAPLARK_BASE_URL,
});
const nearby = await client.places_nearby({
location: { lat: 59.316, lng: 18.075 },
orTags: ['amenity=pharmacy'],
radius: 1000,
limit: 5,
});
console.log(nearby);
Source: Python · TypeScript
Pharmacies and ATMs are presets on the same page.
EV charging stations
amenity=charging_station is a first-class POI query. Use search for a viewport, or nearby to rank chargers from the vehicle's current point. Fuel stations (amenity=fuel) use the same call shape. Load EV charging in the playground.
Draw results on a free basemap
Places is not a tile API. Search returns a GeoJSON FeatureCollection of points. Overlay that on a free OpenFreeMap style with MapLibre GL JS. Leaflet plus the same GeoJSON works too. You do not need Mapbox, MapTiler, or Google tiles. Polygon venues already come back as a Point at the centroid, so every hit is a pin.
Install MapLibre (npm install maplibre-gl) and add a sized <div id="map"> to the page. Fetch search, then addSource plus a circle addLayer. Nearby is the same overlay after you unwrap items into a FeatureCollection.
import maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';
const map = new maplibregl.Map({
container: 'map',
style: 'https://tiles.openfreemap.org/styles/bright',
center: [18.06, 59.33],
zoom: 14,
});
map.on('load', async () => {
const res = await fetch('https://api.maplark.com/v1/places/search', {
method: 'POST',
headers: {
Authorization: 'Bearer <your-api-key>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
bbox: '18.05,59.32,18.10,59.34',
tags: ['amenity=cafe'],
openNow: true,
limit: 100,
}),
});
if (!res.ok) throw new Error(await res.text());
const geojson = await res.json();
map.addSource('places', { type: 'geojson', data: geojson });
map.addLayer({
id: 'places',
type: 'circle',
source: 'places',
paint: {
'circle-color': '#2d6a4f',
'circle-radius': 6,
'circle-stroke-color': '#ffffff',
'circle-stroke-width': 1.5,
},
});
});import maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';
const map = new maplibregl.Map({
container: 'map',
style: 'https://tiles.openfreemap.org/styles/bright',
center: [18.06, 59.33],
zoom: 14,
});
map.on('load', async () => {
const res = await fetch('https://api.maplark.com/v1/places/nearby', {
method: 'POST',
headers: {
Authorization: 'Bearer <your-api-key>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
location: { lat: 59.33, lng: 18.06 },
radius: 1000,
tags: ['amenity=restaurant'],
limit: 20,
}),
});
if (!res.ok) throw new Error(await res.text());
const nearby = (await res.json()) as {
items: { distance_m: number; feature: { properties?: object } }[];
};
const geojson = {
type: 'FeatureCollection',
features: nearby.items.map((item) => ({
...item.feature,
properties: { ...item.feature.properties, distance_m: item.distance_m },
})),
};
map.addSource('places', { type: 'geojson', data: geojson });
map.addLayer({
id: 'places',
type: 'circle',
source: 'places',
paint: {
'circle-color': '#2d6a4f',
'circle-radius': 6,
'circle-stroke-color': '#ffffff',
'circle-stroke-width': 1.5,
},
});
}); OpenFreeMap also publishes Positron, Dark Matter, and Fiord. Swap the style URL; the overlay stays the same. The demo key is shared and free-tier rate limited. If you get a 429, sign up for your own key. See it running on the Places playground.
A Google Maps alternative
Google Maps can be very expensive. MapLark is a privacy first, low-cost alternative that uses OpenStreetMap data with generious free tier. All we ask for really is compensation for the complex data hosting infrastructure. The Places API matches the Google Places endpoints in shape and purpose.
MapLark is GDPR compliant. Results come from OpenStreetMap, not a proprietary place graph or end-user profiles. We do not sell personal data. Account records are limited to name, email, and usage statistics. See the privacy policy.
Walk and bike routing is a sibling API (/v1/routes/isochrone, /v1/routes/path, /v1/routes/optimized_path), documented in the Geo Agent OpenAPI tag. It is not on the Places playground.
Try it on a map
Run search and nearby against live OSM places, then grab a free API key.