Cookie

Cookie consent

We use some essential cookies to make this website work. We'd like to set additional cookies to help us measure your experience when you view and interact with the website.

Cookie policy

position

This endpoint returns the coordinates for a given UK postcode or Irish Eircode.

Ireland and Eircode: Enable access on your API key using the Features page or by contacting us.

Request URL

https://ws.postcoder.com/pcw/{apikey}/position/{countrycode}/{postcode}

Path parameters

ParameterDescriptionExample
apikeyYour API keyPCW45-12345-12345-1234X
countrycodeThe 2-character country code, use uk for UK or ie for Irelanduk
postcodeThe URL-encoded UK postcode or Irish Eircode that you wish to look upnr1%201ne

Querystring parameters

ParameterDescriptionExample
formatSets the format of the response, xml or json (default unless "application/xml" header is detected)format=json
identifierSpecifies your own meaningful identifier for the request such as "websiteA" or "client123"; you can view usage for each identifier on the Identifier Usage page, which may be helpful when using your API key across multiple websites, apps or clientsidentifier=websiteA

Example requests and responses

Return the coordinates and grid references in the UK for the postcode of NR1 1NE:

https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X/position/uk/nr1%21ne?format=json
[
	{
		"latitude": "52.6299163702",
		"longitude": "1.3018030246",
		"grideasting": "623545",
		"gridnorthing": "308689"
	}
]

Return the coordinates in Ireland for the Eircode of D02X285:

https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X/position/ie/D02X285?format=json
[
	{
		"latitude": "53.332067",
		"longitude": "-6.255492"
	}
]

Response fields

FieldDescriptionExample
latitudeThe ETRS89 latitude52.6299163702
longitudeThe ETRS89 longitude1.3018030246
grideastingThe Easting OS grid reference (1m precision in units of 1m)623545
gridnorthingThe Northing OS grid reference (1m precision in units of 1m)308689

Integration advice

  • URL encode all special characters (including /) in your request parameters with %xx encoding
  • Verify your request was successful by checking for an HTTP status code of 200; see all HTTP status codes with descriptions
  • When using your API key across multiple websites, apps or clients, set the identifier querystring parameter to a meaningful value such as "websiteA" or "client123"; you'll then be able to view these identifiers and the number of requests made by each one on the Identifier Usage page
  • Treat all response fields as optional

Credit cost

Each request costs the following number of credits:

CountryRequest
UK0.9 credits
Ireland4.5 credits

Buy a credit pack or set up a monthly plan to use with all Postcoder endpoints.