Hello!,
awfully sorry if my post is off-topic,
please, would you kindly advise, if/how is it possible to determine Company name having it’s IP/range through the RIPE API?
I tried this: http://rest.db.ripe.net/search.json?query-string=212.166.147.0&flags=no-filtering
it nearly works, but not 100%: there may be organization name in either of “netname”, “org-name”, “org”, but sometimes i’m getting responses without any of them, with only “desc” field. (It may gravely complicate parsing logic, at least, apart from my doubts if i’m on correct curve at all).
Is there some straightforward way to get the organization name by IP ? F.e. i have smarthone, it’s IP and want to find out which mobile operator gave this IP at the moment and place?
Sorry once again, i used whois many times, but now need to go deeper…
Hello,
You’re on the right track, the “org:” reference in an inetnum or inet6num object points to an organisation object, which contains an “org-name:” attribute with the organisation’s name.
By default when you search the RIPE database, the referenced organisation is always returned. If there is no “org:” reference then you must perform a less-specific query (i.e. with the flags=L query parameter), and find the closest-matching inetnum or inet6num with an “org:” reference.
For more complete documentation about the RIPE DB REST API, have a look on GitHub:
If you want to include address space that’s not in the RIPE database, then I suggest you use the RDAP API:
To find a company name by IPv4 or IPv6 using the RIPE Database API, you can use the following steps:
Determine the IPv4 or IPv6 address that you want to look up.
Use the RIPE Database API to send a query for the IP address. The API supports a variety of query formats, including HTTP, REST, and Whois. Here is an example of a REST API query:
Replace `<ip address>` with the IPv4 or IPv6 address that you want to [look](https://www.handy-reparatur-berlin.com/iphone.html) up.
3. Parse the response from the API to extract the company name. The response will include a variety of information about the IP address, including the company name or organization that is associated with it. The specific field that contains this information may vary depending on the query format and API version.
Here is an example of a response from the REST API query:
{
"objects": [
{
"source": "RIPE",
"type": "inetnum",
"primary-key": "193.0.0.0 - 195.255.255.255",
"attributes": [
{
"name": "netname",
"value": "EU-ZZ-193-194-195"
},
{
"name": "descr",
"value": "EU Administrative Contact"
},
{
"name": "org",
"value": "ORG-CA1-RIPE"
},
{
"name": "country",
"value": "EU"
},
{
"name": "admin-c",
"value": "CREW-RIPE"
}
]
}
],
"terms-and-conditions": "https://www.ripe.net/db/support/db-terms-conditions.pdf"
}
In this example, the `org` attribute contains the name of the organization associated with the IP address. So, In case if you need more help you can place below a comment with my mentioned name. I will check it and ans you ASAP!
Have you considered exploring other APIs or methods besides the RIPE API for obtaining organization names associated with an IP address? If so, what alternatives have you explored or considered?
The URL you provided seems to be a valid attempt to retrieve information from the RIPE database. However, as you’ve noticed, the organization name may appear in different fields such as “netname,” “org-name,” “org,” or “desc.”
You'll need to parse the JSON response and check these fields for the organization name.
If none of these fields contain the organization name, you might need to consider additional fields or fallback options.
Since the response structure can vary, you’ll need to handle different cases in your parsing logic. This may involve checking for the presence of each possible field and extracting the relevant information accordingly.
My query http://rest.db.ripe.net/search.json?query-string=192.168.1.0&flags=no-filtering sometimes returns the org or org-name, but other times only the descr field. This inconsistency is complicating my parsing logic. Has anyone found a more consistent method to extract the organization name? Thanks!