API Endpoint
POST Sentiment Analysis API
/api/v1/ai/sentiment-analysis
Analyze the emotional tone of text to identify positive, negative, neutral, or mixed sentiments.
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
text |
string | Required | The text content you want to analyze (Max: 5,000 characters). |
aspects |
array of strings | Optional | Optional list of specific topics to analyze sentiment for (e.g., ["UI", "billing", "speed"]). Max 10 items. |
model |
string | Optional | Optional. AI model to use for classification. Defaults to platform optimal model. |
Example Request (Basic)
JSON Request
{
"text": "The new dashboard is incredibly fast and looks amazing!"
}
cURL
curl -X POST https://rsflowhub.com/api/v1/ai/sentiment-analysis \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "The new dashboard is incredibly fast and looks amazing!"
}'
Example Response (Basic)
The API guarantees the sentiment string will be one of: positive, negative, neutral, or mixed.
JSON Response
{
"success": true,
"data": {
"result": {
"sentiment": "positive",
"confidence": 0.98
}
},
"meta": {
"credits_used": 1,
"credits_remaining": 999
}
}
Advanced Example (Aspect-Based Sentiment)
Provide an aspects array to get targeted sentiment scores for specific subjects mentioned in the text.
Advanced JSON Request
{
"text": "The dashboard is really fast, but the billing page is confusing and support took too long.",
"aspects": ["dashboard", "billing", "support"]
}
Advanced JSON Response
{
"success": true,
"data": {
"result": {
"sentiment": "mixed",
"confidence": 0.85,
"aspect_sentiments": [
{
"aspect": "dashboard",
"sentiment": "positive",
"confidence": 0.95
},
{
"aspect": "billing",
"sentiment": "negative",
"confidence": 0.92
},
{
"aspect": "support",
"sentiment": "negative",
"confidence": 0.88
}
]
}
},
"meta": {
"credits_used": 1,
"credits_remaining": 998
}
}
API Request Example
Use the cURL snippet below to test the endpoint.
cURL
curl -X POST 'https://rsflowhub.com/api/v1/ai/sentiment-analysis' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"text": "The dashboard is really fast, but the billing page is confusing.",
"aspects": [
"dashboard",
"billing"
]
}'