
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
imageapi.js
Advanced tools
ImageAPI is a wrapper for ImageAPI.fionn.live - a fast API for fetching a random post from a subreddit.
The main API is just fetching random data from the reddit API allowing for us to send the data we think is valid back to the user making the request.
The API is as fast as the Reddit API is. We can't speed it up, but, we have optimized the code on the backend to make it as fast as possible.
const api = require('imageapi.js');
(async () => {
const img = await api('subreddit');
console.log(img); // Logs the image
const advanced = await api.advanced('subreddit');
console.log(advanced); // Logs an object. Not all data may be present.
const stats = await api.stats();
console.log(stats); // Logs an object.
})();
import api, { stats, advanced } from 'imageapi';
(async () => {
const img = await api('subreddit');
console.log(img); // Logs the image
const advanced = await api.advanced('subreddit');
console.log(advanced); // Logs an object. Not all data may be present.
const stats = await api.stats();
console.log(stats); // Logs an object.
})();
top
& new
.If you want to get a 'new' or 'top' post, you can specify a sort type. The valid ones are top
& new
.
You specify this as a second paramter in the advanced
& default
function. For example:
api.advanced('meme', 'top'); // Gets a 'top' meme
api.advanced('meme', 'new'); // Gets a 'new' meme
api.advanced('meme', 'this-is-invalid'); // Errors, returns a rejected promise
FAQs
The best way to get random posts from subreddits
The npm package imageapi.js receives a total of 14 weekly downloads. As such, imageapi.js popularity was classified as not popular.
We found that imageapi.js demonstrated a not healthy version release cadence and project activity because the last version was released 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.