ZAD
ZAD

Reputation: 569

How to make a PHP based script for finding UK addresses by entering postcode?

I've almost looked everywhere but nothing found, so my only hope would be here though! :(

I want to make a PHP based script for finding UK address by entering postcode, so a list would show with a number of houses' numbers!

Any idea how I could do that, I know that I must use API, even though I search for Google Maps API for this, but nothing found whatsoever!

Any idea?

I need this particular script for an additional registration script which allows uk residents to be able to register for a specific reason, so please help if you know where I could get started!

Thanks in advance! :)

Upvotes: 0

Views: 2315

Answers (4)

Saurav Sharma
Saurav Sharma

Reputation: 19

We can get all UK addresses by postal code with api.getaddress.io API. You can found an example on https://usingphp.com/post/how-to-get-all-uk-addresses-by-postal-code

Upvotes: 0

AlexMorley-Finch
AlexMorley-Finch

Reputation: 6965

You can fetch the postcode latitude and longitude using google api:

http://maps.googleapis.com/maps/api/geocode/json?address=(POSTCODE HERE)&sensor=false

then using the lat and long from that you can get the street name

http://maps.googleapis.com/maps/api/geocode/json?latlng=(LAT),(LNG)&sensor=false

see reference here:

http://code.google.com/apis/maps/documentation/geocoding/

Upvotes: 2

Lars
Lars

Reputation: 5799

Well, there are quite a few projects working on this dataset - just look at e.g. http://www.freethepostcode.org/ and the associated projects.

Upvotes: 2

Nick
Nick

Reputation: 6346

Generally these systems utilise the Royal Mail PAF database, but this does cost quite a lot of money.

There are services out there that offer X amount of requests for a set price (or a monthly price), so if buying the full thing isn't an option then you could have a look into one of those services.

It is something you are going to need to spend money on though - it's not a service that anyone (that I've ever found) is offering for free.

I don't think this is something you can get out of Google maps either.

Upvotes: 4

Related Questions