IP地理定位 - JSON端点
API的基本路径是
https://api.i.pn/json/{query}
{query} 可以是单个IPv4地址。如果您未提供查询,则将使用当前IP地址。
参数
查询参数(例如自定义字段)作为GET请求参数附加,例如:
https://api.i.pn/json/18.97.14.85?fields=61439
| 字段 | 响应字段可选 |
不需要API密钥。
快速测试
您可以编辑此查询并尝试不同的选项
GET
响应
返回的数据
API可以返回以下字段和值
如果您不需要所有返回的字段,请使用GET参数fields来指定应返回的数据。用逗号分隔字段(fields=status,query,country,city)或使用生成的数值(以节省带宽)
name | description | example | type | |
|---|---|---|---|---|
query | IP used for the query | 173.194.67.94 | string | |
status | success or fail | success | string | |
type | IP type | 4 | int | |
country | Country name | United States | string | |
countryCode | Two-letter country code ISO 3166-1 alpha-2 | US | string | |
countryTier | Country tier | 1 | int | |
regionName | Region/state | California | string | |
city | City | Mountain View | string | |
cityId | City ID | 2973783 | int | |
stateId | State ID | 11071622 | int | |
asn | Autonomous system number | 15169 | int | |
isTransparent | Transparent proxy | true | bool | |
as | AS number and organization, separated by space (RIR). Empty for IP blocks not being announced in BGP tables. | AS15169 Google Inc. | string | |
mobile | Mobile (cellular) connection | true | bool | |
proxy | Proxy, VPN or Tor exit address | true | bool | |
hosting | Hosting, colocated or data center | true | bool | |
blacklists | Blacklists | [] | array | |
continent | Continent name | North America | string | |
continentCode | Two-letter continent code | NA | string | |
region | Region/state short code (FIPS or ISO) | CA or 10 | string | |
asName | AS name (RIR). Empty for IP blocks not being announced in BGP tables. | GOOGLE | string | |
zip | Zip code | 94043 | string | |
lat | Latitude | 37.4192 | float | |
lon | Longitude | -122.0574 | float | |
timezone | Timezone (tz) | America/Los_Angeles | string | |
offset | Timezone UTC DST offset in seconds | -25200 | int | |
currency | National currency | USD | string | |
isp | ISP name | Google | string | |
org | Organization name | Google | string | |
reverse | Reverse DNS of the IP (can delay response) | wi-in-f94.1e100.net | string | |
district | District (subdivision of city) | Old Farm District | string |
生成的字段
query,status,country
https://api.i.pn/json/{query}?fields=query,status,country
生成的数值
11
https://api.i.pn/json/{query}?fields=11