with pythonwhois if you favor, it could be
>>> import pythonwhois # i'm using this http://cryto.net/pythonwhois
>>> domains = ['google.com', 'stackoverflow.com']
>>> for dom in domains:
... details = pythonwhois.get_whois(dom)
... print details['contacts']['registrant']
which returns a dictionary
{'city': u'Mountain View',
'fax': u'+1.6506188571',
'name': u'Dns Admin',
'state': u'CA',
'phone': u'+1.6502530000',
'street': u'Please contact contact- [email protected], 1600 Amphitheatre Parkway',
'country': u'US',
'postalcode': u'94043',
'organization': u'Google Inc.',
'email': u'[email protected]'}
{'city': u'New York',
'name': u'Sysadmin Team',
'state': u'NY',
'phone': u'+1.2122328280',
'street': u'1 Exchange Plaza , Floor 26',
'country': u'US',
'postalcode': u'10006',
'organization': u'Stack Exchange, Inc.',
'email': u'[email protected]'}
edit: i checked your whois
this code worked for me.
>>> import whois
>>> domains = ['google.com', 'stackoverflow.com']
>>> for dom in domains:
... domain = whois.query(dom)
... print domain.name, domain.registrar
...
google.com MARKMONITOR INC.
stackoverflow.com NAME.COM, INC.
this api uses unix/linux's whois shell command and as it shown here you shouldn't add http://
before domain name. or if you have a unix/linux machine test this:
$ whois google.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information ...
but with http (it is maybe because of http(s) is a just a protocol type, and doesn't have any realiton with domain name itself)
$ whois http://google.com
No whois server is known for this kind of object.