Postcode APIs

There are a few web services used internally by this website which I've decided to document and make publicly available. I can't provide any quality of service guarantees and may withdraw or limit usage if I find my server performance is being affected.

Create random postcodes

Creates a list of random UK postcodes with their latitude and longitude

URL
https://www.doogal.co.uk/CreateRandomPostcode.ashx

ParameterUsageDescriptionDefault
outputOptionalWhether to output as xml or csvcsv
countOptionalNumber of random postcodes to create (maximum 1000)1
startWithOptionalPostcode area to restrict results to1

Get nearby postcodes

Gets UK postcodes close to the specified latitude/longitude

URL
https://www.doogal.co.uk/GetPostcodesNear.ashx

ParameterUsageDescriptionDefault
latRequiredThe latitude of the location to find postcodes near
lngRequiredThe longitude of the location to find postcodes near
distanceOptionalMaximum distance (in KMs) from the location to return results for. Maximum value supported is 16.09344 KMs (10 miles)Returns at least 10 results
outputOptionalWhether to output as xml or csvxml

Get postcode details

Gets the latitude, longitude, quality and administrative areas of a UK postcode, returned as tab-separated text. This can also be used with partial postcodes (but quality and administrative area data won't be returned).
Administrative areas returned are Constituency, District, Ward, Lower Super Output Area, County, Region, Country, National park

URL
https://www.doogal.co.uk/GetPostcode.ashx

ParameterUsageDescription
postcodeRequiredThe postcode to get details for

Create random phone number

Creates a random phone number for the specified latitude and longitude. The phone number may not be in the correct phone code area, but it will definitely be in a nearby area

URL
https://www.doogal.co.uk/CreateRandomPhoneNumber.ashx

ParameterUsageDescription
latRequiredThe latitude of the location to generate a phone number for
lngRequiredThe longitude of the location to generate a phone number for

Get postcodes KML

Get the KML for individual postcodes for postcode areas, districts, sectors or individual postcodes

URL
https://www.doogal.co.uk/MultiplePostcodesKML.ashx

ParameterUsageDescription
postcodesRequiredA comma separated list of postcode areas, districts, sectors or individual postcodes to retrieve the KML for
activeOptionalIf true, only active postcodes will be returned

Get postcodes polygon KML

Get the polygon KML for postcode areas, districts or sectors

URL
https://www.doogal.co.uk/GetAreaKml.ashx

ParameterUsageDescription
postcodesRequiredA comma separated list of postcode areas, districts or sectors to retrieve the KML polygons for

Get nearest UK station

Gets the closest UK station to the specified latitude/longitude

URL
https://www.doogal.co.uk/GetNearestStation.ashx

ParameterUsageDescription
latRequiredThe latitude of the location
lngRequiredThe longitude of the location