animality
Easy to use random animal api. Get facts and images of numerous animals!
Installation
Use the package manager npm to install random-api
$ npm i animality
OR
$ npm install animality
Require
const animality = require("animality")
Usage
Animals: cat
, dog
, bird
, panda
, redpanda
, koala
, fox
, whale
, kangaroo
, bunny
Get information of a specific animal
const animality = require("animality")
const animals = ["cat", "dog", "bird", "panda", "redpanda", "koala", "fox", "whale", "kangaroo", "bunny"]
const animal = "cat"
animality.getAsync(animal).then(data => {
console.log(data)
})
Output:
{
"image": "random cat image link",
"fact": "random cat fact"
}
Get information of a random Animal
const animality = require("animality")
const animal = "random"
animality.getAsync(animal).then(data => {
console.log(data)
})
Output:
{
"name": "animal name",
"image": "random animal image link",
"fact": "random animal fact"
}
Get information of multiple animals at once
const animality = require("animality")
const animals = ["cat", "dog", "kangaroo"]
animality.getAsync(animals).then(data => {
console.log(data)
})
Output:
[
{
"name": "cat",
"image": "random cat image link",
"fact": "random cat fact"
},
{
"name": "dog",
"image": "random dog image link",
"fact": "random dog fact"
},
{
"name": "kangaroo",
"image": "random kangaroo image link",
"fact": "random kangaroo fact"
}
]