O'Reilly logo

Data Source Handbook by Pete Warden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 1. Data Source Handbook

Websites

The whois Unix command is still a workhorse, and I’ve found the web service a decent alternative, too. You can get the basic registration information for any website. In recent years, some owners have chosen “private” registration, which hides their details from view, but in many cases you’ll see a name, address, email, and phone number for the person who registered the site. You can also enter numerical IP addresses here and get data on the organization or individual that owns that server.

Unfortunately the terms of service of most providers forbid automated gathering and processing of this information, but you can craft links to the Domain Tools site to make it easy for your users to access the information:

<a href="http://whois.domaintools.com/www.google.com">Info for www.google.com</a>

There is a commercial API available through whoisxmlapi.com that offers a JSON interface and bulk downloads, which seems to contradict the terms mentioned in most WHOIS results. It costs $15 per thousand queries. Be careful, though; it requires you to send your password as a nonsecure URL parameter, so don’t use a valuable one:

curl "http://www.whoisxmlapi.com/whoisserver/WhoisService?\ domainName=oreilly.com&outputFormat=json&userName=<username>&password=<password>" {"WhoisRecord": { "createdDate": "26-May-97", "updatedDate": "26-May-10", "expiresDate": "25-May-11", "registrant": { "city": "Sebastopol", "state": "California", "postalCode": "95472", "country": ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required