apyhub
ARTIFICIAL INTELLIGENCE

AI Text Sentiment Analysis API

What it does

Text Sentiment Analyzer evaluates the sentiment of a text string and returns provider-specific analysis data from the selected service.

Send a body object with text as the required input. You can also include encoding, language, and requested_service to choose between azure, google, or apyhub. If you need to authenticate against a provider directly, the request supports optional azure credentials (key, region, endpoint, account_id, access_token) and optional google settings (google_language, google_credential_json).

The response contains a top-level data object with one of three possible branches: azure, google, or apyhub. Each branch holds the sentiment analysis response from that provider. That makes it useful when you want to compare provider output, route analysis through a specific NLP stack, or keep one endpoint in front of multiple sentiment engines.

Use Text Sentiment Analyzer when you need to score user feedback, triage support messages, or classify short reviews by tone before storing them, routing them, or displaying them in a dashboard.

POST
Analyze text sentiment
https://api.eu.apyverse.com/apyhub/analyze-text-sentiment

QUICKSTART

GUIDE

Quickstart

Send a text string to analyze its sentiment using the default ApyHub service.

curl -X POST "https://api.eu.apyverse.com/apyhub/analyze-text-sentiment" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text":"I absolutely love this new feature!","requested_service":"apyhub"}'

What you'll get back

Returns a JSON object with a data object. The data object may contain an apyhub object, and can also include azure or google objects depending on the requested service.

{
  "data": {
    "apyhub": {},
    "azure": {},
    "google": {}
  }
}
TRY ITLIVE · 500 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
azure
Custom credentials for Azure services.
Azure subscription key.
Azure service region.
Azure endpoint URL.
Azure account ID.
OAuth access token for Azure service.
google
Custom credentials for Google services.
Target language locale.
google_credential_json

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

ParameterTypeMandatoryDescription
textStringYesThe text to analyze for sentiment.
azureObjectNoOptional Azure credentials/configuration for Azure-based analysis.
azure.keyStringNoAzure subscription key.
azure.regionStringNoAzure service region.
azure.endpointStringNoAzure endpoint URL.
azure.account_idStringNoAzure account ID.
azure.access_tokenStringNoOAuth access token for Azure service.
googleObjectNoOptional Google credentials/configuration for Google-based analysis.
google.google_languageStringNoTarget language locale.
google.google_credential_jsonObjectNoGoogle service account credential JSON. See schema for nested fields.
encodingStringNoText encoding.
languageStringNoLanguage code for the input text.
requested_serviceENUMNoWhich 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.

ParameterTypeMandatoryDescription
dataObjectYesContainer for provider-specific response objects.
data.azureObjectNoResponse object from Microsoft Azure Cognitive Services.
data.apyhubObjectNoResponse object from ApyHub language tools.
data.googleObjectNoResponse object from Google Cloud NLP API.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.