Giter Club home page Giter Club logo

postcode's Introduction

UK Postcodes Import and Lookup

Laravel 5.5 project that imports UK postcodes and offers an API to search postodes (for example by LAT/LONG).

How it works

Import Postcodes

Before looking for a postcode you will have to import them. To this effect the project provides a command that download and import the UK postcodes info into the database.

The command can be run as follows:

php artisan import:postcodes

This command is a one off unless you want to update the records with new downloaded data. Please take into account that it will be slow to run but it will show the progress information while it is running.

Note: Before running the command please create an empty file in database/sqlite/database.sqlite. This can be done with

touch database/sqlite/database.sqlite

Postcode search

The project offer two endpoints to search postcodes:

Partial Match

The endpoint /api/postcodes/{partialSearch} accepts a string in partialSearch

This endpoint gives a paginated result of postcodes partially matching by postcode (pcd).

Example /api/postcodes/BH11A

Latitude and Longitude

The endpoint /api/postcodes/search accepts the following parameters

  • lat - required latitude
  • long - required longitude
  • dt - optional - distance search

This endpoint gives a paginated result of postcodes found within the distance provided using the latitude and longitude provided.

Example /api/postcodes/search?lat=53.607145&long=-2.309467&dt=2

License

The UK Postcodes Import and Lookup project is open-sourced software licensed under the MIT license.

postcode's People

Contributors

adrianhl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.