Determining company name from IP address

user2948687 picture user2948687 · Nov 2, 2013 · Viewed 35.9k times · Source

I apologize for the broad question. But I have a list of IP addresses, and would like to connect them to the companies they came from.

I'm not interested in identifying personal IP address information (probably not even possible) but I figure there must be a way to identify if the IP address is associated with a large corporation.

Whois.net usually only gives the ISP name, not the company name.

Thank you

Answer

Ben Dowling picture Ben Dowling · Aug 6, 2014

The http://ipinfo.io API (my own service) returns the company name as the org field:

$ curl http://ipinfo.io/198.252.206.16
{
  "ip": "198.252.206.16",
  "hostname": "stackoverflow.com",
  "city": null,
  "region": null,
  "country": "US",
  "loc": "38.0000,-97.0000",
  "org": "AS25791 Stack Exchange, Inc."
}

You can get just that field by adding /org to the URL:

$ curl http://ipinfo.io/198.252.206.16/org
AS25791 Stack Exchange, Inc.

You can combine this with some other commands to do a bulk lookup of all of your IPs and see what company they belong to:

$ cat ips.txt | xargs -I% curl -s http://ipinfo.io/%/org | paste ips.txt -
198.252.206.16  AS25791 Stack Exchange, Inc.
173.252.110.27  AS32934 Facebook, Inc.
74.125.239.132  AS15169 Google Inc.
206.190.36.45   AS36647 Yahoo

You can find out more details about the API at http://ipinfo.io/developers.