---
title: AI Text Sentiment Analysis API
slug: analyze-text-sentiment
url: https://apyhub.com/apyhub/service/analyze-text-sentiment
provider: ApyHub
categories: [Model Kit]
tags: [sentiment-analysis, text-classification, nlp, customer-feedback, opinion-mining]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 1
atoms: 500
mcp: true
alias: ai-text-sentiment-analysis
---

# AI Text Sentiment Analysis API

Run sentiment analysis on text through ApyHub, Azure, or Google. Send text plus optional language settings and get provider-specific scoring back.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/analyze-text-sentiment` | What it does Analyzes the sentiment of the submitted text. The request body must include text, and… | 500 |

## Endpoint reference

### Analyze text sentiment

`POST https://api.eu.apyhub.com/apyhub/analyze-text-sentiment` · 500 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `text` | body | string | yes | Example: `I absolutely love this new feature!`. |
| `azure.key` | body | string | no | Azure subscription key. Example: `your_azure_speech_or_vision_key`. |
| `azure.region` | body | string | no | Azure service region. Example: `westus2`. |
| `azure.endpoint` | body | string | no | Azure endpoint URL. Example: `https://westus2.api.cognitive.microsoft.com/`. |
| `azure.account_id` | body | string | no | Azure account ID. Example: `account-id-1234`. |
| `azure.access_token` | body | string | no | OAuth access token for Azure service. Example: `access_token_value`. |
| `google.google_language` | body | string | no | Target language locale. Example: `en`. |
| `google.google_credential_json.type` | body | string | no | Example: `service_account`. |
| `google.google_credential_json.auth_uri` | body | string | no | Example: `https://accounts.google.com/o/oauth2/auth`. |
| `google.google_credential_json.client_id` | body | string | no | Example: `123456789012345678901`. |
| `google.google_credential_json.token_uri` | body | string | no | Example: `https://oauth2.googleapis.com/token`. |
| `google.google_credential_json.project_id` | body | string | no | Example: `my-project-id`. |
| `google.google_credential_json.private_key` | body | string | no | Example: `-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQ.…`. |
| `google.google_credential_json.client_email` | body | string | no | Example: `service-account@my-project-id.iam.gserviceaccount.com`. |
| `google.google_credential_json.private_key_id` | body | string | no | Example: `key-id-12345`. |
| `google.google_credential_json.universe_domain` | body | string | no | Example: `googleapis.com`. |
| `google.google_credential_json.client_x509_cert_url` | body | string | no | Example: `https://www.googleapis.com/robot/v1/metadata/x509/service-account%40my-project-…`. |
| `google.google_credential_json.auth_provider_x509_cert_url` | body | string | no | Example: `https://www.googleapis.com/oauth2/v1/certs`. |
| `encoding` | body | string | no | Example: `UTF8`. |
| `language` | body | string | no | Example: `en`. |
| `requested_service` | body | string | no | One of: azure, google, apyhub. Default: `apyhub`. Example: `apyhub`. |

#### Quickstart

Send the text you want analyzed in a JSON request body.

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

#### What you'll get back

Returns a JSON object with a `data` object field. The `data` object may include `azure`, `apyhub`, and `google` response objects, depending on the service used.

```json
{
  "data": {
    "azure": {},
    "apyhub": {},
    "google": {}
  }
}
```

## About

## What it does
Text Sentiment Analyzer lets you send a text string and get sentiment analysis back from one of three providers: ApyHub, Azure, or Google. Use it when you need to classify customer feedback, scan reviews, or triage support messages by tone.

The request body requires `body.text`. You can also include `body.encoding`, `body.language`, and `body.requested_service` to choose the provider and describe the text. If you want to run it against your own cloud account, the schema also supports provider-specific credentials under `body.azure` or `body.google`.

The response returns a `data` object with a provider-specific result under `azure`, `apyhub`, or `google`, depending on which service you requested. The schema does not expose a fixed sentiment label or score here, so plan to handle the provider response structure directly.

Use Text Sentiment Analyzer for moderation workflows, survey analysis, or any pipeline where you need a machine-readable pass on opinionated text without building your own NLP layer.

| Provider (requested_service) | Atoms |
|------------------------------|------:|
| Azure                        |   500 |
| Google                       |  500 |
| ApyHub                       |  2000 |

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/analyze-text-sentiment
