Fox API
This module is a little compilation of a fex fox image apis I know of, namely randomfox.ca, foxrudor.de, and api.furry.bot.
Every function returns the same structure, so the implementations can be the same. Each of them also has one optional parameter, fetchImage
, this will return the json body, as well as a buffer that contains the image, there is an example for that down here
The way to reach each of them is as follows:
randomfox.ca: ca
const FoxAPI = ;const f = "FoxAPI/1.0.1 (https://github.com/FurryBotCo/FoxAPI"); f;// in the console:/*{ success: true, response: { image: "https://randomfox.ca/images/83.jpg", filetype: "jpg", name: "83.jpg" }}*/
foxrudor.de: de
const FoxAPI = ;const f = "FoxAPI/1.0.1 (https://github.com/FurryBotCo/FoxAPI"); // this api does not return any json, or any links to images, it just directly returns an image, so we improvise f;// in the console:/*{ success: true, response: { image: "https://foxrudor.de", filetype: "jpg", name: "foxrudor.de.jpg" }}*/
api.furry.bot: fb
const FoxAPI = ;const f = "FoxAPI/1.0.1 (https://github.com/FurryBotCo/FoxAPI"); f;// in the console:/*{ success: true, response: { image: "https://i.furcdn.net/animals/fox/a6f5338446968dbe0586735cc4002ab4.jpg", filetype: "jpg", name: "a6f5338446968dbe0586735cc4002ab4.jpg" }}*/
fetchImage
example
const FoxAPI = ;const f = "FoxAPI/1.0.1 (https://github.com/FurryBotCo/FoxAPI"); f;// in the console:/*{ image: (ImageBuffer), success: true, response: { image: "https://i.furcdn.net/animals/fox/a6f5338446968dbe0586735cc4002ab4.jpg", filetype: "jpg", name: "a6f5338446968dbe0586735cc4002ab4.jpg" }}*/