Find 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.


This method will find who lives at an address in the UK, retrieving names and telephone numbers of both current and previous occupants.

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.

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.

uncapped total

The total number of person records, when the result as capped at a maximum of 200; total_records will be 200 in this rare instance.

The values in the <person> element.

Name

Type

Description

title

string

The person’s title, such as Mr, Mrs, Ms etc.

forename

string

The person’s first name

middle_initial

string

The second initial

surname

string

The person’s surname

name_single_line

string

The name on a single line, comprising title, forename, middle initial and surname; for example:-

Mr Alan Fiction

Jean A Dreamer

line_1

string

Address line 1

line_2

string

Address line 2

line_3

string

Address line 3

place

string

The place. If the address is in a named area within a large town, this will be that area, otherwise it will be the town. place is never empty if town is set.

town

string

The town; only used if the address is in a named area within that town.

postcode

string

The UK postal code, formatted to include the space.

addr_single_line

string

The address, formatted as a single line. Commas are inserted between the major elements, and the postcode is included, if available.

years_list

string

A list of years, in which the electoral roll record for this person has been found.

This is only set by the electoral_roll and address_person methods.

Please note that the XML returns an array of Strings; each year is a single String:-

                
<years_list>
    <string>2008</string>
    <string>2009</string>
    <string>2010</string>
    <string>2011</string>
</years_list>
                

The JSON returns an array of years thus:-

"years_list":["2009","2010","2011"],

years_text

string

A simple string describing the years range, such as 2017-

telephone_number

string

The person’s telephone number.

mobile

string

The person’s mobile phone number

An array of records is returned from address_person - the end user should select the premises at which to view the occupants. Use the name value to replace the premises input parameter value.

You must use the entire name value, including the postal code, when replacing the premises value.

Name

Type

Description

name

string

The name of a premises, for example:-

27 Imagination Gardens (YO10 5DG)


Error Codes


Name

Description

missing_postcode

The mandatory postcode character is requited.

invalid_postcode

The supplied postcode is not a valid UK postcode.

invalid_address

The supplied premises parameter is not a valid address at the postcode.

See the common error codes.

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



<address_person_res>
  <mode>normal</mode>
  <status>ok</status>
  <credit_used>0</credit_used>
  <t2a_version_number>3.3.8.0</t2a_version_number>
  <person_list>
    <person>
      <line_1>25</line_1>
      <line_2>Imagination Gardens</line_2>
      <line_3>Virtual Road</line_3>
      <place>Heslington</place>
      <town>York</town>
      <postcode>YO91 3X0</postcode>
      <addr_single_line>
        17 Imagination Gardens, Virtual Road, Heslington, York, YO91 3X0
      </addr_single_line>
      <years_text>2016-</years_text>
      <years_list>
        <string>2016</string>
        <string>2017</string>
        <string>2018</string>
        <string>2019</string>
        <string>2020</string>
      </years_list>
      <title>Mr</title>
      <forename>Alan</forename>
      <surname>Fiction</surname>
      <name_single_line>Mr Alan Fiction</name_single_line>
      <telephone_number>(01904) 000000</telephone_number>
      <director>N</director>
      <created_details>
        <y>2016</y>
        <m>2</m>
        <d>1</d>
        <en>1 Feb 2016</en>
      </created_details>
    </person>
  </person_list>
</address_person_res>

Method Limits


The method has a limit of 100 persons to be returned, per address.

Should the address prove to have more than this total, only the first 100 persons will be returned. The <total_records> node will show 100, but the <uncapped_total> node will show the actual number of persons at the address.

Such addresses are very rare, and are mainly halls of residence, where the subdivision into discrete accommodation is not reflected in the single address point.

Result Caching


When a chargeable result is found (a list of residents) , the list is cached on our server for 60 minutes. If the successful search is repeated during that time, the list is displayed, but there is no charge.

Charging Policy


The method only charges when a valid postcode and premises are supplied.

Results will show live [REDACTED] data

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.

Please note: The examples below run on a sandbox environment which return sample data. To quality check the data we provide, up to 3 free searches are available in the demo tab with results showing live [REDACTED] data.

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'  : 'sandbox',
                    '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=sandbox" .
            . "&domain=" . $_SERVER['HTTP_HOST'];
            . '&ip_address=' . get_user_ip()
            . "&lifetime_minutes=10";

        $result = simplexml_load_file($url);

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

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

 

Get in touch

 

 

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