---
title: "Analyze sentiment of input"
method: POST
path: "/sentiment"
tags: ["sentiment"]
---

# Analyze sentiment of input

`POST /sentiment`

## Request

- Base URL: `https://api.rosette.com/rest/v1`
- URL: `https://api.rosette.com/rest/v1/sentiment`
- Auth: API key in header `X-RosetteAPI-Key`

Analyzes the positive and negative sentiment expressed by the input. <br><br>The response contains sentiment analysis results.

## Request body

- union
  - object
    - `content` string
    - `language` string: 3 letter code of language.
    - `options` object
      - `modelType` 'DNN': use deep neural network sentment model for English only (DNN)
  - object
    - `contentUri` string
    - `language` string: 3 letter code of language.
    - `options` object
      - `modelType` 'DNN': use deep neural network sentment model for English only (DNN)

## Response `200`

OK

- SentimentResponse
  - `document` Label
    - `confidence` number: confidence (0.0 -1.0)
    - `label` string: label for contextual category
  - `entities` Entity[]
    - `type` string: entity type
    - `mention` string: mention text
    - `normalized` string: normalized mention text
    - `count` integer: mention count
    - `mentionOffsets` MentionOffsets[]: list of offsets for all mentions
      - `startOffset` integer
      - `endOffset` integer
    - `entityId` string: entity id
    - `confidence` number: confidence score (0.0.-1.0)
    - `linkingConfidence` number: linking confidence score (0.0.-1.0)
    - `DPediaTypes` object[]: If includeDBPediaTypes option is true, this field contains a list of the full ontological path of the type(s) within the DBpedia hierarchy
      - `DPpediaType` string
    - `permId` string: Thomeson Reuters Permanent Identifier
    - `salience` number: salinece score (0.0 or 1.0), indicating whether the entity is important to the overall scope of the document

---

[API](https://skmtc.dev/babelstreet/apis/rosette-text-analytics.md) · [All operations](https://skmtc.dev/babelstreet/apis/rosette-text-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/babelstreet/apis/rosette-text-analytics/revisions/7c1d1497a5dd?raw)
