How do I look up domain names?

September 8, 2015     0 comments

If you would like to use our Domain lookup, please read on.

At the moment, the API call is a GET call, the URL is

https://api.laws-hosting.co.uk/domains.php

The options are:

apikey : You will need a api key to authenticate with us, please contact us for this;
service : This is the service, there are only 2 at the moment "whois" and "gettlds";
domain-name : The domain name (without the extension) you wish to check, eg. laws-hosting;
tld : The extension, eg. co.uk, com, net, etc;

So, to make a request to check laws-hosting.co.uk, you would do

https://api.laws-hosting.co.uk/domains.php?apikey=<YOURAPIKEY>&service=whois&domain-name=laws-hosting&tld=co.uk

It will output as a JSON response, like so:

{"status":"Registered","domain":"laws-hosting.co.uk","remaining_requests":"349"}

Currently, we allow 350 API requests a month.

We do not cater for every TLD, so to see what we offer, you would issue a call like so:

https://api.laws-hosting.co.uk/domains.php?apikey=<YOURAPIKEY>&service=gettlds

It will output as a JSON response, like so:

{"tlds":"co.uk|bar|uk|berlin|bid|.. etc}
Then you can use this output for a select box for your users to choose the desired TLD. Ideally, we ask you to grab the TLD list then save it either in a file of a database field - you should only request again every week or month.


We have added a example class to github, you can go to DomainAPI.php and grab it.



How helpful was this article to you?

FraudLabs Pro Secured Seal