npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@simple-nominatim/core

v0.6.1

Published

A lightweight library to make requests to the Nominatim API from Node programs

Downloads

141

Readme

A small ESM library that wraps the Nominatim API with typed request helpers.

It is part of the Simple Nominatim monorepo and is published on npm as @simple-nominatim/core.

Disclaimers

The utilization of this project is governed by the Nominatim Usage Policy (aka Geocoding Policy). Please adhere to fair usage practices as outlined by the OSMF Operations Working Group.

The owner and contributors of the Simple Nominatim project, including its libraries, assume no responsibility for any misuse.

Installation

Simple Nominatim currently supports the Search, Reverse and Status endpoints.

npm install @simple-nominatim/core

Requires Node.js >=24.10.0.

Usage

Each helper takes a params object (endpoint-specific) and an options object (shared query parameters). Both accept an optional baseUrl and userAgent to target a self-hosted Nominatim instance or identify the caller.

Reverse — geocodeReverse

import { geocodeReverse } from "@simple-nominatim/core";

const result = await geocodeReverse(
  { latitude: "37.4219999", longitude: "-122.0840575" },
  { format: "jsonv2" },
);
  • Required params:
    • latitude, longitude (WGS84)
  • Required options:
    • format (xml | json | jsonv2 | geojson | geocodejson)
  • Common options:
    • email
    • zoom (0–18)
    • addressdetails
    • layer

Search — freeFormSearch

import { freeFormSearch } from "@simple-nominatim/core";

const results = await freeFormSearch(
  { query: "1600 Amphitheatre Parkway, Mountain View, CA, USA" },
  { format: "jsonv2" },
);
  • Required params:
    • query
  • Common options:
    • email
    • format
    • limit (1–40)
    • addressdetails
    • countrycodes
    • bounded
    • viewbox
    • layer
    • featureType

Search — structuredSearch

import { structuredSearch } from "@simple-nominatim/core";

const results = await structuredSearch(
  { country: "USA", city: "Mountain View", street: "1600 Amphitheatre Parkway" },
  { format: "jsonv2" },
);
  • Params (all optional, at least one required):
    • amenity
    • street
    • city
    • county
    • state
    • country
    • postalCode
  • Options: same as freeFormSearch

Status — serviceStatus

import { serviceStatus, isStatusSuccess } from "@simple-nominatim/core";

const status = await serviceStatus({ format: "json" });

if (typeof status !== "string" && isStatusSuccess(status)) {
  console.log(status.software_version);
}
  • Options:
    • format (text | json, default text)
  • Text format: returns the string "OK" on success; throws on failure.
  • JSON format: returns StatusSuccessResponse (status: 0) or StatusErrorResponse (status: 700+).

Error Handling

All helpers throw typed errors that you can narrow with isRequestError:

import { freeFormSearch, isRequestError, HttpRequestError, NetworkRequestError } from "@simple-nominatim/core";

try {
  await freeFormSearch({ query: "Paris" }, { format: "json" });
} catch (error) {
  if (error instanceof HttpRequestError) {
    // error.status, error.statusText
  } else if (error instanceof NetworkRequestError) {
    // DNS / offline / socket issue
  } else if (isRequestError(error)) {
    // any RequestError subclass
  }
}

License

Simple Nominatim Core is MIT licensed.