Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RIPE: How to lookup IP Address using REST API

Tags:

whois

As per the RIPE REST API documentation, one needs to specify the requests in the following format:

http://rest.db.ripe.net/{source}/{objecttype}/{key}

So I am assuming that looking up an IP address will be like this:

http://rest.db.ripe.net/ripe/inetnum/193.0.6.142.json

However, the response I get is :

{
  "link": {
    "type": "locator",
    "href": "http://rest.db.ripe.net/ripe/inetnum/193.0.6.142"
  },
  "errormessages": {
    "errormessage": [
      {
        "severity": "Error",
        "text": "ERROR:101: no entries found\n\nNo entries found in source %s.\n",
        "args": [
          {
            "value": "RIPE"
          }
        ]
      }
    ]
  },
  "terms-and-conditions": {
    "type": "locator",
    "href": "http://www.ripe.net/db/support/db-terms-conditions.pdf"
  }
}

What am I doing wrong ?

like image 656
Mandeep Singh Avatar asked Oct 21 '25 04:10

Mandeep Singh


2 Answers

You are using the wrong URL, the correct URL for your example query would be:

http://rest.db.ripe.net/search.json?query-string=193.0.0.0/21&flags=no-filtering

Or this for XML:

http://rest.db.ripe.net/search.xml?query-string=193.0.0.0/21&flags=no-filtering

like image 157
jwbensley Avatar answered Oct 24 '25 00:10

jwbensley


Looks like https://rest.db.ripe.net/search.json?query-string=193.0.6.142 is the correct link to use. This seems to return back the same data as I see on ripe.net

like image 23
Chris Avatar answered Oct 24 '25 00:10

Chris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!