"Search within distance" API for OpenStreetMap

api, openstreetmap, search

Solution

Yes. The Overpass API has an "Around" feature which does exactly this (search for items within a radius of the given point). You can combine that with other requirements (eg to get a list of a particular item type):

http://wiki.openstreetmap.org/wiki/Overpass_API#Around

For example using OverPass Turbo Api (List all towns near of "Manzanares, Spain" with latitude and longitude with a radius of 150 Km, try it live!):

<osm-script output="json" timeout="25">
  <id-query {{nominatimArea:Spain}} into="area"/>
  <query type="node">
    <has-kv k="place" modv="" v="town"/>
  <around lat="38.996507" lon="-3.371946" radius="150000"/>
</query>

  <print e="" from="_" geometry="skeleton" limit="" mode="body" n="" order="id" s="" w=""/>
</osm-script>

Problem

Is there any API for OpenStreetMap which allows me to obtain a list of POIs within a certain distance (e.g. 10 miles) from a reference location?

Original source