个人项目api接口

Public APIs are awesome!

公共API很棒!

There are over 50 pieces covering APIs on just the Towards Data Science publication, so I won’t go into too lengthy of an introduction. APIs basically let you interact with some tool or service (which could be provided by literally anybody).

仅在Towards Data Science出版物上有50余篇关于API的文章,因此我不会过多地介绍它。 API基本上使您可以与某些工具或服务进行交互(实际上任何人都可以提供)。

You can use APIs to do retrieve some kind of information from a data source and then use it in your own script or application. Public (open) APIs are great because they allow any third-party developer to build something that can connect to an existing service.

您可以使用API​​从数据源中检索某种信息,然后在您自己的脚本或应用程序中使用它。 公共(开放)API很棒,因为它们允许任何第三方开发人员构建可以连接到现有服务的东西。

There are popular APIs to do “serious stuff” like track time-series stock data or provide updates on air quality. We won’t be touching those in this piece, as I wanted to share some fun APIs you can experiment on while you’re learning to interact with an API or even create one.

有流行的API可以执行“严重的任务”,例如跟踪时间序列的库存数据或提供空气质量的更新 。 在本文中,我们将不涉及这些内容,因为我想分享一些有趣的API,您可以在学习与API交互甚至创建API时进行试验。

You could even build a simple personal project with one of these, to learn how to connect an application to an API from whichever language you’re currently learning.

您甚至可以使用其中之一来构建一个简单的个人项目,以学习如何使用您当前正在学习的任何语言将应用程序连接到API。

Let’s get to it!

让我们开始吧!

1. PlaceGOAT —山羊的免费随机照片 (1. PlaceGOAT — Free random pictures of goats)

Holy crap it’s a goat generated by PlaceGoat
天哪,这是PlaceGoat产生的山羊

I thought I’d kick things off with an adorable baby goat.

我以为我会和一只可爱的小山羊拉开序幕。

This is a really simple GET API where you can generate pictures of goats. I wish I had more to say but that’s really it. Here are links to the main site and the Github repository.

这是一个非常简单的GET API,您可以在其中生成山羊的图片。 我希望我有更多话要说,但是确实如此。 这里是主站点和Github存储库的链接 。

PlaceGOAT main sitePlaceGOAT主站点

You can specify the width and the height in pixels of the image you want to generate like this:

您可以像这样指定要生成的图像的宽度和高度(以像素为单位):

http://placegoat.com/width/height

If you’re just looking to test out the requests library in Python, this would be a great place to start. If you need an idea, try writing a script to get a daily goat image and send it to your significant other (or your mom) every morning to remind them of how much you care about them. It’ll be a better version of breakfast in bed.

如果您只是想在Python中测试requests库,那么这将是一个不错的起点。 如果您需要一个主意,请尝试编写脚本以获取每日的山羊图像,并将其每天早上发送给您的重要其他人(或您的母亲),以提醒他们您对它们的关心程度。 这将是床上早餐的更好版本。

2.PokéApi—主要游戏的Pokémon数据库 (2. PokéApi — Pokémon database for main games)

PokéApi main pagePokéApi主页

Pokémon! Gotta *GET ’em all, Pokémon!

神奇宝贝! 一定要把它们全部拿来,神奇宝贝!

The RESTful PokéApi is free to use and allows you to GET information from a comprehensive database on everything from the Pokémon games, from the first Red and Blue releases until Sword and Shield.

RESTfulPokéApi是免费使用的,并允许您从全面的数据库中获取有关Pokémon游戏,从第一个Red和Blue版本到Sword和Shield的所有内容的信息。

The database is really extensive. You can get anything from a Pokémon’s abilities to evolution triggers to berry firmness. Check out the PokéApi main site and the documentation directly for more information. If you’re interested in a language-specific wrapper, check the Wrapper Libraries section. For example, you could install the Pokebase Python interface for use directly in your Python scripts, instead of having to call the API with the requests library.

该数据库确实非常广泛。 从神奇宝贝的能力到进化的触发力到浆果的坚韧性,您都能得到任何东西。 直接查看PokéApi主站点和文档以获取更多信息。 如果您对特定于语言的包装感兴趣,请查看包装器库部分 。 例如,您可以安装Pokebase Python接口以直接在Python脚本中使用,而不必使用requests库调用API。

PokéApi docsPokéApi文档

I didn’t know berries could be categorized by firmness. I wanted to find out more, so I followed this link:

我不知道浆果可以按硬度分类。 我想了解更多信息,所以我点击了此链接:

https://pokeapi.co/api/v2/berry-firmness/
berry firmness results浆果硬度结果

Normally, when you call an API endpoint, you should also supply an ID or name to retrieve the information for a specific data point. With the PokéApi, they say that if you call an endpoint without an ID or name, you’ll get a default list of up to 20 resources available for the API. In this case, there are 5 possible results for the “berry firmness” endpoint, so you see all of them returned in JSON format when you call the link above.

通常,在调用API端点时,还应提供ID或名称以检索特定数据点的信息。 他们说,使用PokéApi,如果您调用没有ID或名称的端点,则将获得默认的列表,其中包含多达20个可用于该API的资源。 在这种情况下,“浆果硬度”端点有5种可能的结果,因此,当您调用上面的链接时,您会看到所有结果均以JSON格式返回。

It’s a good time to note that when you’re using fully open APIs, you should be mindful of how often you’re calling a service’s endpoints. The PokéApi removed its rate limiting (API configuration of how many requests can be made per time interval), but it still reminds users to limit how frequent their requests are to keep the hosting costs low. In their fair use policy, they say that people should locally cache requested resources and that DDoS attacks will result in a permanent IP address ban. Be responsible!

现在是要注意的好时机,当您使用完全开放的API时,应注意调用服务端点的频率。 PokéApi取消了速率限制(API配置,每个时间间隔可以发出多少请求),但它仍提醒用户限制其请求的频率以保持较低的托管成本。 他们说,在合理使用政策中,人们应该在本地缓存请求的资源,而DDoS攻击将导致永久性的IP地址禁止。 要负责任!

3. Rick and Morty API-Rick and Morty的角色,位置等 (3. The Rick and Morty API — Characters, locations, and more from Rick and Morty)

The Rick and Morty API main siteRick and Morty API主站点

Rick and Morty!

瑞克和莫蒂!

This API is RESTful and allows you to use GraphQL to query it. They also conveniently link you to the GraphQL docs if you’re new to the query language. You can use the API by making GET requests for metadata on characters, locations, and episodes from the show.

该API是RESTful的,允许您使用GraphQL对其进行查询。 如果您是查询语言的新手,它们还可以方便地将您链接到GraphQL文档 。 您可以通过对节目中角色,位置和剧集的元数据发出GET请求来使用API​​。

The Rick and Morty API docsRick and Morty API文档

To get information about a character from the show, you should supply their ID to the character endpoint like this:

要从演出中获取有关角色的信息,您应该像这样向角色端点提供其ID:

https://rickandmortyapi.com/api/character/5
Jerry Smith resultsJerry Smith结果

Here, supplying “5” gives us the character information on Jerry Smith. You also see at the end an associated image of the character, so if you’re looking to practice downloading files from an API, this might be a good place to start.

在这里,提供“ 5”会给我们有关杰里·史密斯的角色信息。 您还将在最后看到该字符的关联图像,因此,如果您希望练习从API下载文件,那么这可能是一个不错的起点。

Check out the main site and the documentation for more information. There are also a bunch of wrapper libraries by several authors for different languages, so check those out if you‘d rather use those. The Python implementation for it can be found here. Also, if you know some JavaScript and are interested in contributing to an open-source project, you can check out The Rick and Morty API Github.

查看主站点和文档以获取更多信息。 还有一些由不同语言的作者组成的包装器库 ,因此请检查是否需要使用它们。 可以在这里找到它的Python实现。 另外,如果您知道一些JavaScript并有兴趣为开源项目做贡献,则可以查看The Rick and Morty API Github 。

4. icanhazdadjoke-爸爸笑话数据库 (4. icanhazdadjoke — Dad Jokes Database)

icanhazdadjokes main siteicanhazdadjokes主站点

Who doesn’t like dad jokes?

谁不喜欢爸爸的笑话?

I’m not sure if my API-related puns so far count, but I definitely love all sorts of “bad” jokes.

我不确定到目前为止与我的API相关的双关语是否有用,但是我绝对喜欢各种“坏”笑话。

You can use the icanhazdadjoke API to fetch a dad joke from the service. The API documentation gives examples of how you can interact with the API’s endpoints with curl.

您可以使用icanhazdadjoke API从服务中获取爸爸的笑话。 API文档提供了有关如何使用curl与API端点进行交互的示例。

icanhazdadjokes API documentationicanhazdadjokes API文档

curl is a neat tool you can use from your terminal to transfer data to or from a server. In this case, you could test it out by using HTTP to GET a specific URL. For example, you could try the following in your terminal:

curl是一个很好的工具,您可以从终端使用它来与服务器之间传输数据。 在这种情况下,您可以使用HTTP来获取特定的URL进行测试。 例如,您可以在终端中尝试以下操作:

curl -H "Accept: text/plain" https://icanhazdadjoke.com/
icanhazdadjoke curl output
icanhazdadjoke卷曲输出

The -H command-line argument allows you to include one parameter, which in this case is “Accept: text/plain”, of an extra header in the request. This modification allows you to specify the type of output from your request, which here will just be plaintext. You could also set it to JSON (Accept: text/html) or HTML (Accept: Application/json) if that’s what you need.

-H命令行参数允许您在请求中包含一个额外头的参数,在本例中为“ Accept:text / plain”。 通过此修改,您可以指定请求的输出类型,此处只是纯文本。 如果需要,还可以将其设置为JSON( Accept: text/html )或HTML( Accept: Application/json )。

There’s also an endpoint you can use to search for specific jokes that match a certain keyword.

您还可以使用一个端点来搜索与某个关键字匹配的特定笑话。

icanhazdadjoke API documentationicanhazdadjoke API文档

It could be interesting to practice searching for a few keywords by calling this endpoint and storing the results in a database. Then you’d have a local copy of jokes based on the keywords you specified.

通过调用此端点并将结果存储在数据库中来练习搜索一些关键字可能会很有趣。 然后,您将根据指定的关键字获得本地笑话副本。

Check out the main site and the documentation for more information. There’s also a GraphQL query endpoint you can use to query the API if you want to load data that way.

查看主站点和文档以获取更多信息。 如果要以这种方式加载数据,还可以使用GraphQL查询端点来查询API。

5.邪恶的侮辱产生者-均值数据库 (5. Evil Insult Generator — A Mean Database)

Evil Insult Generator main site邪恶侮辱生成器主站点

… this site is mean.

…这个网站是卑鄙的。

The premise is really simple: you call the API and get an insult.

前提很简单:调用API并侮辱他人。

Evil Insult Generator API documentationEvil Insult Generator API文档

Just like the goat API, I don’t really have that much to say here.

就像山羊API一样,我在这里没有太多要说的。

You can specify the language and the format of how you want the insult to be returned. For fun, I wanted to see if another language would actually work, so I tried to get a Spanish insult:

您可以指定希望如何返回侮辱的语言和格式。 为了娱乐,我想看看另一种语言是否真的可以工作,所以我试图受到西班牙的侮辱:

https://evilinsult.com/generate_insult.php?lang=es&type=json
Result of Evil Insult Generator API call邪恶侮辱生成器API调用的结果

“Mala leche” translates literally to English as “bad milk”. Colloquially, you use it to describe someone that acts in bad faith or someone who’s in a bad mood.

“ Mala leche”字面意思是“坏牛奶”。 口语化地,您可以用它来形容表现出恶意的人情绪低落的人。

You can also use this API as a really simple one to practice making requests with. Check out the main site and its (rather simple) documentation if you want to explore.

您还可以将此API用作练习请求的一种非常简单的方法。 如果要浏览,请查看主站点及其(相当简单的) 文档 。

And that’s all!

就这样!

I hope you try working with one of these as you start familiarizing yourself with APIs or if you’re just looking for something fun to work with. Be sure to call the APIs responsibly, as these are public and meant to be consumed by everyone without charge. Pinging them too frequently can lead to your IP address being banned, which if you love goat pictures (or whatever service yo’re using) will not be a good thing.

我希望您在开始熟悉API或只是在寻找有趣的东西时尝试使用其中之一。 确保以负责任的方式调用这些API,因为这些API是公开的,并且每个人都可以免费使用。 过于频繁地对它们进行ping操作可能会导致您的IP地址被禁止,如果您喜欢山羊图片(或您使用的任何服务),那将不是一件好事。

Besides just calling GET requests, I mentioned that storing results might make for an interesting addition to your project, so check out this piece if you want to see how you can write to SQLite:

除了仅调用GET请求外,我还提到存储结果可能会对您的项目产生有趣的影响,因此如果您想了解如何写入SQLite,请查看以下内容:

For a completely different way of collecting data online, check out this piece on an introduction to the XPath language and its usage with Python:

对于一种完全不同的在线收集数据的方式,请查看关于XPath语言及其在Python中的用法的介绍:

翻译自: https://towardsdatascience.com/5-free-and-fun-apis-to-use-for-learning-personal-projects-and-more-1cb37b0d3685

个人项目api接口


http://www.taodudu.cc/news/show-995352.html

相关文章:

  • 如何评价强gis与弱gis_什么是gis的简化解释
  • 自我接纳_接纳预测因子
  • python中knn_如何在python中从头开始构建knn
  • tb计算机存储单位_如何节省数TB的云存储
  • 数据可视化机器学习工具在线_为什么您不能跳过学习数据可视化
  • python中nlp的库_用于nlp的python中的网站数据清理
  • 怎么看另一个电脑端口是否通_谁一个人睡觉另一个看看夫妻的睡眠习惯
  • tableau 自定义省份_在Tableau中使用自定义图像映射
  • 熊猫烧香分析报告_熊猫分析进行最佳探索性数据分析
  • 白裤子变粉裤子怎么办_使用裤子构建构建数据科学的monorepo
  • 青年报告_了解青年的情绪
  • map(平均平均精度_客户的平均平均精度
  • 鲜活数据数据可视化指南_数据可视化实用指南
  • 图像特征 可视化_使用卫星图像可视化建筑区域
  • 海量数据寻找最频繁的数据_在数据中寻找什么
  • 可视化 nlp_使用nlp可视化尤利西斯
  • python的power bi转换基础
  • 自定义按钮动态变化_新闻价值的变化定义
  • 算法 从 数中选出_算法可以选出胜出的nba幻想选秀吗
  • 插入脚注把脚注标注删掉_地狱司机不应该只是英国电影历史数据中的脚注,这说明了为什么...
  • 贝叶斯统计 传统统计_统计贝叶斯如何补充常客
  • 因为你的电脑安装了即点即用_即你所爱
  • 团队管理新思考_需要一个新的空间来思考讨论和行动
  • bigquery 教程_bigquery挑战实验室教程从数据中获取见解
  • java职业技能了解精通_如何通过精通数字分析来提升职业生涯的发展,第8部分...
  • kfc流程管理炸薯条几秒_炸薯条成为数据科学的最后前沿
  • bigquery_到Google bigquery的sql查询模板,它将您的报告提升到另一个层次
  • 数据科学学习心得_学习数据科学时如何保持动力
  • python多项式回归_在python中实现多项式回归
  • pd种知道每个数据的类型_每个数据科学家都应该知道的5个概念

个人项目api接口_5个免费有趣的API,可用于学习个人项目等相关推荐

  1. 拼多多商品详情页 API接口、拼多多商品SKU数据接口 API接口、拼多多关键词搜索接口 API接口 API接口、拼多多关键词采集 API接口、拼多多采集接口 API接口、拼多多详情 API接口

    拼多多API接口,提供商品解析,商品采集等. 拼多多采购项目.店群项目等都可以对接 下方点击注册就可以对接了 点击注册 拼多多商品详情页 API接口.拼多多商品SKU数据接口 API接口.拼多多关键词 ...

  2. 拼多多商品详情页API接口、拼多多商品销量API接口、拼多多商品列表API接口、拼多多APP详情API接口、拼多多详情API接口

    通过商品ID提取商品详情页各项数据,包含商品标题,skuid.价格.优惠价,收藏数.拼单人数.月销售量.主图.标题.详情页图片等页面上有的数据均可以拿到,大家都知道,拼多多的反爬虫机制十分严,而很多时 ...

  3. 1688店铺所有商品API接口(整店商品查询API接口)

    可以通过1688店铺所有商品API接口采集店铺所有商品详情页各项数据,包含商品标题,SKU信息.价格.优惠价,收藏数.销量.SKU图.标题.详情页图片等店铺内页面上有的数据均可以拿到,大家都知道,16 ...

  4. 淘宝商品评价api接口,淘宝评论视频API接口,淘宝评论API接口(app、h5端)

    淘宝商品评价api接口,淘宝评论视频API接口,淘宝评论API接口(app.h5端)可通过商品id,获取商品评价信息.评价内容.买家秀图片.评论浏览量.评价视频.评价追评等页面上展示的数据均可以拿到, ...

  5. 获取淘宝购买到的商品订单物流API,买家订单物流API接口,淘宝买家订单API接口

    一.获取淘宝购买到的商品订单物流API,买家订单物流API接口,淘宝买家订单API接口代码对接如下: 1.公共参数: 名称 类型 必须 描述 key String 是 调用key(必须以GET方式拼接 ...

  6. 微信API接口、微信二次开发API调用

    微信API接口.微信二次开发API调用 微信协议接口调用-加微信好友及通过好友请求 加微信好友 /**       * 微信自动添加好友      * @author wechatno:tangjin ...

  7. 淘宝商品评价api接口(item_review-获得淘宝商品评论API接口),天猫商品评论API接口

    淘宝商品评价api接口(item_review-获得淘宝商品评论API接口),天猫商品评论API接口可通过商品id,获取商品评价信息.评价内容.买家秀图片.评论浏览量.评价视频.评价追评等页面上的数据 ...

  8. 京东店铺的所有商品API接口(item_search_shop-获得店铺的所有商品API接口),整店商品API接口

    可以通过京东店铺的所有商品API接口采集店铺所有商品详情页各项数据,包含商品标题,SKU信息.价格.优惠价,收藏数.销量.SKU图.标题.详情页图片等页面上有的数据均可以拿到,大家都知道,京东的反爬虫 ...

  9. 淘宝店铺发布API接口(新),淘宝oAuth2.0店铺商品API接口,淘宝商品发布API接口,淘宝商品上架API接口,一整套发布上架店铺接口对接分享

    淘宝店铺发布API接口(新),淘宝oAuth2.0店铺商品API接口,淘宝商品发布API接口,淘宝商品上架API接口,一整套发布上架店铺接口对接分享如下 1.公共参数 名称 类型 必须 描述 key ...

最新文章

  1. Windows Server 2012 R2 WSUS-11:经典的客户端排错操作
  2. 用户控件的定制和使用
  3. 看博客学学Android(五)
  4. winowsformshost 的构造函数执行符合指定的绑定约束的_C# 应该允许为 struct 定义无参构造函数...
  5. css 如何让背景图片拉伸填充避免重复显示
  6. 200行代码实现视频人物实时去除
  7. linux实现内存共享,Linux共享内存实现
  8. (libgdx学习)TextInputListener
  9. Python中time模块详解(转)
  10. Mac没声音解决办法记录
  11. IEEE 2021年新增Fellow出炉,70余位华人入选
  12. iOS永久不掉签名工具,TrollStore超详使用教程
  13. LeetCode_回文数(三种解法-Java)
  14. 【小程序源码】游戏助手王者荣耀战力查询,游戏扫码登录器等
  15. 神棍节献礼之——TJU1111 MPI Maelstrom(最短路)
  16. Machine Learning Practical 爱宝week2
  17. 可以真正带你理清同步阻塞与同步非阻塞与异步阻塞与异步非阻塞的文章
  18. 超级任天堂模拟器 bsnes 开发者自杀(文末附模拟器及ROM)
  19. jdk自带的jvm监控工具 jconsole ,jvisualvm,jmc
  20. XMind6和XMind7有何不同

热门文章

  1. C 结构体嵌套一级指针 二级指针 动态分配内存
  2. 信号量释放和等待函数sem_post()和sem_wait()
  3. 【Linux】编译C语言文件(-o -lpthread)
  4. 1082 射击比赛 (20 分)
  5. C语言指针转换为intptr_t类型
  6. 移植驱动完毕后加载时的version magic报错原因以及解决办法
  7. oracle频,Oracle动作频频 Java或浴火重生
  8. community 计算模块度_光模块深度:国内光模块企业快速崛起
  9. #1123-JSP隐含对象
  10. Java构造函数的深入理解