3

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 ?

Mandeep Singh
  • 7,674
  • 19
  • 62
  • 104

3 Answers3

5

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

jwbensley
  • 10,534
  • 19
  • 75
  • 93
2

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

Aaron D
  • 7,540
  • 3
  • 44
  • 48
Chris
  • 4,672
  • 13
  • 52
  • 93
  • I used the whois search which gives all results belonging to the IP address. `function getRIPEWhoisUrl(ipv4){ return "https://apps.db.ripe.net/search/query.html?searchtext="+ ipv4 + "#resultsAnchor"; } ` Use the header `Accept: application/json` to get the JSON results – Mandeep Singh Apr 18 '16 at 04:44
1

You didn't write {key} part right. Inetnum objects on RIPE have "193.0.0.0 - 193.0.7.255" type of key. You must make a request like this:

https://rest.db.ripe.net/ripe/inetnum/91.123.16.0 - 91.123.31.255

Andrey M.
  • 11
  • 2