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
Parameter | Description | Example |
---|---|---|
apikey | Your API key | PCW45-12345-12345-1234X |
countrycode | The 2-character country code, use uk for UK or ie for Ireland | uk |
postcode | The URL-encoded UK postcode or Irish Eircode that you wish to look up | nr1%201ne |
Querystring parameters
Parameter | Description | Example |
---|---|---|
format | Sets the format of the response, xml or json (default unless "application/xml" header is detected) | format=json |
identifier | Specifies 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 clients | identifier=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
Field | Description | Example |
---|---|---|
latitude | The ETRS89 latitude | 52.6299163702 |
longitude | The ETRS89 longitude | 1.3018030246 |
grideasting | The Easting OS grid reference (1m precision in units of 1m) | 623545 |
gridnorthing | The 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:
Country | Request |
---|---|
UK | 0.9 credits |
Ireland | 4.5 credits |
Buy a credit pack or set up a monthly plan to use with all Postcoder endpoints.