0151 355 4555



Finds a list of towns or villages that match the requested name.

Each matching town or village is returned as a PartialAddress, which contains the name of the town or village as the Description and a unique identifier as the ID. The caller can use the Description to select the required town or village, and the corresponding ID can be used as input to the StreetsByLocalityKeyor AddressesByLocalityKey methods to further refine the address.

The name can contain multiple parts, separated by commas. For example, if you are looking for a village that is a suburb of a town, you can supply the name as "village, town" to only include that village within that town in the results. If you only supply the village name, you may retrieve many results, each representing a village of the same name within different towns. Equally, if you only supply the town name, you will retrieve the name of every village within that town in addition to the town itself. Up to three such levels are available, e.g. "hamlet, village, town".

The name is also assumed to have a wildcard at the end. For example, "black" will match Blackburn, Blackpool and various others, and all the villages within those areas.

Note that some areas that are known locally may not be recognised by the Royal Mail, and so will not appear in this list. In this case, you should be able to search for and find the major post town that the area is within and use that instead. For example, "Chelsea" does not exist but "London" does, and all the streets and addresses you would expect to be able to find within Chelsea can be found within London.

View all Address validation methods

Code Samples

<!-- Import the Integr8 Ajax API -->
<!-- NOTE: Get your own API key to use in the following script tag from: -->
<!-- http://www.data-8.co.uk/integr8/Admin/Ajax.aspx -->
<script src="http://webservices.data-8.co.uk/Javascript/Loader.ashx?key=your-api-key" type="text/javascript">

<script type="text/javascript">

function loadIntegr8() {
  // Load the AddressCapture Integr8 service

function LocalitiesByName(licence, name) {
  /// <param name="licence">string. One of the following values: WebServerFull, WebClickFull, WebClickThoroughfare, InternalUserFull, InternalUserThoroughfare, SmallUserFull, SmallUserThoroughfare, Lookup, InternalServerFull, InternalServerThoroughfare, FreeTrial, FreeTrialThoroughfare, InternalUserFullArea, InternalUserThoroughfareArea, WebServerThoroughfare</param>
  /// <param name="name">string</param>
  var addresscapture = new data8.addresscapture();

function showLocalitiesByNameResult(result) {
  // Check that the call succeeded, and show the error message if there was a problem.
  if (!result.Status.Success) {
    alert('Error: ' + result.Status.ErrorMessage);
  else {
    // TODO: Process method results here.
    // Results can be extracted from the following fields:
    // result.Results
    //   Contains an array of addresses or partial address details that match the query.
    //   A human-readable description of each item in the array is available in the Description field,
    //   and an identifier to be passed to other methods is available in the ID field.