0

I'm making a search feature for a website which needs to return results close to the postcode that the user inputs to the search. It would function similarly to the search function on https://www.rightmove.co.uk/ but does not need to also accept names of cities.

So far I'm thinking of converting the users postcode to longitude/latitude and filtering the results based on how close they are to the input but I'm not sure if this is the correct approach.

I am using React/TS & I haven't written an API to filter and fetch the results from a database yet but it will either be written in golang or TS if that information is necessary.

Any additional direction would be appreciated, thanks!

  • 1
    Your approach makes sense - you might find [this](https://www.getthedata.com/postcode) useful and [this question](https://stackoverflow.com/q/36429243/11810946) is similar to yours (but with code). Note that your question is UK specific (other countries have different systems). – Brits Sep 03 '22 at 22:01
  • @Brits I already have a list of each postcode so i'll use [get the data](https://www.getthedata.com/postcode) to add the longitude and latitude to each of those, looks like that question was what i was looking for as well, thankyou – Fergus Johnson Sep 04 '22 at 14:09

0 Answers0