需求描述
需要一些API地址,用来查询IP地址的归属国家/地区,查询IP地址的ISP信息,AS信息。
1、段落1,http://ip-api.com/YourSearchIP
获取其返回值的 countryCode as 字段的信息
curl http://ip-api.com/204.44.115.22 { "status" : "success", "continent" : "North America", "continentCode": "NA", "country" : "United States", "countryCode" : "US", "region" : "TX", "regionName" : "Texas", "city" : "Dallas", "district" : "", "zip" : "75247", "lat" : 32.8137, "lon" : -96.8704, "timezone" : "America/Chicago", "offset" : -18000, "currency" : "USD", "isp" : "QuadraNet Enterprises LLC", "org" : "Security Frame", "as" : "AS8100 QuadraNet Enterprises LLC", "asname" : "ASN-QUADRANET-GLOBAL", "mobile" : false, "proxy" : false, "hosting" : true, "query" : "204.44.115.22" }
2. 段落2、http://ipinfo.io/YourSearchIP/geo
获取其返回值的 country org 字段的信息
curl http://ipinfo.io/204.44.115.22/geo { "ip": "204.44.115.22", "hostname": "geek.gonetell.com", "city": "Dallas", "region": "Texas", "country": "US", "loc": "32.8152,-96.8703", "org": "AS8100 QuadraNet Enterprises LLC", "postal": "75247", "timezone": "America/Chicago", "readme": "https://ipinfo.io/missingauth" }
3、段落3、https://ipapi.co/YourSearchIP/json
获取其返回值的 country_code asn org 字段的信息
curl https://ipapi.co/204.44.115.22/json { "ip": "204.44.115.22", "version": "IPv4", "city": "Dallas", "region": "Texas", "region_code": "TX", "country": "US", "country_name": "United States", "country_code": "US", "country_code_iso3": "USA", "country_capital": "Washington", "country_tld": ".us", "continent_code": "NA", "in_eu": false, "postal": "75247", "latitude": 32.8137, "longitude": -96.8704, "timezone": "America/Chicago", "utc_offset": "-0500", "country_calling_code": "+1", "currency": "USD", "currency_name": "Dollar", "languages": "en-US,es-US,haw,fr", "country_area": 9629091.0, "country_population": 327167434, "asn": "AS8100", "org": "ASN-QUADRANET-GLOBAL" }