Find a UK dialling code

Find out what you can do with our API...

Returns UK postal areas and dialling codes for a UK location, and vice versa.

Dialling codes can be found by entering a location name or postal area such as YO or YO10 5NP. Alternatively you can enter a dialling code to find out where that number is calling from. Dialling codes correspond to a specific geographical area. Integrating this service will help you to identify where a call is coming from or determine if you have the correct telephone number for a specific area.

Try our online demo to see how this service could benefit you.

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.
text Enter a UK place name, postcode area or dialling code.

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.

Returned Values


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

Note that this has an array nested within an array (area_code records contain an array of place records).

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.
area_code_list An array of area_code records.

Response Structure <area_code>


This structure is only used by this method.

Element Description
code The UK dialling code, for example 0113.
place_list_num The number of records in the place_list array.
place_list An array of place records.

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


This is an actual response for the text value Weymouth:-


<?xml version="1.0"?>
<area_code_res>
  <t2a_version_number>1.0.0</t2a_version_number>
  <status>ok</status>
  <mode>normal</mode>
  <area_code_list>
    <area_code>
      <code>01630</code>
      <place_list_num>1</place_list_num>
      <place_list>
        <place>
          <name>Weymouth, Market Drayton, Shropshire</name>
        </place>
      </place_list>
    </area_code>
    <area_code>
      <code>01305</code>
      <place_list_num>1</place_list_num>
      <place_list>
        <place>
          <name>Weymouth, Dorset</name>
        </place>
      </place_list>
    </area_code>
  </area_code_list>
</area_code_res>

API Endpoint & Authentication

Demo

Enter an area code (e.g. 01904), a location (e.g. Liverpool or newcastl*) or a postal area (e.g. YO or YO10 5NP)

Price calculator

Price Calculator

Number of checks: 50 Price per check: 50p