Every endpoint follows the same auth pattern. Switch endpoints, not credentials.
// OCR — extract text from an invoice image
const form = new FormData();
form.append("image", fs.createReadStream("invoice.png"));
const res = await fetch("https://aplicious.com/api/v1/tools/ocr", {
method: "POST",
headers: { "X-API-Key": "YOUR_API_KEY", ...form.getHeaders() },
body: form,
});
const { data } = await res.json();
console.log(data.text); // extracted text
console.log(data.confidence); // 0.97
// Sentiment analysis — analyse a product review
const r = await fetch("https://aplicious.com/api/v1/tools/text/sentiment", {
method: "POST",
headers: { "X-API-Key": "YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ text: "Absolutely love this product!", granularity: "document" }),
});
const result = await r.json();
console.log(result.data.sentiment); // "positive"
console.log(result.data.score); // 0.9
console.log(result.data.emotions.joy); // 0.9