pafaddressbase

This endpoint returns one or more Royal Mail PAF addresses for a given postcode or part of an address, enriched with data from the associated property records in AddressBase Core and AddressBase Premium.

The enriched data is returned when the UPDRN of the PAF address can be matched to a UDPRN in the AddressBase property record. Your API key determines whether you access Core or Premium. See our AddressBase page for information about the datasets.

AddressBase: Enable access on your API key using the Data Options page or by contacting us.

Request URL

GET https://ws.postcoder.com/pcw/{apikey}/pafaddressbase/{searchterm}

Path parameters

ParameterDescriptionExample
apikeyYour API keyPCW45-12345-12345-1234X
searchtermThe URL-encoded postcode or part of an address that you wish to look upnr14%207pz

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
linesSets the number of address lines (1-4) to include in the response so you can mirror the layout of your existing address form; use include and exclude below to further customise the address lineslines=2
includeSpecifies the extra address fields to include within the address lines using a comma-delimited list, supported values: county, posttown, postcodeinclude=county,posttown,postcode
excludeSpecifies the address fields to exclude within the address lines using a comma-delimited list, supported values: pobox, organisation, departmentname, buildingname, subbuildingname, number, premise, dependentstreet, street, doubledependentlocality, dependentlocalityexclude=organisation
addtagsSpecifies the extra address fields to include within the response using a comma-delimited list, supported values: addressbase (for all fields), uprn, deliverypointaddress, lpis, blpu, classifications, organisations, applicationcrossreferences, tile, latitude, longitude. You can also include a selection of non-AddressBase fields, see additional response fields below for the full listaddtags=addressbase
callbackSpecifies the name of your JSONP callback functioncallback=jsoncallback
pageSpecifies the page of results to return where page zero is the first, 0 (default), 1, 2...page=1

Example request and response

Return Royal Mail PAF addresses for a postcode of "NR14 7PZ" with 2 address lines in the response, enriched with data from the associated property records in AddressBase

GET https://ws.postcoder.com/pcw/PCW45-12345-12345-1234X/pafaddressbase/nr14%207pz?format=json&lines=2

[
	{
	  "addressline1": "Allies Computing Ltd",
	  "addressline2": "Manor Farm Barns, Fox Road, Framingham Pigot",
	  "summaryline": "Allies Computing Ltd, Manor Farm Barns, Fox Road, Framingham Pigot, Norwich, NR14 7PZ",
	  "organisation": "Allies Computing Ltd",
	  "buildingname": "Manor Farm Barns",
	  "uniquedeliverypointreferencenumber": "17448021",
	  "premise": "Manor Farm Barns",
	  "street": "Fox Road",
	  "dependentlocality": "Framingham Pigot",
	  "posttown": "Norwich",
	  "postcode": "NR14 7PZ",
	  "latitude": "52.5850724",
	  "longitude": "1.3483484",
	  "grideasting": "626925.66",
	  "gridnorthing": "303848.3",
	  "uprn": "2630163102",
	  "parentuprn": "2630172824",
	  "usrn": "36000653",
	  "classificationcode": "CO01",
	  "rpc": "2",
	  "lastupdatedate": "2019-08-08"
	},
	{
	  "addressline1": "B 2 B Cashflow Solutions Ltd",
	  "addressline2": "Manor Farm Barns, Fox Road, Framingham Pigot",
	  ...
	  ...
	}
]

Response fields

The following fields are returned in the response for AddressBase Core:

