# Twitter / X Sentiment Analysis API

> Twitter / X Sentiment Analysis API is a paid API for AI agents from x402.agentutility.ai, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-14).

Analyzes recent Twitter/X posts for a given topic or keyword, returning sentiment scores, polarity, volume metrics, and sample post context

## Facts

- Endpoint: POST https://x402.agentutility.ai/twitter-sentiment-api
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/twitter-x-sentiment-analysis-api-3334a999
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_eKbwUf8uwQIaAnO7VRREJ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability twitter-x-sentiment-analysis-api-3334a999 -d '<json body>'
```

Example prompt: Pull the latest Twitter sentiment for 'OpenAI' — I want the overall polarity score, whether it's trending positive or negative, the approximate post volume, and a few sample tweets driving the sentiment.

## When to prefer this

Choose this endpoint when you need real-time or near-real-time social sentiment from Twitter/X specifically, including polarity scoring, volume metrics, and post-level context. Prefer it over generic NLP sentiment APIs when the source data must be live X posts rather than user-supplied text. Useful for trading signals, brand monitoring, event tracking, or any use case where public Twitter opinion is the input.

## Known failure modes

- X API credentials not configured or expired — returns an auth/configuration error
- Rate limit exceeded on the underlying X API — returns a 429 or quota error
- Query too broad or no recent posts found — returns empty or zero-volume result
- Invalid or overly long query string — returns a validation error
- Temporary X API outage — returns a service unavailable error

## How this service works

Twitter sentiment API / X sentiment analysis / social sentiment endpoint. Same X-backed handler as social-sentiment, listed for agents searching recent posts and scoring sentiment, polarity, volume, and sample post context when X API credentials are configured.

## Output

Returns an aggregate sentiment score (e.g. -1.0 to +1.0), polarity label (positive/negative/neutral), estimated post volume for the queried topic, and a selection of sample posts that contributed to the score. Requires X API credentials to be configured on the provider side.

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "query": "x402 payments",
  "sentiment": "positive",
  "sample_size": 10
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/twitter-x-sentiment-analysis-api-3334a999/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentutility.ai](https://www.zero.xyz/host/x402.agentutility.ai/llms.txt)
