Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @derhuerst/query-overpass with all npm packages installed. Try it out:

var queryOverpass = require("@derhuerst/query-overpass")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@derhuerst/query-overpass v2.0.0

Query the OpenStreetMap Overpass API.


Query the OpenStreetMap Overpass API. Yet another implementation, because it

  • is isomorphic (works in the browser)
  • is lightweight (doesn't contain any sophisticated parser)
  • uses p-retry to resend requests

Other alternatives for you to evaluate:

npm version build status ISC-licensed chat on gitter support me on Patreon


npm install @derhuerst/query-overpass


Pass in a string of Overpass QL. Returns a Promise that will resolve with an array of elements.

const queryOverpass = require('@derhuerst/query-overpass')

    out body;
[ {
    type: 'node',
    id: 3378340880,
    lat: 52.5145076,
    lon: 13.35011,
    tags: {
        artist: 'Friedrich Drake',
        artwork_type: 'statue',
        colour: 'gold',
        height: '66.9',
        image: '',
        min_height: '58.6',
        name: 'Viktoria',
        'name:de': 'Siegessäule',
        'name:ru': 'Колонна победы',
        'name:zh': '勝利女神柱',
        reg_name: 'Goldelse',
        tourism: 'artwork',
        wheelchair: 'no'
} ]

To use make requests from a web site, enable CORS using the fetchMode option:

queryOverpass(query, {fetchMode: 'cors'})

To use @derhuerst/query-overpass with a custom Overpass API endpoint, use the endpoint option:

queryOverpass(query, {endpoint: ''})


  • osm-build-query – Build a query for the OSM Overpass API that retrieves all elements within the bounding feature.
  • osm-flatten-relation – Resolve an OpenStreetMap relation recursively.


If you have a question or have difficulties using query-overpass, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free