amuck-landowner

Reliable WHOIS Library/API

D. Strout

Resident IPv6 Proponent
As part of my domain and server management system, I'm trying to wrap my head around my options for WHOIS. All the APIs cost money, which would be fine if this was just for me, but if I distribute it I don't think people will want to sign up for accounts with them. Right now I'm trying to work with phpwhois, but there are a lot of extensions it doesn't support. (I think) the new gTLDs all use a standardized format, but extensions like .im and .io just aren't coming through right. So does anyone know if a good library or free API that I can use for this?

Alternatively, I could ditch WHOIS entirely, or at least the parsing thereof. Right now, WHOIS is used in two ways. First, there are just plain lookups, where it's perfectly fine to use raw output from phpwhois. The other, however, is for adding a domain to the system. With this, I used the parsed output to automatically retrieve creation/expiration dates and registrar info. This isn't vital, and in fact that info could easily be made optional. Still, I think it's a nice feature and would like to keep it if there is an easy way to retrieve this info.
 

lbft

New Member
joepie91's pythonwhois [1] [2] [3] was quite good the last time I looked at it. The simplest way to integrate it into your PHP code would be to run pwhois and parse its output.

It's WTFPL so you could always port it to PHP if you were so inclined (and wanted to save the additional step of executing the Python interpreter), but then you're stuck porting all the changes to suit changes in whois formatting (e.g. the new TLDs).
 

D. Strout

Resident IPv6 Proponent
I think I'll be sticking with phpwhois for now. I wrote parsers for .im and .io, and it seems to do okay with the most common extensions. Perhaps in a later version I'll add (optional) support for commercial APIs, for if folks don't like the quality of the results that phpwhois generates.

I should mention, BTW, that the parser I wrote for .io actually includes a scraper to get the whois from their website. Their public whois server gives out very limited details - expiration, owner, and nameservers only. The whois on the nic.io website, on the other hand, does registration, update, and expiration dates along with owner, tech contact, admin contact, billing contact, and registrar information. So I scraped it - had to set a custom user agent string with cURL.

Damn, I've been writing a lot of scrapers lately.
 
Last edited by a moderator:

FHN-Eric

Member
Verified Provider
We have an opensource solution on github. You can find it at https://github.com/whoisdoma/core, if you use it, you will need whoisdoma/installer. All you have to do is generate an api key, and add the whois servers. Or, if you would like we can generate you an api key so you can query our api servers. If you decide you want to go this route, you can reach us at [email protected].
 
Top
amuck-landowner