-
Use the Postcode Address File (PAF) API to link a UK postcode to a list of addresses.
- The PAF API is a free service provided by the Royal Mail.
- It allows you to search for addresses by postcode and get back a list of all the addresses that match that postcode.
- The API can be used to link a UK postcode to a list of addresses in a single API call.
-
Use the AddressBase API to link an address to a UPRN.
- The AddressBase API is a paid service provided by Ordnance Survey.
- It allows you to search for addresses by address components, such as street name and house number, and get back the UPRN for that address.
- The API can be used to link an address to a UPRN in a single API call.
Here is a step-by-step guide on how to link a UK postcode to a list of addresses and then a specific address to a UPRN in as few API calls as possible and at minimum cost:
-
Sign up for a free PAF API account.
- Go to the Royal Mail website and sign up for a free PAF API account.
- Once you have signed up, you will be given an API key.
-
Sign up for a paid AddressBase API account.
- Go to the Ordnance Survey website and sign up for a paid AddressBase API account.
- Once you have signed up, you will be given an API key.
-
Use the PAF API to get a list of addresses for a UK postcode.
- Make a GET request to the PAF API endpoint, passing in the postcode as a parameter.
- The API will return a list of all the addresses that match that postcode.
-
Loop through the list of addresses and use the AddressBase API to get the UPRN for each address.
- For each address in the list, make a GET request to the AddressBase API endpoint, passing in the address components as parameters.
- The API will return the UPRN for that address.
This process can be completed in as few as two API calls per address, one to the PAF API and one to the AddressBase API.
The total cost of this process will depend on the number of addresses you are linking to UPRNs.
- The PAF API is free to use.
- The AddressBase API charges a fee per API call.
- The cost per API call varies depending on the type of call.
For example, a search for a single address costs £0.01.
Therefore, the total cost of linking a UK postcode to a list of addresses and then a specific address to a UPRN will be:
- £0.01 per address if you are using the PAF API and the AddressBase API.
- £0.02 per address if you are using the PAF API and the AddressBase API Premium service.