Geocoder

Geocoder

The geocoder supports various methods for turning postcodes into locations, or locations into postcodes, using our collected data.

Postcode -> Location

Look up the location that we have for a postcode. If we don't have an exact match for the postcode you request, then we will do our best. If we don't have an exact match, we will return #s where we don't have exact matches.

Location -> Postcode

Look up the nearest postcode for a location. You can optionally get the n nearest postcodes to a location.

Location -> Postcode Areas

Look up the nearest postcode area (eg 'OX2') for a location. You can optionally get the n nearest postcode areas to a location.

Result Formats

The results can be returned as plain text (csv with header), XML, or javascript / javascript callback.

If you request the response with the format of 'js', then you can specify the name of a funtion call to wrap around the JSON response. This will call that method with the JSON as a parameter.

URL

http://www.npemap.org.uk/cgi/geocoder.fcgi

Arguments

postcode (required, unless easting and northing given)
The postcode that you wish the location of. You can enter just the outward part if you wish.
easting (required, unless postcode given)
The easting part of the location, to find nearby postcodes or postcode areas. If given, 'northing' must also be supplied.
northing (required, unless postcode given)
The northing part of the location, to find nearby postcodes or postcode areas. If given, 'easting' must also be supplied.
format (optional)
The format to return the results in. Can be 'text', 'js' or 'xml'. The default is plain text.
results (optional)
The number of results to return. The default is 1. (postcode to location searching always returns one result).
areas (optional)
If searching by easting and northing, should postcodes be returned, or should postcode areas be returned? The default is to return postcodes.

Example response

# Easting,Northing,Matched Postcode
434807,219133,'OX7 3##'

Explorer

Try out this method without writing any code.

postcode: or
easting:   northing:

number of results:
format: