通过IP地址检测ISP(或/和国家/地区) [英] Detect ISP (or/and country) by IP Address

查看:726
本文介绍了通过IP地址检测ISP(或/和国家/地区)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

互联网上有很多服务我们可以找到我们机器的外部IP地址,但这些服务通常提供有关互联网提供商或国家(或两者)的信息。

There are plenty of services over the Internet where we can find out the external IP address of our machine, but also such services usually provide information about Internet provider or country (or both).

所以我的问题是:我怎样才能以编程方式获取这些信息知道IP地址?是否有一些公共目录或某些API用于检索此类信息?

So my question is: how can I obtain such information programmatically knowing the IP Address? Are there some public catalogs or some API's for retrieving such kind of information?

推荐答案

您可以使用我的服务, http://ipinfo.io API。以下是它提供的详细信息示例:

You can use my service, the http://ipinfo.io API. Here's an example of the details it provides:

$ curl ipinfo.io
{
  "ip": "67.188.232.131",
  "hostname": "c-67-188-232-131.hsd1.ca.comcast.net",
  "city": "Milpitas",
  "region": "California",
  "country": "US",
  "loc": "37.44040000000001,-121.87049999999999",
  "org": "AS7922 Comcast Cable Communications, Inc.",
  "postal": "95035",
  "phone": 408
}

有关详细信息,请参见 http://ipinfo.io/developers

See http://ipinfo.io/developers for more information.

这篇关于通过IP地址检测ISP(或/和国家/地区)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