FieldDescriptionExample
summarylineThe address given in a single field separated by commas. Where matched against PAF this is a postal addressAllies Computing Ltd, Manor Farm Barns, Fox Road, Framingham Pigot, Norwich, NR14 7PZ
organisationOrganisation name. Source: Royal Mail where matched to a PAF delivery point where there is a deliverypointaddress record shown in AddressBase Premium or council recordsAllies Computing Ltd
departmentnameWhere there is a distinct delivery point for receipt of mail for a department, the department name is indicated here. Source: Royal Mail where matched to a PAF delivery point where there is a deliverypointaddress record shown in AddressBase Premium or council records
poboxWhere linked to a PAF PO Box holder, this is the PO Box number. Source: Royal Mail where matched to a PAF delivery point where there is a deliverypointaddress record shown in AddressBase Premium or council records
subbuildingnameSub-building name – usually a unit number or flat number. Source: Royal Mail where matched to a PAF delivery point where there is a deliverypointaddress record shown in AddressBase Premium or council records
buildingnameName of the building. For instance Nelson House. May or may not be further sub-divided. Often contains what Royal Mail would class as a Dependent Street. Source: Royal Mail where matched to a PAF delivery point where there is a deliverypointaddress record shown in AddressBase Premium or council recordsManor Farm Barns
numberThe street number. Note that this may be alpha numeric. E.g. 1A. Source: Royal Mail where matched to a PAF delivery point where there is a deliverypointaddress record shown in AddressBase Premium or council records
uniquedeliverypointreferencenumberRoyal Mail’s unique identifier for a Delivery Point (i.e. where postal delivery staff go to deliver mail). Assigned by Royal Mail and only available where an address record has been matched against PAF. Provides a unique identifier and designed to be unique over the life time of a delivery point17448021
premiseA concatenation of the Department, PO Box, Sub-building Name, Building Name and Number (in that order). Useful if you have a single field in your database for storing the premiseManor Farm Barns
dependentstreetA street that needs another one for access. For example a cul-de-sac or a named parade of shops on a main road
streetThe main street on which a property is situated. Commonly seems to be a main road especially in rural and remote settings. Source: Royal Mail where matched to a PAF delivery point where there is a deliverypointaddress record shown in AddressBase Premium or council recordsFox Road
doubledependentlocalityThis is a smaller industrial estate or sub-division of a town or village. The data in this field comes from Royal Mail if the record has been matched to a delivery point but the equivalent data from council records goes into Dependentlocality
dependentlocalityThis is analogous to Royal Mail’s Double Dependent Locality and is generally representative of retail parks or industrial estates. Source: Council records or, if PAF matched, Royal MailFramingham Pigot
townnameThis is analogous to Royal Mail’s Dependent Locality and represents a suburb or small town. Source: Royal Mail where matched to a PAF delivery point where there is a deliverypointaddress record shown in AddressBase Premium or council records
posttownWhere an address record has been matched against PAF, this is the post town responsible for mail sorting. Source: Royal Mail where matched to a PAF delivery point where there is a deliverypointaddress record shown in AddressBase Premium or council recordsNorwich
postcodeThis is the Postcode assigned by Royal MailNR14 7PZ
deliverypointsuffixThe Delivery Point Suffix used by Royal Mail. This, along with a Postcode, provides a unique identifier for a delivery point at a point in time. Source: Royal Mail
latitudeThis is the latitude on the ETRS89 projection. See rpc52.5850724
longitudeThis is the longitude on the ETRS89 projection. See rpc1.3483484
grideastingThe Easting on Ordnance Survey’s British National Grid. The units are in metres to 2 decimal places. See rpc626925.66
gridnorthingThe Northing on Ordnance Survey’s British National Grid. The units are in metres to 2 decimal places. See rpc303848.3
uprnThe Unique Property Reference Number – the primary key field for AddressBase data. Assigned by GeoPlace or Ordnance Survey2630163102
parentuprnWhere a particular property is part of another one (for example a flat in a block of flats or a unit on a business park) the owning property’s UPRN is indicated here. Please note that this is not the same as Royal Mail’s multiple residence indicator for postal purposes but is a good indicator that this is not a stand-alone property2630172824
usrnThe Unique Street Reference Number – every street under council control has its own unique identifier and this is it36000653
changecodeIndicates how this record was last amended on the national hub. AddressBase Core only
toidThe topographical identifier which associates this record with OS MasterMap. AddressBase Core only
classificationcodeDescribes the classification of the property according to council recordsCO01
rpcTells you how accurate the coordinates are. For safety critical applications this may be a particularly important field:


1 – Central Internal Position – The address is contained within an OS MasterMap Topography Later building and within 2.5m of its calculated centre. Or the coordinates represent the best possible position based on the nature of the premises

2- General Internal Position – The address is contained within an OS MasterMap Topography Later building but is more than 2.5m away from its calculated centre. Or the seed is in an internal position based on the nature of the premises

3 – Transitional Position – The address has been changed from Under Development to Live within the last 6 months. It has been captured to a high level of positional accuracy but pending large scale mapping updates still may be moved

4 – Street Location – The address is plotted in accordance with the declared street start and end coordinates

5 – Postcode Unit position – The address has been captured to Postcode Unit level and will be updated when more information becomes available. It is likely that every property on the Postcode will be sharing these same coordinates

9 – Low Accuracy – The address has been captured to a lower level of accuracy and will be updated as a priority over the coming months
2
gsscodeProvided by the Office for National Statistics and used for official records. Codes are structured: the first three characters are an Entity Code and the remaining 6 characters are the particular instance. Entity Codes are: E06 (Unitary Authority); E07 (Local Authority District Council); E08 (Metropolitan Borough Council); and E09 (London Borough)
lastupdatedateThe date this record was last updated2019-08-08

Additional response fields

These additional fields can be included in the response by using the addtags querystring parameter to specify a comma-delimited list of field names.

Example: addtags=latitude,longitude,udprn,deliverypointsuffix,usercategory

