Sentiment and emotion analysis
| Method | Path | Summary |
|---|---|---|
GET | /sentiment | List sentiment analyses |
POST | /sentiment | Create a sentiment analysis |
POST | /sentiment/analyze | Analyze text directly |
{% api-endpoint method=“GET” path=“/sentiment” /%}
List sentiment analyses
Operation ID: listSentimentAnalyses
| Name | Type | Required | Description |
| --------- | ---------- | ------------ | ------------- | -------- | ------------ | --- | ------------------------------------------------------------------- |
| page | integer | No | Default: 1 |
| perPage | integer | No | Default: 20 |
| status | "pending" | "processing" | "completed" | "failed" | "cancelled" | No | Values: pending, processing, completed, failed, cancelled |
Paginated list of analyses
| Field | Type | Required | Description |
|---|---|---|---|
data | object[] | No | - |
pagination | object | No | - |
{% tabs %} {% tab label=“TypeScript” %}
import { WaveClient } from "@wave/sdk";
const client = new WaveClient({ apiKey: "your-api-key" });
const result = await client.sentiment.listSentimentAnalyses({
page: 1,
perPage: 1,
status: "example-value",
});
console.log(result);
{% /tab %} {% tab label=“Python” %}
from wave_sdk import WaveClient
client = WaveClient(api_key="your-api-key")
result = client.sentiment.list_sentiment_analyses(
page=1,
per_page=1,
status="example-value"
)
print(result)
{% /tab %} {% tab label=“cURL” %}
curl -X GET 'https://api.wave.online/sentiment?page=1&perPage=1&status=example-value' \
-H 'Authorization: Bearer YOUR_API_KEY'
{% /tab %} {% /tabs %}
{% api-endpoint method=“POST” path=“/sentiment” /%}
Create a sentiment analysis
Operation ID: createSentimentAnalysis
Content-Type: application/json
| Required
| Field | Type | Required | Description |
|---|---|---|---|
sourceId | string | Yes | - |
sourceType | string | Yes | Values: video, audio, text, chat |
text | string | No | - |
includeEmotions | boolean | No | Default: false |
includeTopics | boolean | No | Default: false |
includeSummary | boolean | No | Default: false |
segmentAnalysis | boolean | No | Default: false |
Analysis created
| Field | Type | Required | Description |
|---|---|---|---|
id | string | No | - |
sourceId | string | No | - |
sourceType | string | No | Values: video, audio, text, chat |
status | string | No | Values: pending, processing, completed, failed, cancelled |
overallSentiment | string | No | Values: positive, negative, neutral, mixed |
overallScore | number | No | - |
confidence | number | No | - |
summary | string | No | - |
organizationId | string | No | - |
createdAt | string (date-time) | No | - |
updatedAt | string (date-time) | No | - |
{% tabs %} {% tab label=“TypeScript” %}
import { WaveClient } from "@wave/sdk";
const client = new WaveClient({ apiKey: "your-api-key" });
const result = await client.sentiment.createSentimentAnalysis({
sourceId: "abc-123",
sourceType: "video",
text: "example-value",
includeEmotions: false,
includeTopics: false,
includeSummary: false,
segmentAnalysis: false,
});
console.log(result);
{% /tab %} {% tab label=“Python” %}
from wave_sdk import WaveClient
client = WaveClient(api_key="your-api-key")
result = client.sentiment.create_sentiment_analysis(
source_id="abc-123",
source_type="example-value",
text="example-value",
include_emotions=True,
include_topics=True,
include_summary=True,
segment_analysis=True
)
print(result)
{% /tab %} {% tab label=“cURL” %}
curl -X POST 'https://api.wave.online/sentiment' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"sourceId": "abc-123",
"sourceType": "video",
"text": "example-value",
"includeEmotions": false,
"includeTopics": false,
"includeSummary": false,
"segmentAnalysis": false
}'
{% /tab %} {% /tabs %}
{% api-endpoint method=“POST” path=“/sentiment/analyze” /%}
Analyze text directly
Operation ID: analyzeText
Content-Type: application/json
| Required
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | - |
includeEmotions | boolean | No | Default: false |
includeTopics | boolean | No | Default: false |
Analysis result
| Field | Type | Required | Description |
|---|---|---|---|
sentiment | string | No | Values: positive, negative, neutral |
score | number | No | - |
confidence | number | No | - |
emotions | object | No | - |
topics | object[] | No | - |
{% tabs %} {% tab label=“TypeScript” %}
import { WaveClient } from "@wave/sdk";
const client = new WaveClient({ apiKey: "your-api-key" });
const result = await client.sentiment.analyzeText({
text: "example-value",
includeEmotions: false,
includeTopics: false,
});
console.log(result);
{% /tab %} {% tab label=“Python” %}
from wave_sdk import WaveClient
client = WaveClient(api_key="your-api-key")
result = client.sentiment.analyze_text(
text="example-value",
include_emotions=True,
include_topics=True
)
print(result)
{% /tab %} {% tab label=“cURL” %}
curl -X POST 'https://api.wave.online/sentiment/analyze' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"text": "example-value",
"includeEmotions": false,
"includeTopics": false
}'
{% /tab %} {% /tabs %}