Using the Ordnance Survey OS PLACES API, to find and complete addresses.
Requires installation of R environment. (Developed in R v4.0.2)
Requires following R package dependencies to be installed:
install.packages("tidyverse", "httr", "jsonlite")
- Clone repo to local machine
- in the
os-query-api
folder, create akeyfile
document and save the OS licence key for accessing the API.
accepts building (number or name) and postcode and will return a full address if an exact match can be found:
function(building, postcode, api_key, failed_response="")
building: building number or name,
postcode: postcode
api_key: your API licence key
failed_response: (Optional) will be returned as the response string if no match is made. Defaults to blank string.
stop_on_error: (Optional) When TRUE will cause the function to raise anystop
errors or exceptions. Defaults to FALSE, which will return the error text in the match string instead.
See example.R file for usage examples: