
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@andreasnicolaou/overpass-client
Advanced tools
A wrapper for the Overpass API to query OpenStreetMap data.
OverpassClient is designed to simplify interaction with the Overpass API, used for querying OpenStreetMap (OSM) data. This wrapper provides an easy-to-use interface for retrieving geographic objects like nodes, ways, and relations while handling common issues such as retries, timeouts, and network failures.
Interacting with the Overpass API directly can be complex due to common issues like network failures, timeouts, and data size concerns. This wrapper addresses those issues by:
This is ideal for developers who want to interact with OSM data without worrying about low-level request handling and retries.
node, way and relation data, enabling more accurate searches.Retries and Exponential Backoff:
Handling Network and Server Failures:
Simplified API:
npm install @andreasnicolaou/overpass-client
import { OverpassClient } from '@andreasnicolaou/overpass-client';
this.overpassClient = new OverpassClient();
this.overpassClient.getElement('way', 452).subscribe((response) => {
console.log(response);
});
const tags = { amenity: ['cafe', 'restaurant'] };
const bbox: [number, number, number, number] = [48.85, 2.29, 48.87, 2.35]; // [minLat, minLon, maxLat, maxLon]
this.overpassClient.getElementsByBoundingBox(tags, bbox).subscribe((response) => {
console.log(response);
});
const lat = 48.85;
const lon = 2.35;
const radius = 500;
this.overpassClient.getElementsByRadius(tags, lat, lon, radius).subscribe((response) => {
console.log(response);
});
| Method | Description | Parameters |
|---|---|---|
clearCache() | Clear the LRU cache entirely. | None |
getElement(type: ElementType, id: number, outputFormat: string = 'out;') | Fetches a specific element (node, way, or relation) by its ID. | - type: The type of element ('node', 'way', 'relation').- id: The ID of the element.- outputFormat: The Overpass QL output format (default: 'out;'). |
getElementsByBoundingBox(tags: Record<string, string[]>, bbox: [number, number, number, number], elements: ElementType[] = ['node', 'way', 'relation'], outputFormat: string = 'out center;') | Fetches elements with specified tags within a given bounding box. | - tags: A dictionary of tag types and their possible values.- bbox: A bounding box in the format [minLat, minLon, maxLat, maxLon].- elements: The element types to include in the query (default: 'node', 'way', 'relation').- outputFormat: The Overpass QL output format (default: 'out center;'). |
getElementsByRadius(tags: Record<string, string[]>, lat: number, lon: number, radius: number, elements: ElementType[] = ['node', 'way', 'relation'], outputFormat: string = 'out center;') | Fetches elements with specified tags within a given radius from a point. | - tags: A dictionary of tag types and their possible values.- lat: Latitude of the center point.- lon: Longitude of the center point.- radius: Search radius in meters.- elements: The element types to include in the query (default: 'node', 'way', 'relation').- outputFormat: The Overpass QL output format (default: 'out center;'). |
Contributions are welcome! If you encounter issues or have ideas to enhance the library, feel free to submit an issue or pull request.
FAQs
A wrapper for the Overpass API to query OpenStreetMap data.
We found that @andreasnicolaou/overpass-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.