Approximate Twitter/X sentiment for any search query, paid per call with USDC on Base.
What it does
The `/api/twitter-sentiment` endpoint on httpay.xyz returns an approximate Twitter/X sentiment analysis for a given query term. It works by performing a web search to gather recent Twitter/X mentions and then summarizing the overall sentiment. This is useful for gauging market mood, public opinion on crypto tokens, or general social media sentiment around any topic.
The endpoint is an x402 pay-per-call API costing $0.02 per request (20,000 base units of USDC on Base, 6 decimals). No API keys or subscriptions are required — callers authenticate solely via an on-chain USDC micropayment included in the request header. The endpoint also supports MPP (Machine Payments Protocol) settlement via pathUSD on Tempo at $0.02 per call. A free demo mode is available by appending `?demo=true` to the URL (limited to 10 calls per IP per hour).
The endpoint accepts HTTP GET requests with a `query` parameter (e.g., `?query=ethereum`). The response is JSON. However, the output schema provided in the x402 challenge is minimal — it only includes a description string as an example, so the exact response structure (sentiment score, breakdown, source snippets, etc.) is not documented. The httpay.xyz docs page returns a 404, so no additional documentation is available beyond the landing page and the x402 challenge metadata.
Capabilities
Use cases
- —Gauge public sentiment on a cryptocurrency or token before trading decisions
- —Monitor brand or product perception on Twitter/X in near real-time
- —Feed social sentiment signals into an autonomous trading agent
- —Quickly assess community mood around a protocol launch or governance proposal
- —Add Twitter sentiment context to news aggregation pipelines
Fit
Best for
- —AI agents that need on-demand social sentiment without managing API keys
- —Crypto traders wanting quick market mood checks via micropayments
- —Developers prototyping sentiment-aware applications without subscription commitments
Not for
- —High-volume, continuous Twitter monitoring (pay-per-call at $0.02 adds up quickly)
- —Applications requiring raw tweet data or full Twitter API access
- —Use cases needing precise NLP scores with documented methodology
Quick start
# Free demo (10 calls/IP/hour):
curl "https://httpay.xyz/api/twitter-sentiment?query=ethereum&demo=true"
# Paid via x402 SDK:
import { withPayment } from "x402-fetch";
const res = await withPayment(
fetch("https://httpay.xyz/api/twitter-sentiment?query=ethereum"),
wallet
);
console.log(await res.json());Example
Response
{
"description": "Approximate Twitter/X sentiment for a query via web search"
}Endpoint
Quality
The endpoint is live (402 challenge captured) with clear pricing and payment details, but the output schema is essentially a stub — only a description string is shown as an example. No docs page exists (404), and query parameters are listed as an empty object in the schema. The actual response format must be inferred.
Warnings
- —Output schema is minimal — only contains a description string; actual response fields are undocumented
- —No dedicated docs page available (httpay.xyz/docs returns 404)
- —Query parameters not formally defined in the schema (empty queryParams object); ?query= usage inferred from landing page example only
- —Sentiment methodology is unspecified — described only as 'approximate' via web search
Citations
- —Endpoint costs $0.02 per call (maxAmountRequired 20000 USDC base units on Base)https://httpay.xyz/api/twitter-sentiment
- —Free demo mode available with ?demo=true, limited to 10 calls/IP/hourhttps://httpay.xyz
- —Endpoint described as 'Approximate Twitter/X sentiment for any query. Great for market mood analysis.' with ?query=ethereum examplehttps://httpay.xyz
- —httpay.xyz hosts 307 pay-per-call endpoints on Base with USDChttps://httpay.xyz
- —Also supports MPP settlement via pathUSD on Tempo at $0.02https://httpay.xyz/api/twitter-sentiment