整理一些完全免费开放的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>好的,我现在需要帮助用户了解讯飞星火API的调用机制和工作原理。首先,用户的问题集中在API的调用原理、相关文档或教程上,所以我得先回顾一下提供的引用内容,看看哪些信息能用来回答。 根据引用[1]到[5],这些引用主要涉及不同编程语言调用API的方法,比如Python、C++和Java,以及一些注册账号、模型区别和API文档的位置。用户想知道的是调用机制和工作原理,可能需要解释API的基本工作流程、认证方式、请求响应模式等。 首先,我需要整理这些引用中的关键点。例如,引用[1]提到Python调用方式,官方文档提供了SDK,引用[2]是C++调用需要注意安全配置,引用[3]提到了接口响应部分的文档,引用[4]有Java代码示例和报文协议,引用[5]则介绍了模型版本和注册流程。 接下来,用户可能想知道API调用的一般步骤,比如认证、构建请求、发送处理、解析响应等。需要将这些步骤结合引用中的信息进行说明。例如,认证可能需要API密钥,这在引用[5]中提到了注册账号,所以需要引导用户注册获取凭证。 然后,关于工作原理,可能需要解释大模型如何处理请求,比如自然语言理解、生成响应,以及流式输出的支持,引用[3]提到了流式输出,这可能是一个重要点。此外,不同模型的区别(如Spark Lite、Pro、Max等)在引用[1]和[5]中有提到,可能需要简要说明它们对API调用的影响。 用户还可能需要知道如何找到官方文档,引用[3]和[4]都提到了讯飞开放平台的文档中心,所以需要给出具体链接,并指导用户查阅接口规范和示例。 另外,用户可能对安全性有疑问,引用[2]提到安全相关的配置,这里可以强调HTTPS和密钥管理的重要性。 最后,生成相关问题需要考虑用户可能的后续疑问,比如认证方式、不同语言的SDK、模型选择、流式传输实现、错误处理等。 现在需要把这些点组织成结构清晰的回答,确保符合之前的系统指令,使用正确的中文,行内公式用$...$,独立公式用$$...$$,但这里可能不太涉及数学公式,所以主要注意引用标识和代码块的使用。 需要检查是否有遗漏的关键点,例如API的请求结构、参数说明、响应格式,这些在引用[3]和[4]中有提到,特别是引用[3]的接口响应部分,应该包含在回答中。另外,引用[4]中的报文协议下载和Java示例,可以建议用户参考具体示例代码。 总结回答的结构应该是:调用机制分步骤说明,包括认证、请求构建、处理与响应;工作原理涉及模型处理、流式输出、多模型支持;然后提供文档和教程资源,最后相关问题。</think>### 讯飞星火API调用机制与工作原理 讯飞星火API的调用机制遵循典型的RESTful API交互模式,核心流程包括**身份认证**、**请求构建**、**模型处理**和**响应返回**。以下是详细说明: --- #### 一、调用机制 1. **身份认证** 调用前需在讯飞开放平台注册账号并创建应用,获取`API Key`和`Secret`(引用[^5])。认证通过`HMAC-SHA256`算法生成签名,确保请求安全性[^2]。 ```python # Python示例:生成签名(引用[^1]) import hashlib, hmac secret = "your_secret" signature = hmac.new(secret.encode(), message.encode(), hashlib.sha256).hexdigest() ``` 2. **请求构建** 请求需包含以下内容: - **Headers**:签名、API Key、时间戳。 - **Body**:输入文本、模型类型(如`Spark 3.5 Max`)、参数(如温度值`temperature`)[^3][^5]。 3. **处理与响应** 讯飞服务器接收请求后,通过大模型进行语义理解、推理生成结果,并以JSON格式返回。支持**流式输出**(分块返回结果)和同步响应[^3]。 --- #### 二、工作原理 1. **模型处理流程** 用户输入文本经分词、编码后进入大模型(如Spark V4.0 Ultra),模型基于Transformer架构进行多轮对话理解,生成响应并解码为自然语言。 2. **流式输出机制** 通过`stream`参数启用,响应按Token分块返回,适用于实时交互场景(如聊天机器人)。 3. **多模型支持** 根据需求选择不同模型: - **Spark Lite**:完全免费,适合轻量任务。 - **Spark Pro/Max**:支持复杂推理,有免费额度[^1]。 --- #### 三、文档与教程资源 1. **官方文档** - [讯飞开放平台文档中心](https://www.xfyun.cn/doc/):包含接口规范、响应示例、错误码说明(引用[^3][^4])。 - 模型差异说明:`Spark3.5 Max` vs `Spark Pro`的性能对比(引用)。 2. **代码示例** - **Python**:官方SDK简化调用流程(引用[^5])。 - **C++**:需自行实现签名算法,注意HTTPS加密(引用[^2])。 - **Java**:下载报文协议示例,配置请求头与参数(引用)。 ---
评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

网络毒刘

授人玫瑰,手有余香。

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

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

打赏作者

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

抵扣说明:

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

余额充值