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 🙏

© 2024 – Pkg Stats / Ryan Hefner

postcoder-geocoding

v2.0.0

Published

Node package to simplify the use of the Postcoder API from Allies, which offers several UK geocoding API endpoints.

Downloads

14

Readme

Postcoder geocoding

Simple node wrapper for geocoding endpoints of the Postcoder API from Allies.

Find out more about the geocoding API and sign up for a trial to get an API key

The API allows searching for forward and reverse UK geocoding. Note: This is a paid for API

For full developer documentation

Install

npm install postcoder-geocoding

https://www.npmjs.com/package/postcoder-geocoding

Basic usage

const geocoding = require('postcoder-geocoding');

geocoding.init('[YOUR API KEY HERE]');

geocoding.geoFromPostcode('NR14 7PZ', (result, error) => {

    if (error) {
        console.log(error);
    } else {
        // returns an array of locations containing latitude and longitude
        console.log(result);
    }

});

Also returns OS Eastings and Northings.

Return street level data as well as latitude and longitude

const geocoding = require('postcoder-geocoding');

geocoding.init('[YOUR API KEY HERE]');

geocoding.searchStreetGeo('NR14 7PZ', (result, error) => {

    if (error) {
        console.log(error);
    } else {
        // returns an array of locations containing street level data,
        // latitude and longitude
        console.log(result);
    }

});

Returns street name, county name and more alongside the same fields as the geoFromPostcode method, full list of fields

Reverse geocoding (street level data)

const geocoding = require('postcoder-geocoding');

geocoding.init('[YOUR API KEY HERE]');

// Passing in latitude, longitude and radius (metres)
geocoding.streetFromGeo(
  '52.5859714116',
  '1.3492192897',
  '50',
  (result, error) => {

    if (error) {
        console.log(error);
    } else {
        // returns an array of locations containing street level data,
        // latitude and longitude
        console.log(result);
    }

});

Check status of your API key

Returns an object with information about number of credits on your account and more

Full list of fields returned

const geocoding = require('postcoder-geocoding');

geocoding.init('[YOUR API KEY HERE]');

geocoding.checkStatus((result, error) => {

    if (error) {
        console.log(error);
    } else {
        // returns an object with information about number of
        // credits on your account and more
        console.log(result);
    }

});

Note about support

This is a community supported package, maintained by Stephen Keable