Jonathan
Jonathan

Reputation: 11355

How to query the RIPE API for JSON

How do you get the RIPE REST API to give you in JSON the same data you'd get from the whois command on the command line?

Eg. Something like the output of

whois 1.1.1.1

Upvotes: -2

Views: 1007

Answers (2)

Jonathan
Jonathan

Reputation: 11355

Here's how to do this in Python

from ipwhois import IPWhois
from pprint import pprint

ip = "1.1.1.1"
obj = IPWhois(ip)
results = obj.lookup_rdap(depth=1)
pprint(results)

Upvotes: 0

Cacoon
Cacoon

Reputation: 2538

https://whoapi.com/ But id imagine there are easier ways and/or cheaper ways Like setting up a VPS with nodejs backend and using something like so: https://www.npmjs.com/package/parse-whois

You would learn more building that (its quick enough to create aswell) than using someone elses API, more customizable for your situation aswell

Upvotes: 0

Related Questions