{"id":13315,"library":"hxz-api","title":"Hexa-API Client Library","description":"The `hxz-api` package, currently at version 1.0.1, provides a JavaScript client for the Hexa-API, a consolidated service that aggregates data from various online sources and offers media download functionalities. This library enables developers to interact with a wide array of services including searching anime (Otakudesu) and manga (Komiku), retrieving global COVID-19 statistics, accessing Islamic prayer times (Sholat) and Quran surah information, fetching song lyrics, character data, Wattpad stories, Play Store app information, WhatsApp group links, and Pinterest images. It also facilitates downloading content from popular social media platforms like Instagram, Twitter, Facebook, YouTube, and TikTok. The library primarily exposes a Promise-based API for asynchronous operations. While a specific release cadence is not documented, updates likely occur as new features are added or underlying services require maintenance. Its key differentiator is providing a single interface to numerous, often unofficial, content aggregation and scraping services.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/Hexagonz/Hexa-api","tags":["javascript","YNTKTS"],"install":[{"cmd":"npm install hxz-api","lang":"bash","label":"npm"},{"cmd":"yarn add hxz-api","lang":"bash","label":"yarn"},{"cmd":"pnpm add hxz-api","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The README examples consistently use CommonJS `require`. While ESM `import hx from 'hxz-api'` might work, CJS is the officially demonstrated pattern.","wrong":"import hx from 'hxz-api';","symbol":"hx","correct":"const hx = require('hxz-api');"},{"note":"Functions are exported as methods of the main `hx` object, not as named exports from the package root.","wrong":"import { otakudesu } from 'hxz-api';","symbol":"hx.otakudesu","correct":"const hx = require('hxz-api');\nhx.otakudesu('kaifuku');"},{"note":"While functional, chaining `require` directly without assigning to a variable first can lead to less readable code and potential issues with module caching in complex scenarios.","wrong":"require('hxz-api').igdl('https://...');","symbol":"hx.igdl","correct":"const hx = require('hxz-api');\nhx.igdl('https://www.instagram.com/p/...');"}],"quickstart":{"code":"const hx = require('hxz-api');\n\nhx.covid()\n    .then(result => {\n        console.log('COVID-19 Statistics:', result);\n    })\n    .catch(error => {\n        console.error('Failed to fetch COVID-19 statistics:', error);\n    });\n\nhx.tebakgambar()\n    .then(result => {\n        console.log('Tebak Gambar (Guess the Picture) Challenge:', result);\n    })\n    .catch(error => {\n        console.error('Failed to fetch Tebak Gambar challenge:', error);\n    });","lang":"javascript","description":"Fetches current global COVID-19 statistics and retrieves a 'Guess the Picture' challenge, demonstrating two basic API calls."},"warnings":[{"fix":"Regularly update the `hxz-api` package. If issues persist after updating, check the GitHub repository for reported issues or contact the maintainer.","message":"This library relies on scraping and unofficial APIs. Changes to the underlying websites or services can cause functions to break without warning, requiring library updates.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Wrap all asynchronous API calls with `try...catch` blocks or use `.catch()` with Promises to gracefully handle network errors, invalid inputs, or upstream service failures.","message":"The provided examples in the README often lack comprehensive error handling (e.g., `.catch()` blocks). In a production environment, always implement robust error handling for network requests and API responses.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Implement delays between consecutive requests, use proxies if necessary, and review the terms of service of the targeted platforms to ensure compliance.","message":"Usage of downloader functions (e.g., `igdl`, `twitter`, `fbdown`, `youtube`, `ttdownloader`) may be subject to rate limits, IP bans, or terms of service violations of the respective platforms. Use responsibly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Validate and sanitize all user inputs before passing them to `hxz-api` functions. Check for expected formats (e.g., valid URLs for downloaders, numeric IDs for `surah`).","message":"Input validation is critical for functions taking user-supplied strings (e.g., `judul`, `link`, `username`, `name`). Passing malformed or unexpected input might lead to unexpected errors or incorrect results.","severity":"gotcha","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":"Verify the method name against the documentation or available methods (e.g., `otakudesu`, `covid`, `igdl`). Remember functions are accessed as `hx.methodName`.","cause":"Attempting to call a method that does not exist on the `hx` object or has been misspelled.","error":"TypeError: hx.someNonExistentFunction is not a function"},{"fix":"Check your internet connection. If your connection is fine, the upstream Hexa-API might be down. Wait and retry later, or check the project's GitHub for status updates.","cause":"The Hexa-API server is offline, unreachable, or there's a network issue preventing your application from connecting.","error":"FetchError: request to https://api.hexa-api.site/... failed, reason: connect ECONNREFUSED"},{"fix":"Ensure the provided link is a complete and correctly formatted URL, and that it points to a supported content type/platform for the specific downloader function.","cause":"A downloader function (e.g., `igdl`, `twitter`, `fbdown`, `youtube`, `ttdownloader`) was called with a link that is not a valid URL or is not supported by the underlying API.","error":"Error: Invalid link provided"},{"fix":"Try a different or more general search term. Verify that the input is in the expected language or format for the specific function.","cause":"A search or lookup function (e.g., `otakudesu`, `komiku`, `chara`, `wattpad`) did not find any results for the provided query string.","error":"Error: Data not found for the given query."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null}