UK Towns List

The UK Towns List API

You can now access our list of UK towns through our API saving you both time and money. The API is easy to use - and can be set up within seconds.

Your API key is:
WzPspYbrZB9XABOb
Bookmark this page for future reference
20 Credits remaining

Suitable for web or mobile applications

All data is returned in JSON format suitable for both web and mobile applications.

Flexible usage

All API keys are created with 20 free credits to help you on your way. Every request costs 1 credit and credits can be topped up below.

UK Towns Database

Adding credits to your API key

By default, all API keys created are created with 20 credits to help integrate with your application. For production use, you can top up credits by purchasing them with the following form. The more credits you purchase, the more you save. 1 API request costs 1 credit.

How to use the API

Once you have created an API Key (above), you can then begin to use the API and query the UK towns database. This works by accessing a URL with specific parameters to return a set of data. All URLs need to include the API Key. For example, the following URL will fetch all towns in Dorset:

https://www.uktownslist.co.uk/api/?apikey=WzPspYbrZB9XABOb&county=Dorset

Please remember to URL encode all parameters. In the following examples, replace the bold values with your actual values.


Retrieve all UK counties

To retrieve all counties from the API, do not specify any parameter other than the API key

https://www.uktownslist.co.uk/api/?apikey=WzPspYbrZB9XABOb

Retrieve all towns in any UK county

To retrieve all towns in a county from the API, specify the 'county' parameter.

https://www.uktownslist.co.uk/api/?apikey=WzPspYbrZB9XABOb&county=Dorset

Retrieve town information for a UK postcode

To retrieve all town information from the API, specify the 'postcode' parameter.

https://www.uktownslist.co.uk/api/?apikey=WzPspYbrZB9XABOb&postcode=SW11+5