自分(クライアント)のIP情報を取得する方法
curl ipinfo.io
{
"ip": "111.xxx.yyy.zzz",
"hostname": "xxxyyyzzz.aa-net.ne.jp",
"city": "Tokyo",
"region": "Tokyo",
"country": "JP",
"loc": "xxx.xxxx,xxx.yyyy",
"org": "ASxxxx yyyy CORPORATION",
"postal": "xxx-yyyy",
"timezone": "Asia/Tokyo",
"readme": "https://ipinfo.io/missingauth"
}
指定したIPアドレスの情報を取得する方法
例:Twitter
curl ipinfo.io/104.244.42.129
{
"ip": "104.244.42.129",
"city": "New York City",
"region": "New York",
"country": "US",
"loc": "40.7143,-74.0060",
"org": "AS13414 Twitter Inc.",
"postal": "10004",
"timezone": "America/New_York",
"readme": "https://ipinfo.io/missingauth"
}
例:Amazon
curl ipinfo.io/52.193.175.205
{
"ip": "52.193.175.205",
"hostname": "ec2-52-193-175-205.ap-northeast-1.compute.amazonaws.com",
"city": "Tokyo",
"region": "Tokyo",
"country": "JP",
"loc": "35.6895,139.6917",
"org": "AS16509 Amazon.com, Inc.",
"postal": "151-0052",
"timezone": "Asia/Tokyo",
"readme": "https://ipinfo.io/missingauth"
}