{"id":12807,"library":"api-qasim","title":"QasimDev REST API SDK","description":"api-qasim is a universal SDK designed to interact with the QasimDev REST API, offering comprehensive support for various JavaScript environments including Node.js (CommonJS and ESM), TypeScript, and browsers. Currently at version 4.0.2, this library aims for consistent, incremental releases without a strict fixed cadence, driven by API updates and community feedback. It differentiates itself by providing a wide array of utility endpoints across categories like AI, multimedia processing, URL shortening, news, and various photo effects, all accessible through a unified, object-oriented interface. The SDK handles request configuration, including API key management, base URL overrides, and request timeouts, streamlining interactions with the underlying REST services. Its broad environment compatibility, including CDN-based browser usage, makes it versatile for different project types.","status":"active","version":"4.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/GlobalTechInfo/API-QASIM","tags":["javascript","mod","apk","ringtone","wikimedia","wikipedia","styletext","fancytext","textpro","typescript"],"install":[{"cmd":"npm install api-qasim","lang":"bash","label":"npm"},{"cmd":"yarn add api-qasim","lang":"bash","label":"yarn"},{"cmd":"pnpm add api-qasim","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for file uploads to POST endpoints, especially for image effects in Node.js environments.","package":"form-data","optional":false}],"imports":[{"note":"The main SDK class is a default export in ESM. CommonJS uses `const API = require('api-qasim');`","wrong":"import { API } from 'api-qasim';","symbol":"API","correct":"import API from 'api-qasim';"},{"note":"This is a TypeScript type interface for configuration options. Use `import type` for type-only imports.","wrong":"import { APIConfig } from 'api-qasim';","symbol":"APIConfig","correct":"import type { APIConfig } from 'api-qasim';"},{"note":"In CommonJS, the main SDK class is accessed directly from the module export, not as a named property.","wrong":"const { API } = require('api-qasim');","symbol":"API","correct":"const API = require('api-qasim');"}],"quickstart":{"code":"import API from 'api-qasim';\nimport process from 'process';\n\nasync function runExample() {\n  const apiKey = process.env.QASIM_API_KEY ?? 'qasim-dev'; // Use environment variable or default free key\n  const api = new API({ apiKey });\n\n  try {\n    console.log('Fetching AI response...');\n    const aiResult = await api.KimiAi({ prompt: 'Tell me a short story about a brave knight.' });\n    console.log('Kimi AI Result:', aiResult);\n\n    console.log('\\nFetching weather data for London...');\n    const weatherResult = await api.Weather({ city: 'London' });\n    console.log('Weather in London:', weatherResult);\n\n    console.log('\\nShortening a URL...');\n    const shortenResult = await api.TinyUrl({ url: 'https://www.example.com/very-long-url-that-needs-shortening' });\n    console.log('Shortened URL:', shortenResult);\n  } catch (error) {\n    console.error('An error occurred:', error.message);\n  }\n}\n\nrunExample();","lang":"typescript","description":"Demonstrates initializing the API client with an API key and making multiple API calls to different endpoints (AI, Weather, URL Shortener) to show diverse functionality."},"warnings":[{"fix":"Upgrade your Node.js environment to version 20 or newer. Use `nvm install 20` and `nvm use 20` or similar version management tools.","message":"The package now requires Node.js version 20 or higher. Older Node.js versions are not supported and will likely lead to runtime errors or installation failures due to engine requirements.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Install `form-data` (`npm install form-data`) and use it to construct your request body when dealing with file uploads, as shown in the package's documentation.","message":"For file upload endpoints (like image effects), a `FormData` instance is required. In Node.js, you must explicitly install and use the `form-data` package, as it is not a direct dependency of `api-qasim` but a peer requirement for this specific use case.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Register for a personal API key on the QasimDev API website and pass it to the `API` constructor via the `apiKey` option: `new API({ apiKey: 'YOUR_SECURE_KEY' })`.","message":"The default `apiKey` is 'qasim-dev', which is a free key. While convenient for quick testing, it might have rate limits or usage restrictions. For production or higher-volume usage, it's recommended to obtain and use a dedicated API key from the QasimDev platform.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Unless specific HTTP headers or metadata are absolutely necessary, rely on the default behavior where the SDK automatically extracts and returns the relevant data. If you enable `fullResponse`, ensure your code can handle the full `Response` object and its structure.","message":"The `fullResponse` option is available to return the complete API response object. While not strictly deprecated, directly consuming the raw API response might expose sensitive internal structures or require more robust error handling. The default behavior of returning parsed data is generally preferred.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure your project is configured correctly for ESM (e.g., `\"type\": \"module\"` in `package.json`) and use `import API from 'api-qasim';`. Alternatively, for CJS projects, ensure it's loaded as CJS: `const API = require('api-qasim');`.","cause":"Attempting to use `require()` syntax in a Node.js project configured as an ESM module, or when the `api-qasim` package is treated as ESM.","error":"Error: require() of ES Module ...api-qasim is not supported."},{"fix":"Refer to the `api-qasim` documentation or the QasimDev API reference to verify the correct method name and available endpoints. Method names are case-sensitive.","cause":"Attempting to call an API endpoint method that does not exist, or misspelling an existing method name.","error":"TypeError: api.SomeEndpoint is not a function"},{"fix":"Verify that your `apiKey` configuration is correct and that the key is valid and active. Double-check for typos or ensure the environment variable for your API key is correctly set.","cause":"An invalid or missing API key was provided to the QasimDev API, resulting in an unauthorized access error.","error":"Error: Request failed with status code 401"},{"fix":"Consider increasing the `timeout` value in the `API` constructor for specific long-running operations: `new API({ timeout: 60000 })`. Also, check network connectivity and the status of the QasimDev API.","cause":"The API request took longer than the configured `timeout` period (default 45 seconds) to receive a response, often due to slow network conditions or a long-running server process.","error":"Error: Timeout of 45000ms exceeded"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null}