Launch Week Day 3: Introducing Organization Notifications in Socket.Learn More
Socket
Book a DemoSign in
Socket

api-qasim

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-qasim

Universal SDK for QasimDev Rest API - Supporting CJS, ESM, TypeScript, and Browser

latest
Source
npmnpm
Version
4.0.2
Version published
Weekly downloads
54K
64.14%
Maintainers
1
Weekly downloads
 
Created
Source

api-qasim

Universal SDK for QasimDev REST API — supports Node.js (CJS/ESM), TypeScript, and Browser.

npm version npm downloads license Node.js

Table of Contents

Installation

npm install api-qasim

Quick Start

const API = require('api-qasim');

const api = new API({ apiKey: 'your-api-key' });

const result = await api.KimiAi({ prompt: 'Hello!' });
console.log(result);

Configuration

const api = new API({
  apiKey: 'your-api-key',       // Optional. Default: qasim-dev (free)
  baseURL: 'https://...',       // Optional. Default: https://api.qasimdev.dpdns.org
  fullResponse: false,          // Optional. Return full response object. Default: false
  timeout: 45000                // Optional. Timeout in ms. Default: 45000
});
OptionTypeDefaultDescription
apiKeystringqasim-devAPI key override
baseURLstringhttps://api.qasimdev.dpdns.orgBase URL override
fullResponsebooleanfalseReturn full response with metadata
timeoutnumber45000Request timeout in milliseconds

Usage by Environment

Node.js (CommonJS)

const API = require('api-qasim');

const api = new API({ apiKey: 'your-api-key' });
const result = await api.Weather({ city: 'London' });

Node.js (ESM)

import API from 'api-qasim';

const api = new API({ apiKey: 'your-api-key' });
const result = await api.Weather({ city: 'London' });

TypeScript

import API, { APIConfig } from 'api-qasim';

const config: APIConfig = { apiKey: 'your-api-key' };
const api = new API(config);

const result = await api.Weather({ city: 'London' });

Browser (CDN)

<script src="https://cdn.jsdelivr.net/npm/api-qasim@4.0.1/dist/browser/global.min.js"></script>
<script>
  const api = new API({ apiKey: 'qasim-dev' });
  api.Weather({ city: 'London' }).then(console.log);
</script>

Browser (ESM)

import API from 'https://cdn.jsdelivr.net/npm/api-qasim@4.0.1/dist/browser/index.mjs';

const api = new API({ apiKey: 'your-api-key' });

File Upload (POST Endpoints)

POST endpoints (image effects) require FormData with a file.

Node.js

const API = require('api-qasim');
const FormData = require('form-data');
const fs = require('fs');

const api = new API({ apiKey: 'your-api-key' });

const formData = new FormData();
formData.append('file', fs.readFileSync('image.jpg'), {
  filename: 'image.jpg',
  contentType: 'image/jpeg'
});

const result = await api.Grayscale(formData);
// result = "data:image/png;base64,..."

// Save to file
const base64Data = result.split(',')[1];
fs.writeFileSync('output.png', Buffer.from(base64Data, 'base64'));

Note: form-data is a peer dependency for Node.js file uploads. Install it with npm install form-data.

Browser

const formData = new FormData();
formData.append('file', fileInput.files[0]);

const result = await api.Grayscale(formData);
// result = { blob, url, base64, contentType }

// Display in image tag
document.querySelector('img').src = result.url;

// Or download
const a = document.createElement('a');
a.href = result.url;
a.download = 'output.png';
a.click();

API Reference

AI

MethodParamsDescription
KimiAi({ prompt })prompt: stringKimi AI chat
MistralAi({ text })text: stringMistral AI
CodestralAi({ text, model })text: string, model: stringCodestral (code AI)
Deepseek({ prompt })prompt: stringDeepSeek AI
QwenAi({ text })text: stringQwen AI
CerebrasAi({ text })text: stringCerebras AI
GroqAi({ text })text: stringGroq AI
const result = await api.KimiAi({ prompt: 'What is the capital of France?' });

