Background for non-UK residents: the postcode database is controlled by Royal Mail and isn’t public domain. If you want to use the data you must licence it at fairly expensive rates first. There’s a project to create a crowdsourced clone of this data ( http://freethepostcode.org/ ) and it’s beginning to get there, but it’s by no means complete.