FieldDescriptionQuerystring parameter to use
Coordinate data
latitudeLatitude (ETRS89)addtags=latitude
longitudeLongitude (ETRS89)addtags=longitude
latitudeosgbLatitude (OSGB36)addtags=latitudeosgb36
longitudeosgbLongitude (OSGB36)addtags=longitudeosgb36
grideastingEasting OS Grid Reference (1m precision in units of 1m)addtags=grideast1metre
gridnorthingNorthing OS Grid Reference (1m precision in units of 1m)addtags=gridnorth1metre
Address fields
deliverypointsuffixDelivery Point Suffixaddtags=deliverypointsuffix
uniquedeliverypointreferencenumberUnique Delivery Point Reference Number (UDPRN)addtags=udprn
multipleoccupancycountMultiple Occupancy Count - count of the number of multiple occupancy addresses for the delivery pointaddtags=multipleoccupancycount
administrativecountyAdministrative County (top tier local government)addtags=administrativecounty
postalcountyFormer Postal Countyaddtags=postalcounty
traditionalcountyTraditional Countyaddtags=traditionalcounty
usercategoryUser Category (residential 'R', Non-residential 'N', or Large 'L')addtags=usercategory
sortcodeSortcode for Royal Mail Mailsortaddtags=sortcode
countrycodeCountry code (within the United Kingdom)addtags=countrycode
countryCountry name (within the United Kingdom)addtags=country
welsh_dependentstreetWelsh language alternative for dependent street fieldaddtags=welsh_dependentstreet
welsh_streetWelsh language alternative for street fieldaddtags=welsh_street
welsh_doubledependentlocalityWelsh language alternative for double dependent locality fieldaddtags=welsh_doubledependentlocality
welsh_dependentlocalityWelsh language alternative for dependent locality fieldaddtags=welsh_dependentlocality
welsh_posttownWelsh language alternative for post town fieldaddtags=welsh_posttown
Census data
oa112011 Census Output Areaaddtags=oa11
lsoa112011 Census Lower Layer Super Output Areaaddtags=lsoa11
msoa112011 Census Middle Layer Super Output Areaaddtags=msoa11
censusoutputarea_20012001 Census Output Areaaddtags=censusoutputarea_2001
censuslowerlayersuperoutputarea_20012001 Census Lower Layer Super Output Areaaddtags=censuslowerlayersuperoutputarea_2001
censusmiddlelayersuperoutputarea_20012001 Census Middle Layer Super Output Areaaddtags=censusmiddlelayersuperoutputarea_2001
censusareastatisticswardcode2001 Census Area Statistics (CAS) Wardaddtags=censusareastatisticswardcode
statisticalwardcode_20052005 Statistical Wardaddtags=statisticalwardcode_2005
NHS data
commissioningregioncode_gssNHS Commissioning Region Code (ONS GSS)addtags=commissioningregioncode_gss
commissioningregionnameNHS Commissioning Region Nameaddtags=commissioningregionname
areateamcode_nhsNHS Area Team Code (NHS)addtags=areateamcode_nhs
areateamcode_gssNHS Area Team Code (ONS GSS)addtags=areateamcode_gss
areateamnameNHS Area Team Nameaddtags=areateamname
clinicalcommissioninggroupcode_nhsNHS Clinical Commissioning Group Code (NHS)addtags=clinicalcommissioninggroupcode_nhs
clinicalcommissioninggroupcode_gssNHS Clinical Commissioning Group Code (ONS GSS)addtags=clinicalcommissioninggroupcode_gss
clinicalcommissioninggroupnameNHS Clinical Commissioning Group Nameaddtags=clinicalcommissioninggroupname
Government data
localauthoritywardcodeLocal Authority Ward Codeaddtags=localauthoritywardcode
localauthoritycodeLocal Authority Codeaddtags=localauthoritycode
localauthoritynameLocal Authority Nameaddtags=localauthorityname
electoralwardcodeElectoral Ward Codeaddtags=electoralwardcode
electoralwardnameElectoral Ward Nameaddtags=electoralwardname
electoralcountycodeElectoral County Codeaddtags=electoralcountycode
electoralcountynameElectoral County Nameaddtags=electoralcountyname
parishcodeParish Codeaddtags=parishcode
parliamentaryconstituencycodeWestminster Parliamentary Constituency Codeaddtags=parliamentaryconstituencycode
parliamentaryconstituencynameWestminster Parliamentary Constituency Nameaddtags=parliamentaryconstituencyname
europeanelectoralregioncodeEuropean Electoral Region Codeaddtags=europeanelectoralregioncode
europeanelectoralregionnameEuropean Electoral Region Nameaddtags=europeanelectoralregionname
nationalparknameNational Park Nameaddtags=nationalparkname
nationalparkcodeNational Park Codeaddtags=nationalparkcode

Integration advice

  • URL encode all special characters (including /) in your request parameters with %xx encoding
  • 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
  • Use these fields to create a UK postal address: addressline1, addressline2, posttown, postcode

Credit cost

Each request costs 4.5 credits.

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

Live Start Loading Now Chatting Offline