Apps

MethodParamsDescription
An1Search({ query })query: stringSearch APKs on An1
An1Dl({ url })url: stringDownload APK from An1
ApkpureSearch({ query })query: stringSearch APKs on APKPure
ApkpureDl({ query })query: stringDownload APK from APKPure
AptoideSearch({ query })query: stringSearch APKs on Aptoide
AptoideDl({ url })url: stringDownload APK from Aptoide
const result = await api.ApkpureSearch({ query: 'whatsapp' });

URL Shorteners

MethodParamsDescription
Reurl({ url })url: stringShorten with Reurl
Itsl({ url })url: stringShorten with ItsSSL
Cuqin({ url })url: stringShorten with Cuqin
Surl({ url })url: stringShorten with Ssur
Vurl({ url })url: stringShorten with Vurl
Vgd({ url })url: stringShorten with V.gd
Clean({ url })url: stringShorten with CleanURI
Tiny({ url })url: stringShorten with TinyURL
Unshort({ url })url: stringUnshorten a URL
const result = await api.Tiny({ url: 'https://example.com/very/long/url' });

Downloads

MethodParamsDescription
TikTok({ url })url: stringDownload TikTok video
Instagram({ url })url: stringDownload Instagram media
Facebook({ url })url: stringDownload Facebook video
Twitter({ url })url: stringDownload Twitter/X media
Pinterest({ url })url: stringDownload Pinterest media
Reddit({ url })url: stringDownload Reddit media
Snapchat({ url })url: stringDownload Snapchat media
Threads({ url })url: stringDownload Threads media
Twitch({ url })url: stringDownload Twitch clip
Sharechat({ url })url: stringDownload Sharechat media
Snackvideo({ url })url: stringDownload Snack Video
Mediafire({ url })url: stringDownload from Mediafire
Gitclone({ url })url: stringClone a GitHub repo
IMDbVideo({ url })url: stringDownload IMDb video
IFunny({ url })url: stringDownload iFunny media
Getty({ url })url: stringDownload Getty image
Videezy({ url })url: stringDownload from Videezy
Vidsplay({ url })url: stringDownload from Vidsplay
WallBest({ text, page? })text: stringSearch WallBest wallpapers
WallCraft({ text })text: stringSearch WallCraft wallpapers
WallHaven({ query?, sorting?, page?, purity?, categories? })Search Wallhaven
Wikimedia({ title })title: stringGet Wikimedia images
const result = await api.TikTok({ url: 'https://www.tiktok.com/@user/video/123' });

Image Makers

MethodParamsDescription
TextToPic({ text })text: stringConvert text to image
Quoted({ text, name, profile })Generate quote card
Carbon({ code, bg? })code: stringGenerate Carbon code image
const result = await api.Carbon({ code: 'console.log("hello")', bg: '#1e1e2e' });

Music

MethodParamsDescription
Spotify({ url })url: stringDownload Spotify track
SearchScloud({ q, limit? })q: stringSearch SoundCloud
ScloudDl({ url })url: stringDownload SoundCloud track
GeniusSearch({ query })query: stringSearch Genius lyrics
GeniusLyrics({ url })url: stringGet lyrics from Genius
DeezerSearch({ track?, artist?, album? })Search Deezer
DeezerDl({ id })id: stringDownload Deezer track
JamendoSearch({ query, type?, limit? })query: stringSearch Jamendo
JamendoTracks({ artist_name, limit?, type? })artist_name: stringGet Jamendo tracks
const result = await api.GeniusSearch({ query: 'Bohemian Rhapsody' });

Random Images

MethodDescription
Couple()Random couple wallpaper
Islamic()Random Islamic image
Tech()Random tech image
Game()Random gaming image
Mountain()Random mountain image
CyberSpace()Random cyberspace image
Coding()Random coding image
Coffee()Random coffee image
const result = await api.Islamic();

