About this endpoint
What it does
Analyzes the sentiment of the text passed in the request and returns sentiment results for the full document plus sentence-level breakdowns.
Query Parameter(s)
| Attribute | Type | Description |
|---|---|---|
| text | String | Input text to analyze. Maximum length: 2,000 characters for Latin-script text (about 800 for other scripts, because the text is sent in the URL). |
Response
Returns a JSON object with two top-level fields: document is an object containing overall sentiment analysis, and sentences is an array of sentence-level sentiment objects.
| Parameter | Type | Description |
|---|---|---|
| document | Object | Overall sentiment analysis for the input text. |
| document.sentiment | String | Document-level sentiment. Nullable. |
| document.confidence | Integer | Document-level confidence score. |
| document.average_confidence | Integer | Average confidence score for the document. |
| sentences | Object Array | Sentence-level sentiment analysis results. |
| sentences[].length | Integer | Sentence length. |
| sentences[].offset | Integer | Sentence offset. |
| sentences[].sentiment | String | Sentence sentiment. Nullable. |
| sentences[].confidence | Integer | Sentence confidence score. |



