UNPKG

koja-api

Version:

A complete Node.js wrapper for Koja API services including Ephoto generation, YouTube MP4 and MP3 downloads

86 lines (69 loc) 1.81 kB
# Koja API A Node.js wrapper for Koja API services including Ephoto generation, YouTube MP4 and MP3 downloads. ## Installation ```bash npm install koja-api ``` ## Usage ```javascript const koja = require('koja-api'); // Example 1: Generate ephoto (async () => { try { const ephotoResult = await koja.ephoto( 'https://en.ephoto360.com/ice-text-effect-online-101.html', 'Koja' ); console.log(ephotoResult); } catch (error) { console.error(error); } })(); // Example 2: Download YouTube video as MP4 (async () => { try { const mp4Result = await koja.ytmp4( 'https://youtu.be/dovWTFlRIWs?si=9DStVzGBfr2-mDfz', '720p' // optional quality parameter ); console.log(mp4Result); } catch (error) { console.error(error); } })(); // Example 3: Download YouTube video as MP3 (async () => { try { const mp3Result = await koja.ytmp3( 'https://youtu.be/dovWTFlRIWs?si=9DStVzGBfr2-mDfz', '320kbps' // optional quality parameter ); console.log(mp3Result); } catch (error) { console.error(error); } })(); ``` ## API Methods ### `ephoto(url, text)` - `url` (String): The ephoto360 effect URL - `text` (String): The text to apply the effect to ### `ytmp4(url, [quality])` - `url` (String): YouTube video URL - `quality` (String, optional): Preferred quality (e.g., '360p', '720p') ### `ytmp3(url, [quality])` - `url` (String): YouTube video URL - `quality` (String, optional): Preferred quality (e.g., '128kbps', '320kbps') ## Response Structure All methods return a Promise that resolves to an object with the following structure: ```javascript { creator: "ALI KOJA", status: 200, success: true, // Method-specific response data (result/download) // Metadata (for YouTube methods) } ``` ## License MIT