IP协议:修订间差异

无编辑摘要
无编辑摘要
 
第12行: 第12行:


===IPv6===
===IPv6===
==IP地址查询==
查询外网IP地址
{| class="wikitable"
! 名称
! 描述
! 网址
|-
| httpbin.org
| <syntaxhighlight lang="python" >
https://httpbin.org/ip
</syntaxhighlight>
|官网:https://httpbin.org/ <br />源代码:https://github.com/postmanlabs/httpbin
|-
|
|
|
|-
|
|
|
|}
Python语言中示例:
<syntaxhighlight lang="python" >
import requests
import json
res = requests.get('https://httpbin.org/ip')
ip = json.loads(res.text)['origin']
print(ip)
</syntaxhighlight>


==IP定位==
==IP定位==
第18行: 第50行:
! 名称
! 名称
! 描述
! 描述
! 地址
! 网址
|-
|-
| ip-api.com
| ip-api.com
| 个人:免费,不需要API密钥。
| 个人:免费,不需要API密钥,支持IPv4和IPv6,频率45次/分钟,不能商用,不能使用https。  <syntaxhighlight lang="text" >
| https://ip-api.com/
# 本机IP位置
http://ip-api.com/json/?lang=zh-CN
 
# 指定IP位置
http://ip-api.com/json/IP地址?lang=zh-CN
</syntaxhighlight>
| 官网:https://ip-api.com/  <br />费用:https://members.ip-api.com/
|-
|-
|
|

2022年12月21日 (三) 06:31的最新版本

网际协议(Internet Protocol),简称IP,又称互联网协议,是互联网协议套件(TCP/IP)中的网络层的主要协议。IP主要包含:IP编码地址、分组封装和转发。目前互联网使用IP有两个版本IPv4和IPv6。

简介

时间轴

IP地址

IP数据包

IPv4

IPv6

IP地址查询

查询外网IP地址

名称 描述 网址
httpbin.org
https://httpbin.org/ip
官网:https://httpbin.org/
源代码:https://github.com/postmanlabs/httpbin

Python语言中示例:

import requests
import json

res = requests.get('https://httpbin.org/ip')
ip = json.loads(res.text)['origin']
print(ip)

IP定位

通过IP获取地理位置,通常是非精确定位,一般到区/县。

名称 描述 网址
ip-api.com 个人:免费,不需要API密钥,支持IPv4和IPv6,频率45次/分钟,不能商用,不能使用https。
# 本机IP位置
http://ip-api.com/json/?lang=zh-CN

# 指定IP位置
http://ip-api.com/json/IP地址?lang=zh-CN
官网:https://ip-api.com/
费用:https://members.ip-api.com/
淘宝IP地址库
https://ip.taobao.com/outGetIpInfo?ip=IP地址&accessKey=alibaba-inc
http://ip.taobao.com/instructions.html
腾讯位置服务 支持IPV4、IPv6地址定位。 https://lbs.qq.com/service/webService/webServiceGuide/webServiceIp
高德开放平台 仅支持IPV4,不支持国外IP解析。 https://lbs.amap.com/api/webservice/guide/api/ipconfig
百度地图开放平台
普通IP定位
https://lbsyun.baidu.com/index.php?title=webapi/ip-api

资源

网站