整理一些完全免费开放的API接口

前言

在开发测试阶段,或者是在写Demo的时候,难免会用到一些测试数据,有时苦于没有可用的接口,需要自己动手去写,但是这样大大降低了效率,前期我也找了一些开放的接口,这篇文章整理一下,以下接口完全免费,不用注册,返回格式全是JSON,所有接口均可无限制使用,有需要的小伙伴可以进来看看。(ps:所有数据来源于网络,如有侵权,请作者联系删除)


各类无次数限制的免费API接口整理,主要是聚合数据上和API Store上的一些,还有一些其他的。
 
聚合数据提供30大类,160种以上基础数据API服务,国内最大的基础数据API服务,下面就罗列一些免费的各类API接口。

手机号码归属地API接口:
https://www.juhe.cn/docs/api/id/11

历史上的今天API接口:
https://www.juhe.cn/docs/api/id/63

股票数据API接口:
https://www.juhe.cn/docs/api/id/21

全国WIFI接口:
https://www.juhe.cn/docs/api/id/18

星座运势接口:
https://www.juhe.cn/docs/api/id/58

黄金数据接口:
https://www.juhe.cn/docs/api/id/29

语音识别接口:
https://www.juhe.cn/docs/api/id/134

周公解梦接口:
https://www.juhe.cn/docs/api/id/64

天气预报API接口:
https://www.juhe.cn/docs/api/id/73

身份证查询API接口:
https://www.juhe.cn/docs/api/id/38

笑话大全API接口:
https://www.juhe.cn/docs/api/id/95

邮编查询接口:
https://www.juhe.cn/docs/api/id/66

老黄历接口:
https://www.juhe.cn/docs/api/id/65

网站安全检测接口:
https://www.juhe.cn/docs/api/id/19

手机固话来电显示接口:
https://www.juhe.cn/docs/api/id/72

基金财务数据接口:
https://www.juhe.cn/docs/api/id/28

成语词典接口:
https://www.juhe.cn/docs/api/id/157

新闻头条接口:
https://www.juhe.cn/docs/api/id/235

IP地址接口:
https://www.juhe.cn/docs/api/id/1

问答机器人接口:
https://www.juhe.cn/docs/api/id/112

汇率API接口:
https://www.juhe.cn/docs/api/id/80

电影票房接口:
https://www.juhe.cn/docs/api/id/44

万年历API接口:
https://www.juhe.cn/docs/api/id/177

NBA赛事接口:
https://www.juhe.cn/docs/api/id/92

IP地址查询 
http://apistore.baidu.com/apiworks/servicedetail/114.html

频道新闻API_易源
http://apistore.baidu.com/apiworks/servicedetail/688.html

微信热门精选 :
http://apistore.baidu.com/apiworks/servicedetail/632.html

天气查询 
http://apistore.baidu.com/apiworks/servicedetail/112.html

中国和世界天气预报
http://apistore.baidu.com/apiworks/servicedetail/478.html

股票查询 
http://apistore.baidu.com/apiworks/servicedetail/115.html

身份证查询:
http://apistore.baidu.com/apiworks/servicedetail/113.html

美女图片 
http://apistore.baidu.com/apiworks/servicedetail/720.html

音乐搜索 
http://apistore.baidu.com/apiworks/servicedetail/1020.html

图灵机器人 
http://apistore.baidu.com/apiworks/servicedetail/736.html

汇率转换 
http://apistore.baidu.com/apiworks/servicedetail/119.html

节假日 
http://apistore.baidu.com/apiworks/servicedetail/1116.html

pullword在线分词服务
http://apistore.baidu.com/apiworks/servicedetail/143.html

去哪儿网火车票 
http://apistore.baidu.com/apiworks/servicedetail/697.html

笑话大全 
http://apistore.baidu.com/apiworks/servicedetail/864.html

银行卡查询服务
http://apistore.baidu.com/apiworks/servicedetail/735.html

语音合成 
http://apistore.baidu.com/apiworks/servicedetail/867.html

宅言API-动漫台词接口
http://apistore.baidu.com/apiworks/servicedetail/446.html

