⚡ Lunar API
JS Library for the Lunar API
Lunar API lets you interact with our image libraries and image generation
Currently this library does not support our image generation endpoints, but will be available in a later update.
require('dotenv').config();
const LunarAPI = require('lunar-api');
const lunar = new LunarAPI(process.env.LUNARAPI); // Your API Key goes here
(async () => {
const res = await lunar.sfw.hug();
// const resid = await lunar.sfw.hug(true);
// Passing true returns the raw JSON response with the ID and URL
console.log(res);
/* If passing true to return the JSON response, simply do the following to get each key/value:
console.log(res.id) or console.log(res.url)
*/
})();