Skip to content

alexrudall/worthatrip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

worthatrip

What is this?

A microservice to get the distance between 2 UK postcodes. Built for my friends at Jerk Off BBQ.

Feel free to use it for any non-evil purpose!

How does it work?

Uses plain Ruby rather than a framework to keep the size down and allow deployment on Vercel's generous free tier.

CSS by Tailwind.

Where does the data come from?

Utilises the Open Postcode Geo API to get the eastings and northings of each postcode. Pythagoras' theorem is used to calculate the distance between each point.

How do I use the API?

Pass the from and to postcodes as query strings to get the 'as the crow flies' distance between the postcodes in metres.

The Open Postcode Geo API encourages the use of (URL-encoded %20) spaces since some postcodes can only be distinguished from either with spaces. Letter case doesn't matter.

Example

https://worthatrip.vercel.app/api/v1/handler?from=EC3N%204AB&to=M1%201AG

Any limitations?

Excludes Northern Ireland due to licensing requirements.

Data Attribution

Office for National Statistics licensed under the Open Government Licence v3.0

About

Postcode Distance API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •