{"id":15592027,"url":"https://github.com/derhuerst/query-overpass","last_synced_at":"2025-04-28T12:10:51.162Z","repository":{"id":57107612,"uuid":"98303691","full_name":"derhuerst/query-overpass","owner":"derhuerst","description":"Query the OpenStreetMap Overpass API.","archived":false,"fork":false,"pushed_at":"2022-04-03T19:46:11.000Z","size":24,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T11:41:21.284Z","etag":null,"topics":["api","openstreetmap","osm","overpass"],"latest_commit_sha":null,"homepage":"https://github.com/derhuerst/query-overpass","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derhuerst.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-25T12:27:40.000Z","updated_at":"2024-02-03T23:08:03.000Z","dependencies_parsed_at":"2022-08-20T17:11:20.925Z","dependency_job_id":null,"html_url":"https://github.com/derhuerst/query-overpass","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Fquery-overpass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Fquery-overpass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Fquery-overpass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhuerst%2Fquery-overpass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derhuerst","download_url":"https://codeload.github.com/derhuerst/query-overpass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311332,"owners_count":21569009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","openstreetmap","osm","overpass"],"created_at":"2024-10-02T23:53:10.811Z","updated_at":"2025-04-28T12:10:51.142Z","avatar_url":"https://github.com/derhuerst.png","language":"JavaScript","funding_links":["https://github.com/sponsors/derhuerst"],"categories":[],"sub_categories":[],"readme":"# query-overpass\n\n**Query the [OpenStreetMap](https://www.openstreetmap.org/) [Overpass](https://overpass-api.de) API.** Yet another implementation, because it\n\n- is isomorphic (works in the browser)\n- is lightweight (doesn't contain any sophisticated parser)\n- uses [`p-retry`](https://github.com/sindresorhus/p-retry) to resend requests\n\nOther alternatives for you to evaluate:\n\n- [`query-overpass`](https://github.com/perliedman/query-overpass) and a fork [`@sriharithalla/query-overpass`](https://github.com/SrihariThalla/query-overpass)\n- [`idris-overpass`](https://github.com/idris-maps/idris-overpass) and [`idris-overpass-browser`](https://github.com/idris-maps/idris-overpass-browser)\n\n[![npm version](https://img.shields.io/npm/v/@derhuerst/query-overpass.svg)](https://www.npmjs.com/package/@derhuerst/query-overpass)\n![ISC-licensed](https://img.shields.io/github/license/derhuerst/query-overpass.svg)\n[![support me via GitHub Sponsors](https://img.shields.io/badge/support%20me-donate-fa7664.svg)](https://github.com/sponsors/derhuerst)\n[![chat with me on Twitter](https://img.shields.io/badge/chat%20with%20me-on%20Twitter-1da1f2.svg)](https://twitter.com/derhuerst)\n\n\n## Installing\n\n```shell\nnpm install @derhuerst/query-overpass\n```\n\n\n## Usage\n\nPass in a string of [Overpass QL](http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL). Returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) that will resolve with an array of elements.\n\n```js\nconst queryOverpass = require('@derhuerst/query-overpass')\n\nqueryOverpass(`\n\t[out:json][timeout:25];\n\tnode(3378340880);\n\tout body;\n`)\n.then(console.log)\n.catch(console.error)\n```\n\n```js\n[ {\n\ttype: 'node',\n\tid: 3378340880,\n\tlat: 52.5145076,\n\tlon: 13.35011,\n\ttags: {\n\t\tartist: 'Friedrich Drake',\n\t\tartwork_type: 'statue',\n\t\tcolour: 'gold',\n\t\theight: '66.9',\n\t\timage: 'https://upload.wikimedia.org/wikipedia/commons/2/2a/Victoria_Goldelse_Siegessaeule_Berlin.jpg',\n\t\tmin_height: '58.6',\n\t\tname: 'Viktoria',\n\t\t'name:de': 'Siegessäule',\n\t\t'name:ru': 'Колонна победы',\n\t\t'name:zh': '勝利女神柱',\n\t\treg_name: 'Goldelse',\n\t\ttourism: 'artwork',\n\t\twheelchair: 'no'\n\t}\n} ]\n```\n\n*Note:* The Overpass API *does not* support [extended Overpass Turbo queries](https://wiki.openstreetmap.org/wiki/Overpass_turbo/Extended_Overpass_Turbo_Queries), as they are an [Overpass Turbo](https://overpass-turbo.eu)-specific feature.\n\nTo use make requests from a web site, enable [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) using the `fetchMode` option:\n\n```js\nqueryOverpass(query, {fetchMode: 'cors'})\n```\n\nTo use `@derhuerst/query-overpass` with a custom Overpass API endpoint, use the `endpoint` option:\n\n```js\nqueryOverpass(query, {endpoint: 'https://overpass.example.org'})\n```\n\n\n## Related\n\n- [`osm-build-query`](https://github.com/csbrandt/osm-build-query) – Build a query for the OSM Overpass API that retrieves all elements within the bounding feature.\n- [`osm-flatten-relation`](https://github.com/derhuerst/osm-flatten-relation) – Resolve an OpenStreetMap relation recursively.\n\n\n## Contributing\n\nIf 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](https://github.com/derhuerst/query-overpass/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderhuerst%2Fquery-overpass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderhuerst%2Fquery-overpass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderhuerst%2Fquery-overpass/lists"}