去哪儿景点门票查询
http://apistore.baidu.com/apiworks/servicedetail/140.html

手机号码归属地 
http://apistore.baidu.com/apiworks/servicedetail/794.html

体育新闻 
http://apistore.baidu.com/apiworks/servicedetail/711.html

手机归属地查询
http://apistore.baidu.com/apiworks/servicedetail/709.html

科技新闻 
http://apistore.baidu.com/apiworks/servicedetail/1061.html

空气质量指数 
http://apistore.baidu.com/apiworks/servicedetail/116.html

天狗健康菜谱 
http://apistore.baidu.com/apiworks/servicedetail/987.html

热门游记列表 
http://apistore.baidu.com/apiworks/servicedetail/520.html

天狗药品查询 
http://apistore.baidu.com/apiworks/servicedetail/916.html

汉字转拼音 
http://apistore.baidu.com/apiworks/servicedetail/1124.html

国际新闻 
http://apistore.baidu.com/apiworks/servicedetail/823.html

彩票 
http://apistore.baidu.com/apiworks/servicedetail/164.html

微信精选 
http://apistore.baidu.com/apiworks/servicedetail/863.html

天狗健康资讯 
http://apistore.baidu.com/apiworks/servicedetail/888.html

兴趣点检索 
http://apistore.baidu.com/apiworks/servicedetail/182.html

用药参考 
http://apistore.baidu.com/apiworks/servicedetail/754.html

天狗健康知识 
http://apistore.baidu.com/apiworks/servicedetail/899.html

奇闻趣事 
http://apistore.baidu.com/apiworks/servicedetail/633.html

花边新闻 
http://apistore.baidu.com/apiworks/servicedetail/768.html

天狗医院大全 
http://apistore.baidu.com/apiworks/servicedetail/988.html

生活健康 
http://apistore.baidu.com/apiworks/servicedetail/989.html

一些其他的API接口:

豆瓣开放 
https://developers.douban.com/wiki/?title=guide

淘宝开放平台 
http://open.taobao.com/?spm=a219a.7395905.1.1.YdFDV6

图灵语音 
http://www.tuling123.com/help/h_cent_andriodsdk.jhtml?nav=doc

讯飞语音http://www.xfyun.cn/robots/solution

马化腾的微信开放平台(对应的还有腾讯开放平台)
https://open.weixin.qq.com/

融云IM
https://developer.rongcloud.cn/signin?returnUrl=%2Fapp%2Fappkey%2FPv4vYQwaxSZdfpLX5AI%3D

百度开发者中心
http://developer.baidu.com/

人脸识别
http://www.faceplusplus.com.cn/

高德地图:
http://lbs.amap.com/

蜻蜓:
FMhttp://open.qingting.fm

 

 

图片类接口

美女图片:

  1. https://www.apiopen.top/meituApi?page=1
  2. https://www.easy-mock.com/mock/5c36b5d2be0a1c39bfd57589/img/beauty/page=1

风景图片:

  1. https://www.easy-mock.com/mock/5c36b5d2be0a1c39bfd57589/img/page=1

第一个接口每页有20条数据,多少页还不清楚,返回数据如图

后两个接口是我用Easy Mock写的,第一个接口一共3页,每一页有10条数据,page表示页码。第二个接口两页,每一页10条数据。返回数据如下图loading

音乐类接口

  1. 音乐搜索:https://api.apiopen.top/searchMusic?name=好久不见

返回数据如图loading

  1. 音乐详情:https://api.apiopen.top/musicDetails?id=604392760

返回数据如图loading

  1. 音乐排行榜:https://api.apiopen.top/musicRankings

该接口包含有热歌榜,新歌榜,网络歌曲榜,影视金曲榜,经典老歌榜以及欧美金曲榜。每个榜有4条数据,下面拿热歌榜数据如图loading

  1. 音乐排行榜详情:https://api.apiopen.top/musicRankingsDetails?type=1

返回数据如图loading

  1. 音乐电台:https://api.apiopen.top/musicBroadcasting

