Skip to content

padraignolan/postcodes.io

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postcodes.io Build Status

Query for UK postcodes and geolocations over HTTP. Postcodes.io uses the Office for National Statistics Postcode Directory.

Documentation can be found at postcodes.io

Requirements

Please make sure you have the following available:

We also have an end-to-end guide to install Postcodes.io on a fresh virtual machine in the wiki.

Install & Download Data & Run

Download and install

$ git clone https://github.com/ideal-postcodes/postcodes.io.git

$ cd postcodes.io/ && npm install

Configure Postgres and Seed Database

Postcodes.io is packaged with a script to setup and download the ONS Postcode Directory. To run this, navigate into the repository directory and run,

$ npm run setup

This script will prompt you for Postgres superuser credentials. This privilege is required to create a new user, database, extensions and then to load the data. For the security conscious, you can find out how this works by reading our installation notes and the script itself. Other install methods are available but require a bit of extra work.

You can change the Postgres username/password yourself but you will need to update 'config/config.js' with the relevant credentials.

The import process takes around 10 minutes to complete.

Run it

node server.js // Default environment is development

Contributions

Contributions are welcome.

Testing

$ npm run setup_test_db # create test database

$ npm test

License

MIT

About

UK Postcode API serving up Open Data

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 82.2%
  • HTML 14.5%
  • CSS 1.7%
  • Shell 1.6%