News

MethodParamsDescription
GoogleNews({ query? })query?: stringGoogle News
Bbc()BBC News
Cnn()CNN News
Aljazeera()Al Jazeera News
Sky()Sky News
SkySports({ sport })sport: stringSky Sports News
Trt()TRT World News
Dawn()Dawn News
Cgtn()CGTN World News
GeoUrdu()Geo Urdu News
Geo()Geo News
Neo()Neo News
Express()Express News
const result = await api.GoogleNews({ query: 'technology' });
const headlines = await api.Bbc();

Stalker

MethodParamsDescription
GithubUser({ username })username: stringGitHub profile info
TiktokUser({ username })username: stringTikTok profile info
PinterestUser({ username })username: stringPinterest profile info
TelegramUser({ username })username: stringTelegram profile info
ThreadsUser({ username })username: stringThreads profile info
RedditUser({ username })username: stringReddit profile info
ScloudUser({ username })username: stringSoundCloud profile info
DribbbleUser({ username })username: stringDribbble profile info
MastodonUser({ username, instance? })username: stringMastodon profile info
const result = await api.GithubUser({ username: 'torvalds' });
MethodParamsDescription
BingSearch({ query })query: stringBing web search
BingImage({ query })query: stringBing image search
GoogleImage({ query })query: stringGoogle image search
ImgurSearch({ query })query: stringImgur search
FlickrImage({ query })query: stringFlickr image search
YTSearch({ query, limit? })query: stringYouTube search
ImdbSearch({ query })query: stringIMDb search
PinSearch({ query })query: stringPinterest search
Wattpad({ query })query: stringWattpad search
Stickers({ query, page?, limit? })query: stringSticker search
TimeSearch({ location })location: stringSearch time by location
const result = await api.YTSearch({ query: 'lo-fi music', limit: 10 });

Tools

MethodParamsDescription
Screenshot({ url })url: stringTake website screenshot
SSFull({ url, format?, fullSize? })url: stringFull page screenshot
Translate({ text, from?, to? })text: stringTranslate via Bing
Translate2({ text, from?, to? })text: stringTranslate via Google
Dictionary({ term })term: stringDictionary definition
Ping({ url })url: stringPing a URL
Handwriting({ text })text: stringConvert text to handwriting
TextStats({ text })text: stringGet text statistics
UnitConvert({ from, to, value })Unit conversion
const result = await api.Translate({ text: 'Hello', from: 'en', to: 'ar' });
const result2 = await api.UnitConvert({ from: 'f', to: 'c', value: 100 });

Photo Effects (Photooxy)

MethodParamsDescription
Battlefield({ text1, text2 })text1, text2: stringBattlefield style effect
TikTokEffect({ text1, text2 })text1, text2: stringTikTok style effect
CustomPhoto({ url, text })url, text: stringCustom Photooxy effect

Photo Effects (Ephoto360)

MethodParamsDescription
WolfGalaxy({ text1, text2 })text1, text2: stringWolf Galaxy effect
FreeFire({ text1, text2 })text1, text2: stringFree Fire banner
ApexLegends({ text1, text2 })text1, text2: stringApex Legends banner
CustomEphoto({ url, text })url, text: stringCustom Ephoto effect

Information

MethodParamsDescription
Weather({ city })city: stringWeather by city
Country({ name })name: stringCountry information
Wikipedia({ query })query: stringWikipedia summary
IPLookup({ ip })ip: stringIP address info
Universities({ country })country: stringUniversities by country
Trends({ country })country: stringGoogle Trends by country
GithubRepo({ owner, repo })owner, repo: stringGitHub repo info
const result = await api.Weather({ city: 'Karachi' });
const wiki = await api.Wikipedia({ query: 'JavaScript' });

Crypto