此接口有公共频道和音乐人频道,返回数据如图loading

  1. 音乐电台详情:https://api.apiopen.top/musicBroadcastingDetails?channelname=public_tuijian_spring

返回数据如图loading

视频类接口

  1. 视频分类:https://api.apiopen.top/videoHomeTab

共有22种分类,每一类又有详细的视频,返回数据如图loading

  1. 视频分类:https://api.apiopen.top/videoCategory

和上面的类似,返回数据如图

  1. 今日视频推荐:https://api.apiopen.top/todayVideo

返回数据如图loading

  1. 根据ID推荐视频:https://api.apiopen.top/videoRecommend?id=127398

返回数据如图loading

小说类接口

  1. 书籍分类:https://www.easy-mock.com/mock/5c3e90f39d8f6075a543c3cd/story/classify

用easymock写的,只有分类,包括类型和图片,共16中分类,返回数据如图loading

  1. 小说搜索:https://www.apiopen.top/novelSearchApi?name=盗墓笔记

该接口提供的搜索功能只限小说名称,返回数据如图loading

  1. 小说详情:https://www.apiopen.top/novelInfoApi?name=盗墓笔记

返回数据如图loading

天气类接口

  1. 搜索地方天气:https://www.apiopen.top/weatherApi?city=成都

返回数据如图loading

段子类接口

  1. 最新段子:https://api.apiopen.top/getJoke?page=1&count=2&type=video

返回数据如图loading

  1. 通过ID查段子:https://api.apiopen.top/getSingleJoke?sid=28654780

返回数据如图loading

  1. 随机推荐热门段子:https://www.apiopen.top/satinApi?type=1&page=1

返回数据如图loading

  1. 随机推荐热门段子评论列表:https://www.apiopen.top/satinCommentApi?id=27610708&page=1

返回数据如图loading

新闻类接口

  1. 实时新闻资讯:https://www.apiopen.top/journalismApi

返回数据如图loading

古诗词类接口

  1. 随机一首诗词推荐:https://api.apiopen.top/recommendPoetry

返回数据如图loading

  1. 古诗词作者搜索:https://api.apiopen.top/searchAuthors?name=李白

返回数据如图loading

  1. 模糊搜索(诗词名/作者):https://api.apiopen.top/likePoetry?name=锄禾

返回数据如图loading

  1. 获取宋朝古诗词:https://api.apiopen.top/getSongPoetry?page=1&count=20

每页20条数据,返回数据如图loading

  1. 获取唐朝古诗词:https://api.apiopen.top/getTangPoetry?page=1&count=20

每页20条数据,返回数据如图loading

个性网名接口

  1. 获取个性网名:https://www.apiopen.top/femaleNameApi?page=1

每页20条数据,返回数据如图loading

总结

以上所有接口我都测试过的,基本能够满足大家的开发需求,如果你在做自己的小项目,需要用到一些数据,可以用这些接口做测试,但是最好不要将这些API用于正式项目,因为有一些不稳定的因素,后期再遇到免费好用的或是我自己写的API还会添加上来,如果你也有可用的接口,可以私发给我,也加进来使其更加丰富。

:本文绝大部分内容来自 有梦想的程序丶猿 的简书,对大佬表示感谢,文章地址 https://www.jianshu.com/p/e6f072839282

