Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
somerandomapi.js
Advanced tools
Unofficial API wrapper for Some Random API (with updated endpoints and docs)
Weekly downloads
Readme
Unofficial wrapper for https://some-random-api.com/ written in TypeScript with documentations and updated endpoints. This wrapper does not support pokemon
, premium
, chatbot
and welcome
endpoints.
UPDATE TO VERSION >=1.4.1 FOR BUG FIXES AND UPDATED DOCS
Endpoints: https://some-random-api.com/endpoints
Documentation: https://some-random-api.com/docs
Package Link: https://www.npmjs.com/package/somerandomapi.js
npm i somerandomapi.js
To use it in your project:
// import SRA from "../dist/index"
const SRA = require("somerandomapi.js");
const url = "https://cdn.discordapp.com/embed/avatars/2.png";
const tintedImgURL = SRA.canvas.filter.tint({
imgUrl: url,
hexColor: "1f1f1f",
});
console.log(tintedImgURL);
Every function is documentated for your convenience!
Animal Endpoints Example:
const SRA = require("somerandomapi.js");
async function myFunc(animal)
{
// Get image of an animal
console.log(await SRA.animal.image({ animal, }));
// Get fact of an animal
console.log(await SRA.animal.fact({ animal, }));
// Get image and fact about the animal
console.log(await SRA.animal.imageAndFact({ animal, }));
}
// Call your function
myFunc()
Animu Endpoints Example:
const SRA = require("somerandomapi.js")
async function myFunc()
{
// Get an anime GIF
console.log(await SRA.animu.gif({ type: "hug", }));
}
// Call your function
myFunc();
Canvas Endpoints Example:
const SRA = require("somerandomapi.js")
const url = "https://cdn.discordapp.com/embed/avatars/2.png";
async function myFunc(url)
{
// Filter Endpoints
console.log(SRA.canvas.filter.greyscale({ imgUrl: url, }));
// Overlay Endpoints
console.log(SRA.canvas.overlay.gay({ imgUrl: url, }));
// Misc Endpoints
console.log(SRA.canvas.misc.simpCard({ imgUrl: url, }));
}
// Call your function
myFunc(url);
Others Endpoints Example:
const SRA = require("somerandomapi.js")
async function myFunc()
{
// Get lyrics for a song
console.log(await SRA.others.lyrics({ title: "Mockingbird", }));
// Encode a string in base64
console.log(
await SRA.others.base64({ mode: "encode", string: "let him cook", })
);
}
// Call your function
myFunc();
FAQs
Unofficial API wrapper for Some Random API (with updated endpoints and docs)
The npm package somerandomapi.js receives a total of 20 weekly downloads. As such, somerandomapi.js popularity was classified as not popular.
We found that somerandomapi.js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.