Nearest
API test authentication
The Open API block allows you to test OS APIs directly from the page with example data and parameters. To use this feature, you will need to add your API Key or OAuth2 token to the authentication field.
For help generating an API Key or OAuth2 token, please see the Getting started with an API project or OAuth2 documentation.
Authorizations
Query parameters
pointstringRequired
A set of British National Grid coordinates to which the nearest record in a straight line should be found.
radiusnumber · min: 0.01 · max: 1000Optional
The radius in metres to search within. Minimum = 0.01, Maximum = 1,000 . Default = 100
formatstring · enumOptionalPossible values:
The format the response will be returned in.
fqstring · enumOptionalPossible values:
Filters the results by bounding box or local_type.
Responses
200
Retrieves addresses based on a free text search.
get
GET /search/names/v1/nearest HTTP/1.1
Host: api.os.uk
Accept: */*
200
Retrieves addresses based on a free text search.
{
"header": {
"uri": "text",
"query": "text",
"format": "text",
"maxresults": 1,
"offset": 1,
"totalresults": 1
},
"results": [
{
"ID": 1,
"NAMES_URI": "text",
"NAME1": "text",
"TYPE": "text",
"LOCAL_TYPE": "text",
"GEOMETRY_X": 1,
"GEOMETRY_Y": 1,
"MOST_DETAIL_VIEW_RES": 1,
"LEAST_DETAIL_VIEW_RES": 1,
"MBR_XMIN": 1,
"MBR_YMIN": 1,
"MBR_XMAX": 1,
"MBR_YMAX": 1,
"POSTCODE_DISTRICT": "text",
"POSTCODE_DISTRICT_URI": "text",
"POPULATED_PLACE": "text",
"POPULATED_PLACE_URI": "text",
"POPULATED_PLACE_TYPE": "text",
"COUNTY_UNITARY": "text",
"COUNTY_UNITARY_URI": "text",
"COUNTY_UNITARY_TYPE": "text",
"REGION": "text",
"REGION_URI": "text",
"COUNTRY": "text",
"COUNTRY_URI": "text"
}
]
}
Last updated
Was this helpful?