2.0.0 • Published 6 months ago
oxiapi v2.0.0
oxiapi
The easiest way to interact with The OxiAPI, a spanish API.
Table of contents
Installation
npm install oxiapi
Example
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));
});
Available endpoints
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!