Find International Dialling Codes

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

API method to use: country_dial

Skip to demo


Returns international dialling codes for a given country, and vice versa.

This service is essential for any organisation that has a need to make overseas calls. The correct international dialling code must prefix the telephone number in order to connect to that country.

The international dialling code for the UK is +44, therefore the usual format for dialling our offices in the UK from abroad would be +44 (0)1904 567765.

Try the service out with our online demo.

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 country name 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 <country_dial_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.
country_dial_list An array of country_dial records.

Response Structure <country_dial>

This structure is only used by this method.

Element Description
code The international dialling code.
name The country name.

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 united:-

<?xml version="1.0"?>
      <name>United Arab Emirates</name>
      <name>United Kingdom</name>
      <name>United States of America</name>

Back to Phone Numbers

Full API method list


Enter either an international dialling code or a country name.