James Peret: 02b39277c9 cloned project and fixed highlighter bug 9 gadi atpakaļ | ||||
---|---|---|---|---|
public | 02b39277c9 | 9 gadi atpakaļ | ||
views | 02b39277c9 | 9 gadi atpakaļ | ||
.gitignore | 02b39277c9 | 9 gadi atpakaļ | ||
.ruby-version | 02b39277c9 | 9 gadi atpakaļ | ||
Gemfile | 02b39277c9 | 9 gadi atpakaļ | ||
Gemfile.lock | 02b39277c9 | 9 gadi atpakaļ | ||
README.md | 02b39277c9 | 9 gadi atpakaļ | ||
analytics.rb | 02b39277c9 | 9 gadi atpakaļ | ||
config.ru | 02b39277c9 | 9 gadi atpakaļ | ||
json_parser.rb | 02b39277c9 | 9 gadi atpakaļ | ||
main.rb | 02b39277c9 | 9 gadi atpakaļ | ||
unirest_parser.rb | 02b39277c9 | 9 gadi atpakaļ |
A simple WHOIS lookup API.
Based on the Whoiz application by Jason Ormand and using the Ruby Whois gem.
{
"domain": "jamesperet.com",
"owner": "James Peret",
"registrar": "eNom Inc.",
"expires_on": "2016-06-07T16:01:00.00Z",
"update_on": "2015-05-13 00:00:00 -0300",
"registered?": true,
"available?": false
}
Provide a url for the API and get a nicely formatted JSON response with the domain information.
http://whois.j1x.co
http://whois.j1x.co/lookup.json?url=jamesperet.com
curl http://whois.j1x.co/lookup.json?url=jamesperet.com
This are the options for querying the API:
url
- The domain url that will be queried. Omit the http://www.
.raw=true
- the JSON response will include a raw version of the data received by the registrardev=true
- Only basic information and the raw version will be included in the JSON response. No parsing will be done with the data. This is useful for debugging.Example:
http://whois.j1x.co/lookup.json?url=google.com&raw=true
git clone git://gitlab.j1x.co/j1x/whois-server.git
Edit main.rb
:
before do
response['Access-Control-Allow-Origin'] = 'http://yourwebsite.com'
end
Or use *
to allow any website to access the API.
heroku create
git push heroku master
heroku open
For now the supported domains are: .com
, .net
, .com.br
and .network
. Support for more domains will come in the future.
The queries for .com.br
domains usually come with limited information because of the registrar's API call allowance.
There is also a bug where some .com
domains return an error (ex: google.com).