Sentiment Analysis API
This API allows you to perform sentiment analysis on multiple text inputs in a single request, with support for up to 10 texts per batch.
🟢 Endpoint
POST https://kubus.co.id/api/v1/sentiment/batch
🔐 Headers
Use your API key to authorize requests. Replace YOUR_API_KEY with your actual key.
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Manage Your API Keys
📦 Request Body
Send a JSON object with a list of texts:
{
"texts": [
"Pelayanan sangat buruk dan tidak ramah.",
"Saya puas dengan transaksi ini.",
"Barang tidak sesuai dengan deskripsi."
]
}
✅ Response
The API will return a list of detected sentiments with confidence:
{
"results": [
{
"confidence": 1.0,
"sentiment": "negative",
"text": "Pelayanan sangat buruk dan tidak ramah."
},
{
"confidence": 1.0,
"sentiment": "positive",
"text": "Saya puas dengan transaksi ini."
},
{
"confidence": 1.0,
"sentiment": "negative",
"text": "Barang tidak sesuai dengan deskripsi."
}
],
"status": "success"
}
Notes
- Each text will return its sentiment:
positive,negative, orneutral. confidenceis a value between 0.0 and 1.0 indicating model certainty.- Each request can include up to 10 texts per batch. Exceeding this limit will return an error.
- Ensure your API key is valid and not expired.