See who lives at an address

Obtain the names and telephone numbers of all residents who have lived, or are currently living, at a specified address.


Find out the names and telephone numbers of the current occupants, and any past occupants, living at a specified address in the UK.

This search is useful to any business or individual needing to identify the residential makeup of a property and find contact details to get in touch with owners/residents. Estate Agents, Building Societies, and Investigation companies are just some of the business sectors that would benefit from this service.

This ability to return the names of the occupants at a particular property is also useful to the marketing and sales teams of many businesses who only have an address and postcode. Instead of addressing their communication to ‘The Occupier’ they will be able to personalise it to a named person, thus improving their response rate.

API method to use: address_person

How it works

The method will return the names, and any telephone numbers, of people currently living at a specified address. Any past residents found will also be listed.

In order to return the above information, a unique UK address consisting of a full UK postcode and house name/number is required.

If the house name/number is not specified, a free list of addresses at which there is data about one or more people will be returned. Users can then select one address to see the names of residents.

Details on mandatory and optional parameters, with a list of returned values, can be found in the Documentation section.

Next Steps…

We will give you a unique API key to allow you to test the method using credits on your T2A account. The Demo tab will allow you to test the parameters required and view the result.

If you do not have an account you will first need to sign up

 

Let's get started

 

 

Other related API methods:

Search the Electoral Roll (edited version)
Check if a person is deceased
Age Verification - check if a person is 18 or over
Person Verification - check if someone exists
Telephone number appending
Check if a number is TPS (Telephone Preference Service) registered

API method to use: address_person
|
Credits per use: 4

Obtain the names and telephone numbers of all residents who have lived, or are currently living, at a specified address.

Returns person(s) living at a specified postcode and house number, and any telephone numbers.

The API requires a unique UK address in order that it may return the above information.

A full UK postcode is required. If the house number or name is not specified, the method returns a free list of the premises at which there is data about one or more persons. The final user may be presented with that list, and may opt to select an address at which to view the data. If there is no residential data at an address, that address will not appear in the list

Mandatory Parameters


Name Description
api_key or javascript_key Use your API key if invoking server-side. If invoking from the browser via JavaScript, generate a JavaScript key using the javascript_key method.
postcode Enter a full UK postcode; this can include spaces and can be in any case.

Optional Parameters


Name Description
client You can optionally include an identifier for your final client or user. This is logged in your usage log and you will be able to view your usage statistics by client.
output Set to json for a JSON response; the default response is XML. Not applicable to the SOAP API.
callback When using JSON, specify a JSONP wrapper in which the JSON response is to be wrapped.
premises Enter the house number or name.

Leave blank to return a free (no charge) list of the premises at which there is one or more occupant the end user will then select a premises from that list, at which to view the occupant(s) and telephone number(s)

Returned Values


The XML response is contained within a <address_person_res> element.

Name Description
status Returns ok if the operation has succeeded, or error if an error has occurred; Returns the error_code for error details.
error_code Returns the error code when the status is error. See below for error codes.
t2a_version_number The current API version number.
credit_used The number of credits used in order to execute the request.
mode Returns normal or test when executed in the free test mode.
person_list An array of person records.
premises_list

An array of premises records.

This is seen if the premises parameter is ambiguous or not specified; it is a free list of addresses at which there is data about the resident(s), and can be used to allow the end user to select the household to be viewed.

Use the name value from the selected premises to replace the premises input parameter value when re-invoking this method. No charge is made when a premises_list is returned.

Error Codes


See the common error codes. There are no errors which are specific to this method.

Free Test Mode


When operating in the free test mode errors are returned if mandatory parameters are missing, or it returns a dummy data response, in an identical format to a real response.

Note that the mode is returned as test when the method is operating in the free test mode.

Example XML Response



<?xml version="1.0" encoding="utf-8" ?>
<address_person_res>
	<t2a_version_number>1.0.0</t2a_version_number>
	<status>ok</status>
	<mode>normal</mode>
	<person_list>
		<person>
		  <title>Mr</title>
		  <forename>Alan</forename>
		  <middle_initial/>
		  <surname>Fiction</surname>
		  <line_1>4 Imagination Gardens</line_1>
		  <line_2>Magic Street</line_2>
		  <line_3/>
		  <place>Heslingdown</place>
		  <town>York</town>
		  <addr_single_line>4 Imagination Gardens, Magic Street, 
		  Heslingdown, 
		  York, YO10 5NP</addr_single_line>
		  <postcode>YO10 5NP</postcode>
		  <telephone_number>(01904) 000000</telephone_number>
		</person>
		<person>
		  <title>Mrs</title>
		  <forename>Jean</forename>
		  <middle_initial>Z</middle_initial>
		  <surname>Fiction</surname>
		  <line_1>4 Imagination Gardens</line_1>
		  <line_2>Magic Street</line_2>
		  <line_3 />
		  <place>Heslingdown</place>
		  <town>York</town>
		  <addr_single_line>4 Imagination Gardens, Magic Street, 
		  Heslingdown, 
		  York, YO10 5NP</addr_single_line>
		  <postcode>YO10 5NP</postcode>
		  <telephone_number>(01904) 000000</telephone_number>
		</person>
	</person_list>
