Registry / data / hxz-api

hxz-api

JSON →
library1.0.1jsnpmunverified

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.

npm install hxz-api
INSTALL
IMPORT
SIG · HXZ-API
H
hxz-api
datajavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

hx
const hx = require('hxz-api');
import hx from 'hxz-api';
The README examples consistently use CommonJS `require`. While ESM `import hx from 'hxz-api'` might work, CJS is the officially demonstrated pattern.
hx.otakudesu
const hx = require('hxz-api'); hx.otakudesu('kaifuku');
import { otakudesu } from 'hxz-api';
Functions are exported as methods of the main `hx` object, not as named exports from the package root.
hx.igdl
const hx = require('hxz-api'); hx.igdl('https://www.instagram.com/p/...');
require('hxz-api').igdl('https://...');
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.

Fetches current global COVID-19 statistics and retrieves a 'Guess the Picture' challenge, demonstrating two basic API calls.

const hx = require('hxz-api'); hx.covid() .then(result => { console.log('COVID-19 Statistics:', result); }) .catch(error => { console.error('Failed to fetch COVID-19 statistics:', error); }); hx.tebakgambar() .then(result => { console.log('Tebak Gambar (Guess the Picture) Challenge:', result); }) .catch(error => { console.error('Failed to fetch Tebak Gambar challenge:', error); });
Debug
Known issues
breakingThis library relies on scraping and unofficial APIs. Changes to the underlying websites or services can cause functions to break without warning, requiring library updates.
fix
Regularly update the `hxz-api` package. If issues persist after updating, check the GitHub repository for reported issues or contact the maintainer.
affects: >=1.0.0
gotchaThe 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.
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.
affects: >=1.0.0
gotchaUsage 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.
fix
Implement delays between consecutive requests, use proxies if necessary, and review the terms of service of the targeted platforms to ensure compliance.
affects: >=1.0.0
gotchaInput 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.
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`).
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: hx.someNonExistentFunction is not a function
Attempting to call a method that does not exist on the `hx` object or has been misspelled.
fix
Verify the method name against the documentation or available methods (e.g., `otakudesu`, `covid`, `igdl`). Remember functions are accessed as `hx.methodName`.
FetchError: request to https://api.hexa-api.site/... failed, reason: connect ECONNREFUSED
The Hexa-API server is offline, unreachable, or there's a network issue preventing your application from connecting.
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.
Error: Invalid link provided
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.
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.
Error: Data not found for the given query.
A search or lookup function (e.g., `otakudesu`, `komiku`, `chara`, `wattpad`) did not find any results for the provided query string.
fix
Try a different or more general search term. Verify that the input is in the expected language or format for the specific function.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
hxz-api — npm install hxz-api · libregistry