# X Twitter Sentiment Analysis API

> X Twitter 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-10-15).

Searches recent public X (Twitter) posts for a query and returns per-tweet sentiment scores plus aggregate positive/neutral/negative distribution and average score

## Facts

- Endpoint: POST https://x402.agentutility.ai/twitter-sentiment?utm_source=zero.xyz
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x-twitter-sentiment-analysis-api-ca1cb698
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WGDXu10E6UQxORkQelmZT

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 x-twitter-sentiment-analysis-api-ca1cb698 -d '<json body>'
```

Example prompt: Can you search recent tweets about 'Bitcoin halving' and give me a sentiment breakdown — how many are positive, neutral, or negative, and what's the average score? English tweets only, no retweets.

## When to prefer this

Use this endpoint when you need real-time public opinion data from X/Twitter about a specific topic, brand, keyword, or asset — especially for crypto sentiment, brand monitoring, or event reaction analysis. It is read-only and provides both granular per-tweet scores and a high-level aggregate, making it ideal for dashboards or agent decision loops. Prefer this over general web sentiment tools when Twitter-specific public discourse is the signal you need.

## Known failure modes

- Missing or invalid X_BEARER_TOKEN returns authentication error
- Query returns no results for very niche or misspelled search terms
- Rate limits on the underlying X API may cause timeouts or partial results
- Language filter may reduce result set to zero if the language is underrepresented
- Very short or ambiguous queries may produce noisy or unreliable sentiment scores

## How this service works

Searches recent public X posts for a query and scores each tweet's sentiment, returning tweet-level scores plus aggregate positive/neutral/negative distribution and average score. Excludes retweets by default with an optional language filter. Requires X_BEARER_TOKEN; read-only, no posting, replying, liking, following, or account mutation. Use it as a Twitter sentiment API, X sentiment API, social sentiment monitor, tweet sentiment analysis, brand sentiment search, or crypto sentiment tracker.

## Output

Returns a list of matched tweets each with an individual sentiment score, plus an aggregate summary showing the percentage of positive, neutral, and negative tweets and the overall average sentiment score across the result set.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "query"
     ],
     "properties": {
      "query": {
       "type": "string",
       "description": "X recent-search query, e.g. 'x402 payments' or '(coinbase OR bankr) x402'."
      },
      "language": {
       "type": "string",
       "description": "Optional two-letter language filter, e.g. 'en'."
      },
      "max_results": {
       "type": "number",
       "description": "Number of recent posts to fetch. X API minimum is 10; this endpoint clamps to 10-50. Default 10."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "query": {
       "type": "string"
      },
      "source": {
       "type": "string"
      },
      "distribution": {
       "type": "object",
       "properties": {
        "neutral": {
         "type": "integer"
        },
        "negative": {
         "type": "integer"
        },
        "positive": {
         "type": "integer"
        }
       }
      },
      "result_count": {
       "type": "integer"
      },
      "average_score": {
       "type": "number"
      },
      "overall_sentiment": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "query": "x402 payments",
  "source": "X API v2 recent search + local sentiment lexicon",
  "distribution": {
   "neutral": 5,
   "negative": 1,
   "positive": 4
  },
  "result_count": 10,
  "average_score": 0.22,
  "overall_sentiment": "positive"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x-twitter-sentiment-analysis-api-ca1cb698/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)
