The main purpose of this module is to simplify sending requests to the MZR API and reduce the error rate. It is completely based on the MZR API.
Installation
npm install mzr-api
pnpm add mzr-api
yarn add mzr-api
Documentation & Examples
We cannot write here as we show everything in the most detailed way in our document. We will only add small NPM related examples in the README. For detailed information you can check documentation.
Example Get Version For CommonJS;
const { version } = require('mzr-api');
console.log(version);
Example Crypto;
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const coins = ['BTC', 'ETH'];
const currencies = ['USD', 'EUR', 'TRY'];
const data = await mzrapi.crypto(coins, currencies);
console.log(data);
})()
Example Fun;
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const data = await mzrapi.fun('wasted', 'image_url.png');
console.log(data);
})()
Example Minecraft Server Info;
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const data = await mzrapi.minecraftServer('mc.hypixel.net');
console.log(data);
})()
Example Steam Game Search;
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const data = await mzrapi.steam('ETS 2');
console.log(data);
})()
Example Translate;
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const data = await mzrapi.translate('Hello! How are you', 'tr');
console.log(data);
})()
Example Discord User Info;
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const data = await mzrapi.users('701518625760346172');
console.log(data);
})()
Example Wikipedia Search;
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const data = await mzrapi.wikipedia('Yusuf Dikeç');
console.log(data);
})()
Example Gold Price (Only Turkiye);
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const data = await mzrapi.altin();
console.log(data);
})()
Example Earthquakes (Only Turkiye);
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const data = await mzrapi.depremler(2);
console.log(data);
})()
Example Currency (Only Turkiye);
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const data = await mzrapi.doviz();
console.log(data);
})()
Example News (Only Turkiye);
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const data = await mzrapi.haberler('dunya', 2);
console.log(data);
})()
Example Prayer Times (Only Turkiye);
const { Api } = require('mzr-api');
const mzrapi = new Api('YOUR_API_KEY');
(async () => {
const data = await mzrapi.namazVakitleri('İstanbul', 'Esenyurt');
console.log(data);
})()