</address_person_res>

There are two ways to authenticate your application with the T2A API. The two implementation examples on this page cover each type of authentication

We recommend using an API key for internal applications and the javascript key for public facing applications where you would want to protect your API key.

Note: examples below show a restricted result set with a maximum of 3 results per search

API key


<div class="address-person-example">
  <form class="address-person-form">

    <div class="form-group">
          <label for="surname">Postcode</label>
          <input type="text" class="form-control" id="postcode" placeholder="Postcode">
      </div>

    <div class="form-group">
          <label for="surname">Premises</label>
          <input type="text" class="form-control" id="premises" placeholder="Building name or number">
      </div>

    <button type="submit" class="btn example-submit">Submit</button>
  </form>
</div>

<div class="results">
  <div id="results-output"></div>
  <a class="results-return" href="#">Back to search</a>
</div>
                
.address-person-example, .results {
  margin: 20px auto;
  width: 400px;
}

form.address-person-form, .results {
    background-color: #F6F6F6;
    border: 1px solid #CBCBCB;
    padding: 15px;
}

.example-submit {
    background-color: #F0614C;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 400;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.193em;
    width: 138px;
    height: 41px;
    margin-top: 10px;
}

.results {
  display: none;
}

.results-return {
    font-weight: 600;
    color: #F0614C;
}

#results-output span {
    font-weight: bold;
    text-transform: capitalize;
}

#results-output hr {
    border-top: 1px solid #000;
}

.error {
  font-size: 11px;
  color: #f00;
}
                
$(document).ready(function(){ 	
    $(".address-person-form").submit(function(e) {
        e.preventDefault();	

        $('.error', $(this)).remove();

        var postcode = $("#postcode");        if(!postcode.val()) {
                errorBefore("Please enter a postcode.", postcode);
            }

        var premises = $("#premises");        if($('.error', $(this)).length) {	
            $('.error', $(this)).first().next('input').focus();
        } else {
    
            $.ajax({
                url: 'https://api.t2a.io/rest/rest.aspx',
                dataType: 'json',
                data: {
                    'method'   : "address_person",
                    'api_key'  : 'fDl8S-DC2C9uySZmC_wItp1Olp-CQQ88DOucUIPz9Xzn',
                    'postcode' : postcode.val(),
                    'premises' : premises.val(),
                    'output'   : 'json'
                    },
                success: function(result){
                    if(result.status == "error") {
                        $('#results-output').append('<p class="output"><strong>Error:</strong>' + result.error_code +'</p>');
                    } else {
                        var i = 0;
                        if(typeof result.person_list !== "undefined") {
                            result.person_list.forEach(function(person_list_item){
                                if(i>0){
                                    $('#results-output').append('<hr>');
                                }
                                var exceptionsArray = ['META', 'created_details', 'years_list', 'address_key', 'organisation_key', 'dob_details'];
                                    
                                for (var key in person_list_item) {
                                    if(!key.includes('id') && !exceptionsArray.includes(key) ) {
                                        var keyName = key.replace('_', ' ');
                                        $('#results-output').append('<p class="output"><span>' + keyName + ':</span> ' + person_list_item[key] + '</p>');
                                    }
                                }
                                i++;
                            });
                        }
                        var i = 0;
                        if(typeof result.premises_list !== "undefined") {
                            result.premises_list.forEach(function(premises_list_item){
                                if(i>0){
                                    $('#results-output').append('<hr>');
                                }
                                var exceptionsArray = ['META', 'created_details', 'years_list', 'address_key', 'organisation_key', 'dob_details'];
                                    
                                for (var key in premises_list_item) {
                                    if(!key.includes('id') && !exceptionsArray.includes(key) ) {
                                        var keyName = key.replace('_', ' ');
                                        $('#results-output').append('<p class="output"><span>' + keyName + ':</span> ' + premises_list_item[key] + '</p>');
                                    }
                                }
                                i++;
                            });
                        }
                    }
                    $('.address-person-example').hide();
                    $('.results').show(); 
               }
            });
        }
    });
    
    $('.results-return').on('click', function(e){
        e.preventDefault();
        $('#results-output').empty();
        
        $('.address-person-example').show();
        $('.results').hide();
    });
});

function errorBefore(msg, insertBefore) {
    $('<p class="error">' + msg + '</p>').insertBefore(insertBefore);
}

Javascript key


