About this endpoint
What it does
Analyzes the sentiment of the supplied text and returns a JSON object whose data field contains provider-specific response objects. The request body includes the text to analyze, optional provider credentials/configuration, and a requested_service selector that defaults to apyhub.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| text | String | Yes | The text to analyze for sentiment. |
| azure | Object | No | Optional Azure credentials/configuration for Azure-based analysis. |
| azure.key | String | No | Azure subscription key. |
| azure.region | String | No | Azure service region. |
| azure.endpoint | String | No | Azure endpoint URL. |
| azure.account_id | String | No | Azure account ID. |
| azure.access_token | String | No | OAuth access token for Azure service. |
| Object | No | Optional Google credentials/configuration for Google-based analysis. | |
| google.google_language | String | No | Target language locale. |
| google.google_credential_json | Object | No | Google service account credential JSON. See schema for nested fields. |
| encoding | String | No | Text encoding. |
| language | String | No | Language code for the input text. |
| requested_service | ENUM | No | Which service to use. Allowed values: azure, google, apyhub. Default: apyhub. |
Response
Returns a JSON object with a data object field. Inside data, the schema defines three possible provider response objects: azure, apyhub, and google.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | Object | Yes | Container for provider-specific response objects. |
| data.azure | Object | No | Response object from Microsoft Azure Cognitive Services. |
| data.apyhub | Object | No | Response object from ApyHub language tools. |
| data.google | Object | No | Response object from Google Cloud NLP API. |