MethodParamsDescription
CoinInfo({ id })id: stringCoin info (e.g. btc-bitcoin)
CoinsList()List all available coins
const result = await api.CoinInfo({ id: 'btc-bitcoin' });
const coins = await api.CoinsList();

Image Effects (POST)

All image effect methods accept a FormData object with a file field, plus optional parameters.

Node.js response: "data:image/png;base64,..."
Browser response: { blob, url, base64, contentType }

MethodOptional ParamsDescription
Blur(formData, { radius? })radius: numberBlur image
Sharpen(formData, { sigma? })sigma: numberSharpen image
Grayscale(formData)Convert to grayscale
Sepia(formData)Apply sepia tone
Invert(formData)Invert colors
Normalize(formData)Normalize image
Brightness(formData, { value? })value: numberAdjust brightness
Contrast(formData, { value? })value: numberAdjust contrast
Saturation(formData, { value? })value: numberAdjust saturation
Hue(formData, { degrees? })degrees: numberAdjust hue
Gamma(formData, { value? })value: numberAdjust gamma
Tint(formData, { color? })color: stringApply color tint
Rotate(formData, { degrees? })degrees: numberRotate image
Flip(formData, { horizontal?, vertical? })Flip image
Resize(formData, { width?, height? })width, height: numberResize image
Crop(formData, { x?, y?, width?, height? })Crop image
Scale(formData, { factor? })factor: numberScale image
Contain(formData, { width?, height? })width, height: numberContain in box
Cover(formData, { width?, height? })width, height: numberCover a box
Threshold(formData, { max? })max: numberApply threshold
Median(formData, { size? })size: numberMedian filter
Pixelate(formData, { size? })size: numberPixelate image
Gaussian(formData, { radius? })radius: numberGaussian blur
Opacity(formData, { value? })value: numberAdjust opacity
Fade(formData, { value? })value: numberFade image
Posterize(formData, { level? })level: numberPosterize image
Fisheye(formData, { strength? })strength: numberFisheye effect
Vignette(formData, { intensity? })intensity: numberVignette effect
Color(formData, { action?, value? })action: stringColor adjustment
Convolute(formData)Convolve/sharpen
Dither(formData)Dither effect
Circle(formData)Circular crop
// Node.js example
const FormData = require('form-data');
const fs = require('fs');

const formData = new FormData();
formData.append('file', fs.readFileSync('photo.jpg'), {
  filename: 'photo.jpg',
  contentType: 'image/jpeg'
});

const blurred = await api.Blur(formData, { radius: 5 });
const base64Data = blurred.split(',')[1];
fs.writeFileSync('blurred.png', Buffer.from(base64Data, 'base64'));

Response Format

By default, the SDK returns the data field from the API response. To get the full response object:

const api = new API({ apiKey: 'your-key', fullResponse: true });
// Returns: { success: true, data: {...}, timestamp: "..." }

You can also toggle it at runtime:

api.setFullResponse(true);

Error Handling

try {
  const result = await api.Weather({ city: 'London' });
  console.log(result);
} catch (error) {
  if (error.message.includes('401')) {
    console.error('Invalid API key');
  } else if (error.message.includes('timeout')) {
    console.error('Request timed out');
  } else {
    console.error('Error:', error.message);
  }
}

TypeScript Support

import API, { APIConfig, APIResponse } from 'api-qasim';

const config: APIConfig = {
  apiKey: 'your-api-key',
  fullResponse: false,
  timeout: 30000
};

const api = new API(config);

const weather = await api.Weather({ city: 'Dubai' });

Utility Methods

api.setAPIKey('new-api-key');
api.setFullResponse(true);
api.setTimeout(60000);
api.getFullResponse(); // returns boolean

License

MIT © Qasim Ali

Keywords

mod

FAQs

Package last updated on 26 Feb 2026

Did you know?

Socket

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.

Install

Related posts