The easiest way to interact with The OxiAPI, a spanish API.
npm install oxiapi
const api = require('oxiapi');
(async () => {
const data = await api.json.translate(null, 'en', '¡Hola!'); // 1st parameter is "from" (from what language to translate), if you leave it undefined or 'null', it'll use auto language detection.
console.log('Result: ' + JSON.stringify(data));
});
Note: parameters including '?' at the end means they're optional.
-
JSON:
- fact - Returns a random fact (in spanish)
- translate(from, to, text) - Translates given text to another language.
- calculate(expr) - Solves a math expression.
- npm(packagename) - Get info about a NPM package.
- formatDate(timestamp, format, uselowcase?) - Format a date to nearly any format you want.
-
Image:
-
Coming soon!
-