请问有没有比较好的免费的查询外网 IP 的服务?

2016-05-21 20:31:22 +08:00
 soli
我知道 ip.cnip38.com 这些。
但是我想要的是支持 API 的。
比如,可以通过 curl 拿到单纯的 IP 、 JSON 格式的数据、自定义获取哪些字段等。

放狗搜到的要么是 ip.cn 之类的查看网页的,要么就是收费的(因为使用频率并不高)。
7346 次点击
所在节点    问与答
26 条回复
xmbaozi
2017-11-16 15:50:20 +08:00
https://haoip.cn/ 下还有其他页面,不想混一起
soli
2017-11-16 18:29:26 +08:00
@xmbaozi 一条路由就可以吧?你是用的什么开发的?
xmbaozi
2017-11-16 18:47:39 +08:00
@soli php。不是技术上的问题。
soli
2017-11-16 18:55:35 +08:00
@xmbaozi 了解。
stevenhawking
2019-08-14 11:13:00 +08:00
lxk11153
2019-12-05 09:46:42 +08:00
我来加几个参数: ` curl -q -Lm 9 ip.cn/ `

-q, --disable
If used as the first parameter on the command line, the curlrc config file will not be read and used.

-L, --location
(HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place.

-m, --max-time <seconds>
Maximum time in seconds that you allow the whole operation to take.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/280294

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX