推薦 5 個你大概率沒見過的免費 API ,一鍵獲取資料!

語言: CN / TW / HK

免費 API 一抓一大把,本篇帶來幾個你不知道,但又很有趣的 幾個 API !

與市面上眾多 API 不同的是,這些 API :

不用任何登入!不用任何 token !不用任何購買套餐!GET 請求一鍵獲得資料!!

ceeb653ely1g9kq3sxxh4g206o06o15i.gif

1. 貓和狗

  • 貓:

http://code.juejin.cn/pen/7174965149298589708

每次點選 執行 都會獲取一張喵星人照片

在瀏覽器中輸入 http://api.thecatapi.com/v1/images/search?size=full 檢視返回結果,包括圖片 id、url、寬、高這些資訊

image.png

http://code.juejin.cn/pen/7174968140382601253\

每次點選 執行 都會獲取一張汪星人照片

在瀏覽器中輸入 http://api.thedogapi.com/v1/images/search?size=full 檢視返回結果,包括圖片 id、url、寬、高這些資訊

image.png

與此同時呢,官方還給出:可選擇不同品種的狗的介面:

http://code.juejin.cn/pen/7174980067431284774

看程式碼不難發現,

通過:http://api.thedogapi.com/v1/breeds 這個 API 可以拿到所有狗的分類資訊;

然後通過:http://api.thedogapi.com/v1/images/search?include_breed=1&breed_id=' + breed_id 拿到圖片;

還有更多用法,請自行在官網探索:http://thedogapi.com/#pricing

  • 另外,再附加一個鏟屎官 API : http://shibe.online/

2. 名言警句

Random Quote API 提供了一個用來獲取隨機名言的 API,可以用來測試文字處理能力。

Github 專案地址:http://github.com/lukePeavey/quotable

比如任意獲取一句名言:http://api.quotable.io/random

得到:

{     "_id":"UydvuUuGWjGo",     "content":"We read the world wrong and say that it deceives us.",     "author":"Rabindranath Tagore",     "tags":**[         "famous-quotes"     ],     "authorSlug":"rabindranath-tagore",     "length":52,     "dateAdded":"2020-04-14",     "dateModified":"2020-04-14" }

還有一些其它引數可供選用:

image.png

這個專案是英文;

中文名言警句 API 也有:

http://api.xygeng.cn/one

返回: {     "code":200,     "data":**{         "id":800,         "tag":"動畫",         "name":"佚名",         "origin":"《罪惡王冠》",         "content":"溫柔解救不了這個世界",         "created_at":"2019-01-23T07:58:03+00:00",         "updated_at":"2022-03-09T08:42:10+00:00"     },     "updateTime":1670569646019 }

3. 使用者資訊

Random User Generator:提供了一個用來生成隨機使用者資料的 API,可以用來測試使用者管理功能。

官網:http://randomuser.me/

image.png

示例:

http://randomuser.me/api/

返回:

{     "results":**[         **{             "gender":"male",             "name":**{                 "title":"Mr",                 "first":"Liam",                 "last":"Shelton"             },             "location":**{                 "street":**{                     "number":2481,                     "name":"The Drive"                 },                 "city":"Tipperary",                 "state":"Offaly",                 "country":"Ireland",                 "postcode":37431,                 "coordinates":**{                     "latitude":"3.2413",                     "longitude":"-168.0368"                 },                 "timezone":**{                     "offset":"+4:30",                     "description":"Kabul"                 }             },             "email":"[email protected]",             "login":**{                 "uuid":"ada3deb4-99bf-42c4-acb8-c4653145f3e7",                 "username":"redlion786",                 "password":"sentnece",                 "salt":"JKR7kVq4",                 "md5":"efe8e8d3c78863c910625418fd6b212b",                 "sha1":"22aabc3bccc7891ae62815164dcc5f020cc67b24",                 "sha256":"0ef108e6a758db207f73ddc190189dac2e5a849206ad47dca7842d3d2f927c05"             },             "dob":**{                 "date":"1962-05-03T23:20:34.105Z",                 "age":60             },             "registered":**{                 "date":"2010-07-10T14:38:40.859Z",                 "age":12             },             "phone":"021-123-9294",             "cell":"081-143-0111",             "id":**{                 "name":"PPS",                 "value":"4570229T"             },             "picture":**{                 "large":"<http://randomuser.me/api/portraits/men/33.jpg>",                 "medium":"<http://randomuser.me/api/portraits/med/men/33.jpg>",                 "thumbnail":"<http://randomuser.me/api/portraits/thumb/men/33.jpg>"             },             "nat":"IE"         }     ],     "info":**{         "seed":"eee03283804d179d",         "results":1,         "page":1,         "version":"1.4"     } } 可以看到,返回的個人的資訊非常全;

也支援獲取多人使用者資訊:http://randomuser.me/api/?results=5000

4. 講個笑話

Chuck Norris API:提供了一系列關於 Chuck Norris 的笑話和引用,可以用來做一些有趣的測試。

官網:http://api.chucknorris.io/

image.png

這圖配的挺搞笑的~~

API: http://api.chucknorris.io/jokes/random

返回:

{ "icon_url" : "http://assets.chucknorris.host/img/avatar/chuck-norris.png", "id" : "BiKqA8enQ9uUZ4VUsQjgUA", "url" : "", "value" : "Chuck Norris once gave someone 8 seconds to live. That person is now known as the Rage Guy. URL=http://www.youtube.com/watch?v=E29iOPSxF94&NR=1&feature=fvwp" }

中文笑話 API : http://api.vvhan.com/api/joke

返回:

劫匪成功劫持一輛押運車。回去後,一新來劫匪說:“老大我們數一下搶了多少錢。”那老大說:“沒經驗吧!這麼多要數到啥時候,看看新聞不就知道了嗎?”開啟電視一看,傻眼了:“今日發生一起劫匪劫持高考試卷事件!”

雖然,一點不好笑。。。。。。

5. 隨機問答

Open Trivia Database API:可以用來獲取各類的問題和答案,可以用來製作小遊戲或者知識問答類應用。

官網:http://opentdb.com/api_config.php

image.png

你可以自由配置問題,然後一件生成:

比如:生成 3 個 關於 電影話題的簡單難度、且有多選的問答,連結如下:

http://opentdb.com/api.php?amount=3&category=11&difficulty=easy&type=multiple

{     "response_code":0,     "results":[         {             "category":"Entertainment: Film",             "type":"multiple",             "difficulty":"easy",             "question":"When was the movie 'Con Air' released?",             "correct_answer":"1997",             "incorrect_answers":**[                 "1985",                 "1999",                 "1990"             ]         },         {             "category":"Entertainment: Film",             "type":"multiple",             "difficulty":"easy",             "question":"What is the orange and white bot's name in "Star Wars: The Force Awakens"?",             "correct_answer":"BB-8",             "incorrect_answers":[                 "BB-3",                 "AA-A",                 "R2-D2"             ]         },         {             "category":"Entertainment: Film",             "type":"multiple",             "difficulty":"easy",             "question":"In "ALF", what was ALF's real name?",             "correct_answer":"Gordon Shumway",             "incorrect_answers":**[                 "Gordon Milipp",                 "Gordon Foster",                 "Gordon von Gam"             ]         }     ] }

以上這些 api 直接能拿到調測使用,挺好的~~


OK,以上便是本篇分享,希望各位工友喜歡~ 歡迎點贊、收藏、評論 🤟

我是掘金安東尼 🤠 100 萬人氣前端技術博主 💥 INFP 寫作人格堅持 1000 日更文 ✍ 關注我,安東尼陪你一起度過漫長程式設計歲月 🌏

😹 加我微信 ATAR53,拉你入群,定期抽獎、粉絲福利多多。只學習交友、不推文賣課~

😸 我的公眾號:掘金安東尼,在上面,不止程式設計,更多還有生活感悟~

😺 我的 GithubPage: http://tuaran.github.io,它已經被維護 4 年+ 啦~


本文正在參加「金石計劃 . 瓜分6萬現金大獎」