<div class="address-person-example">
  <form class="address-person-form">

    <div class="form-group">
          <label for="surname">Postcode</label>
          <input type="text" class="form-control" id="postcode" placeholder="Postcode">
      </div>

    <div class="form-group">
          <label for="surname">Premises</label>
          <input type="text" class="form-control" id="premises" placeholder="Building name or number">
      </div>

    <button type="submit" class="btn example-submit">Submit</button>
  </form>
</div>

<div class="results">
  <div id="results-output"></div>
  <a class="results-return" href="#">Back to search</a>
</div>
                
.address-person-example, .results {
  margin: 20px auto;
  width: 400px;
}

form.address-person-form, .results {
    background-color: #F6F6F6;
    border: 1px solid #CBCBCB;
    padding: 15px;
}

.example-submit {
    background-color: #F0614C;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 400;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.193em;
    width: 138px;
    height: 41px;
    margin-top: 10px;
}

.results {
  display: none;
}

.results-return {
    font-weight: 600;
    color: #F0614C;
}

#results-output span {
    font-weight: bold;
    text-transform: capitalize;
}

#results-output hr {
    border-top: 1px solid #000;
}

.error {
  font-size: 11px;
  color: #f00;
}
                
$(document).ready(function(){ 	
    $(".address-person-form").submit(function(e) {
        e.preventDefault();	

        $('.error', $(this)).remove();

        var postcode = $("#postcode");        if(!postcode.val()) {
                errorBefore("Please enter a postcode.", postcode);
            }

        var premises = $("#premises");        if($('.error', $(this)).length) {	
            $('.error', $(this)).first().next('input').focus();
        } else {
            $.ajax({
                url: 'https://t2a.io/ajax/getExampleJSKey',
                dataType: 'json',
                success: function (result) {       
                        
                    if (result.status)
                    {       
                        $.ajax({
                            url: 'https://api.t2a.io/rest/rest.aspx',
                            dataType: 'json',
                            data: {
                                'method'   : "address_person",
                                'javascript_key'  : result.javascript_key,
                                'domain' : "t2a.io", 
                                'postcode' : postcode.val(),
                                'premises' : premises.val(),
                                'output'   : 'json'
                            },
                            success: function(result){
                        if(result.status == "error") {
                            $('#results-output').append('<p class="output"><strong>Error:</strong>' + result.error_code +'</p>');
                        } else {
                            var i = 0;
                            if(typeof result.person_list !== "undefined") {
                                result.person_list.forEach(function(person_list_item){
                                    if(i>0){
                                        $('#results-output').append('<hr>');
                                    }
                                    
                                    var exceptionsArray = ['META', 'created_details', 'years_list', 'address_key', 'organisation_key', 'dob_details'];
                                    
                                    for (var key in person_list_item) {
                                        if(!key.includes('id') && !exceptionsArray.includes(key) ) {
                                            var keyName = key.replace('_', ' ');
                                            $('#results-output').append('<p class="output"><span>' + keyName + ':</span> ' + person_list_item[key] + '</p>');
                                        }
                                    }
                                    i++;
                                });
                            }
                            var i = 0;
                            if(typeof result.premises_list !== "undefined") {
                                result.premises_list.forEach(function(premises_list_item){
                                    if(i>0){
                                        $('#results-output').append('<hr>');
                                    }
                                    
                                    var exceptionsArray = ['META', 'created_details', 'years_list', 'address_key', 'organisation_key', 'dob_details'];
                                    
                                    for (var key in premises_list_item) {
                                        if(!key.includes('id') && !exceptionsArray.includes(key) ) {
                                            var keyName = key.replace('_', ' ');
                                            $('#results-output').append('<p class="output"><span>' + keyName + ':</span> ' + premises_list_item[key] + '</p>');
                                        }
                                    }
                                    i++;
                                });
                            }
                       }
                                $('.address-person-example').hide();
                                $('.results').show(); 
                            }
                        });
                    }
                }
            });
        }
    });
    
    $('.results-return').on('click', function(e){
        e.preventDefault();
        $('#results-output').empty();
        
        $('.address-person-example').show();
        $('.results').hide();
    });
});

function errorBefore(msg, insertBefore) {
    $('<p class="error">' + msg + '</p>').insertBefore(insertBefore);
}

This example first needs to call to a file on your server, which will provide the user with an API key from your javascript key.

In our example above we have used a PHP file located at ajax/getExampleJSKey which looks like the example below

    <?php

        $url = 'https://api.t2a.io/rest/rest.aspx'
            . "?method=javascript_key"
            . "&api_key=fDl8S-DC2C9uySZmC_wItp1Olp-CQQ88DOucUIPz9Xzn" .
            . "&domain=" . $_SERVER['HTTP_HOST'];
            . '&ip_address=' . $_SERVER['REMOTE_ADDR']
            . "&lifetime_minutes=10";

        $result = simplexml_load_file($url);

        if ($result->javascript_key) {
            echo (string)$result->javascript_key;
        }