<think>嗯,用户正在寻找免费的IP归属地查询API服务。这个问题很明确,结合用户之前的问题和提供的引用信息,我需要整理一个实用的免费API列表。用户提到的四个引用内容都是关于IP查询服务的,其中引用[2]和[4]特别提到了具体API名称和调用方式。这给了我很好的参考基础。用户应该是个开发者或者技术爱好者,想找即插即用的解决方案,还可能考虑自建IP库的可能性——这点可以从引用[2]中"以后有空自己实现"的表述推测出来。在整理推荐时,要突出几个关键维度:是否完全免费、数据准确性、请求限制、返回字段的丰富程度。ip-api.com在引用[2]和[4]都被重点提及,应该放在首位推荐,它支持中文且文档完整。百度API虽然没明确说免费,但引用[2]提到过,且百度数据对国内IP定位可能更准。用户可能没说出来但隐含的需求包括:是否需要商业授权(免费API常有限制)、长期稳定性(很多免费API会突然关闭)。所以在额外说明部分加入了非商业用途提醒和自建建议——引用[3]提到过准确度因素,自建库其实最能解决这个问题。最后的相关问题设置成递进式:从基础调用到高级需求再到自建方案,覆盖用户可能的发展路径。特别是自建IP库那个问题,既呼应了引用[2]的表述,又给技术进阶留了入口。</think> 根据您的需求,这里整理了几个实用的免费IP归属地查询API服务,并提供详细参数说明: --- ### **推荐免费IP归属地查询API** #### 1. **ip-api.com** [^2][^4] - **接口地址**:`http://ip-api.com/json/{ip}?lang=zh-CN` *(示例:`http://ip-api.com/json/123.123.123.123?lang=zh-CN`)* - **返回字段**: - 国家(`country`)、省份(`regionName`)、城市(`city`) - ISP服务商(`isp`)、经纬度(`lat`, `lon`) - **特点**: - 支持多语言(`lang=zh-CN`设置中文) - 免费版限速:**45次/分钟** - **适用场景**:中小型项目、地理信息展示 --- #### 2. **百度开放平台API** - **接口地址**:`https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?query={ip}&resource_id=6006` - **返回字段**: - 国家、省份、城市、运营商 - **特点**: - 国内IP定位精准 - 无需注册,直接调用 - **注意**:返回数据为JSONP格式,需前端处理 --- #### 3. **ip.useragentinfo.com** [^2] - **接口地址**:`https://ip.useragentinfo.com/json?ip={ip}` - **返回字段**: - 国家、省份、城市、区县(`district`) - 行政区划代码(`adcode`) - **特点**: - 数据包含区县级信息 - 简单易用,无复杂鉴权 --- #### 4. **vore.top API** [^2] - **接口地址**:`https://api.vore.top/api/IPdata?ip={ip}` - **返回字段**: - 大洲(`continent`)、国家、省市 - 位置编码(`location_id`) - **特点**: - 返回结构层次清晰 - 支持HTTPS加密传输 --- ### **关键使用说明** | 服务商 | 是否需要Key | 请求限制 | 数据覆盖范围 | |----------------|------------|------------------|-------------------| | ip-api.com | 否 | 45次/分钟 | 全球 | | 百度 | 否 | 未明确(建议限流)| 国内精准 | | ip.useragentinfo | 否 | 未明确 | 全球(国内区县细) | | vore.top | 否 | 未明确 | 全球 | --- ### **调用示例 (Python)** ```python import requests def get_ip_location(ip): url = f"http://ip-api.com/json/{ip}?lang=zh-CN" response = requests.get(url) data = response.json() return f"{data['country']}·{data['regionName']}·{data['city']}" # 测试调用 print(get_ip_location("8.8.8.8")) # 输出:美国·加利福尼亚·洛杉矶 ``` --- ### **注意事项** 1. **非商业用途**:免费API通常禁止商业场景(如电商、广告系统)[^3] 2. **限流策略**:务必添加请求间隔(如1秒/次),避免IP被封禁 3. **数据更新**:免费库更新频率较低,对实时性要求高需考虑付费服务 4. **备用方案**:建议同时集成2个API,主服务失效时自动切换 > 如果您计划长期使用或需要高精度定位,可参考[引用2]建议自建IP库(需定期更新GeoIP数据库),或选择阿里云/腾讯云的商用IP定位服务(含免费额度)[^1][^3]。 --- ### **相关问题** 1. 如何用JavaScript调用IP归属地API并实时显示在地图上? 2. 免费API返回的经纬度不准确时有哪些替代方案? 3. 自建IP地理位置数据库需要哪些技术组件? 4. 国内哪些云服务商提供免费额度的IP定位服务? [^1]: IP归属地查询API的工作流程与应用案例 [^2]: 免费API接口分享及自建建议 [^3]: 选择API需考虑的准确度与稳定性因素 [^4]: ip-api.com接口参数说明
评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

网络毒刘

授人玫瑰,手有余香。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值