Crypto Sentiment X402

io.github.whatevercat-creator由 GitHub 帳號 whatevercat-creator 發布v0.1.7更新於 Nov 8, 2026

Crypto news sentiment for 24 coins: label, score and headlines behind it, paid per call via x402

已驗證STDIO僅桌面金融資料與分析

概覽

AI 產生的概覽

讓助理取得 24 個加密貨幣代號的新聞情緒讀數與逐小時歷史,並以 Base 上的 USDC 從 CDP 錢包按次付費。

可以做什麼
  • 列出支援的 24 個代號與名稱,並查看逐小時情緒封存中各幣種的涵蓋情況。
  • 從未付款的 402 回應讀取情緒呼叫的即時 x402 價格。
  • 取得單一代號的目前情緒讀數,依據 9 家加密新聞來源與恐懼與貪婪指數、涵蓋 72 小時,並附上支撐結論的標題。
  • 依指定日期範圍取回某幣種過去的逐小時情緒讀數,由舊到新排列。
適用情境
適合助理需要快速且有來源的加密市場情緒或其短期歷史,且使用者願意按次支付少量 USDC 的情境。可先用免費工具查看涵蓋範圍與價格再決定。
執行需求
透過 uvx 在本機執行(Python)。三個免費工具無需任何設定。付費工具需要 Coinbase Developer Platform 的 CDP_API_KEY_ID 與 CDP_API_KEY_SECRET、一個持有 USDC 及少量 ETH 作為 gas 的 CDP 錢包,以及存取情緒 API 的網路(SENTIMENT_API_URL,預設為託管端點)。X402_NETWORK 選擇 mainnet 或 testnet。
安裝前請注意
付費工具預設在 Base 主網花費真實 USDC:情緒呼叫每次 0.01 美元,歷史呼叫每次 0.05 美元,由伺服器自己的 CDP 錢包簽署付款。需要 CDP API 金鑰憑證與已儲值的錢包;將 X402_NETWORK 設為 testnet 可避免真實支出。情緒資料來自第三方新聞來源與恐懼與貪婪指數,請求會送往所設定的 SENTIMENT_API_URL。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Crypto Sentiment X402,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Crypto Sentiment API (x402)

Pay-per-call crypto sentiment API for AI agents. No API keys, no subscriptions — agents discover it, get an HTTP 402, pay in USDC on Base, and get the data.

Sentiment sources (all free, no keys required):

  • Crypto news RSS (9 outlets) — CoinDesk, Cointelegraph, Decrypt, Bitcoin Magazine, The Block, CryptoSlate, NewsBTC, CryptoPotato, The Defiant (DL News was removed on 2026-10-04: its feed served only April-May 2026 items)
  • Fear & Greed Index — alternative.me

Scoring: VADER sentiment analysis, extended with a crypto slang lexicon (moon, rekt, rug, hodl, bullish/bearish, etc.) so slang isn't scored as neutral. Each headline is matched and scored on its title plus its feed description with HTML tags, entities, feed footers and the outlet's own name removed (clean_text in app/sources/news.py; method 72h-hl24-v2 from 2026-10-21). Only headlines published in the last 72 hours count, and each headline's weight halves for every 24 hours of age (app/window.py). When the effective sample size is below 5, the label is insufficient recent news.


1. Get a Base wallet address

You need an address to receive USDC payments. Any standard Ethereum-style wallet works on Base (e.g. Coinbase Wallet, MetaMask configured for Base). You do not need to give this app your private key — only the public address, to receive funds.

2. Run it locally (testnet — free, no real money)

bash
cd crypto-sentiment-x402cp .env.example .env# edit .env and set PAY_TO_ADDRESS to your wallet addresspip install -r requirements.txtuvicorn app.main:app --reload

Visit http://localhost:8000 — you'll see the API description. Calling http://localhost:8000/sentiment/BTC without payment returns an HTTP 402 with payment instructions, exactly what an agent's x402 client would see and act on automatically.

To actually test a paid call, use the official x402 test client (needs Base Sepolia testnet USDC — free from the Base Sepolia faucet):

bash
pip install x402python -m x402.examples.client --url http://localhost:8000/sentiment/BTC

3. Deploy (simplest path: Render.com)

  1. Push this folder to a new GitHub repo.
  2. Go to render.com → New → Blueprint → connect the repo. Render will read render.yaml automatically.
  3. When prompted, set the PAY_TO_ADDRESS environment variable to your wallet address.
  4. Deploy. Render builds the Dockerfile and gives you a public HTTPS URL like https://crypto-sentiment-x402.onrender.com.

That's it — testnet mode is on by default, so nothing costs real money until you flip X402_NETWORK to mainnet (step 4 below).

4. Go live with real USDC payments

  1. Sign up for a free Coinbase Developer Platform account and create an API key — this is required for the mainnet facilitator (production-grade payment verification/settlement).
  2. In Render, set:
    • X402_NETWORK=mainnet
    • CDP_API_KEY_ID=...
    • CDP_API_KEY_SECRET=...
    • PAY_TO_ADDRESS = your mainnet Base address (double-check it's not a testnet-only address)
  3. Redeploy. Calls now settle real USDC on Base mainnet.

Start with a low price (X402_PRICE_USD, default $0.01) while you validate everything works end-to-end.

5. List it so AI agents can find and pay you

This is the x402 Bazaar — Coinbase's discovery layer, essentially a search engine for agents looking for x402 services.

  • If you're using the CDP facilitator (i.e. you're on mainnet per step 4), your service becomes automatically discoverable in the Bazaar once you process your first real payment through it — no separate signup.
  • To improve how well agents can find and understand it, keep the description field in app/main.py's RouteConfig clear and specific (already set) — that text is what shows up in Bazaar search results.
  • You can browse the current Bazaar listing yourself at https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources (public, no key needed) to confirm your service appears after going live.
  • Optional extra distribution: submit your API to x402bazaar.org, a community-run directory of x402 services, separate from Coinbase's own Bazaar.

MCP server (Claude Desktop / Claude Code)

Prefer agents calling this over MCP instead of raw HTTP? mcp_server.py wraps the same API as MCP tools (crypto_sentiment, get_hourly_history and three free info tools) -- the server pays for each call from its own CDP-managed wallet, so callers never touch crypto directly. See MCP.md for setup.

Try it free

Three tools need no wallet, no CDP key and pay nothing. The server starts without any CDP variables, so you can install it and try these first:

  • list_supported_coins — the 24 supported ticker symbols and names.
  • archive_coverage — what the hourly archive holds (GET /archive): first reading, row counts and missing hours per symbol.
  • price_quote(symbol) — makes one unpaid request and reads the 402 payment requirements: price, network, asset and the payTo address.

Two tools are paid, from your own CDP wallet in USDC on Base:

  • crypto_sentiment(symbol) — the current reading, $0.01 per call. Unsupported coins and coins with too little recent news are refused and not charged.
  • get_hourly_history(symbol, start, end) — past hourly readings (GET /history/{symbol}), $0.05 per call. Recorded live and never backfilled; start/end are ISO 8601, default the last 7 days, at most 30 days per call. The symbol has to be one archive_coverage lists as logged. Unlogged symbols, invalid ranges and ranges with no readings are refused and not charged.

Wallet setup is in MCP.md.

Subscription tiers (Stripe, no crypto required)

Prefer a monthly bill over pay-per-call USDC? GET /v1/sentiment/{symbol} takes an X-API-Key header instead of an x402 payment, backed by Free / Starter ($15/mo) / Pro ($59/mo) tiers. See BILLING.md for setup, or GET /billing/pricing on a running instance for current pricing.

Sentiment-shift alerts

Watch a symbol and get pinged (webhook / Discord / Telegram) when its sentiment moves, instead of polling /sentiment yourself. Bundled into the Starter/Pro subscription tiers -- see ALERTS.md.

Historical dataset export

Sells access to the history of sentiment readings, not just the current one -- a background job takes one snapshot per symbol per day, and subscribers on the Pro or "Data Access" tier can export everything collected so far as CSV or JSON via GET /dataset/export. See DATASET.md (there's no backfilled history -- it only has data from whenever you turn the snapshot loop on).

Also on RapidAPI

Listed on the RapidAPI Hub for developers who'd rather discover and pay for it through RapidAPI's marketplace instead of Stripe or x402 directly. Same underlying data, served from GET /rapidapi/sentiment/{symbol} -- traffic is only accepted when it's routed through RapidAPI's proxy (validated via a shared secret header), so this endpoint isn't meant to be called directly. Plans there mirror the Stripe tiers: Free (100 req/mo), $15/mo (3,000 req), $59/mo (15,000 req).

Zapier & TradingView integrations

Route sentiment-shift alerts into Zapier (via the existing webhook channel -- no new endpoint needed) or enrich TradingView price alerts with live sentiment before relaying them to your webhook/Discord/ Telegram. See INTEGRATIONS.md.

API reference

EndpointPriceDescription
GET /FreeService info
GET /healthFreeHealth check
GET /sentiment/{symbol}$0.01 (configurable)Aggregate sentiment for a symbol, e.g. /sentiment/BTC

Example paid response:

json
{  "symbol": "BTC",  "name": "Bitcoin",  "overall_sentiment": {    "sample_size": 42,    "average_compound": 0.21,    "label": "bullish",    "positive_pct": 55.0,    "negative_pct": 15.0,    "neutral_pct": 30.0,    "unweighted_compound_72h": 0.17,    "effective_sample_size": 31.4,    "newest_headline_age_hours": 1.6,    "window": "72h-hl24-v2"  },  "drivers": [{ "title": "...", "source": "CoinDesk", "link": "https://...", "published": "...", "score": 0.62, "weight": 0.93, "effect": 0.03 }],  "drivers_summary": "3 of the top 5 headlines are positive, 2 are negative.",  "breakdown": {    "news": { "...": "..." },    "fear_greed_index": { "value": 62, "classification": "Greed" }  },  "sources": ["coindesk.com RSS", "..."]}

Notes and limitations

  • Reddit was removed as a source: Reddit's Responsible Builder Policy prohibits commercial use of their data without written approval, which this paid API would violate. app/sources/reddit.py is left in the repo unused in case that changes in the future.
  • Coin coverage: app/coins.py has a starter list of ~15 symbols. Add more as needed — unmapped symbols still work, just with slightly less accurate news matching (falls back to matching on the symbol itself).
  • Only supports the exact payment scheme on Base/EVM. The x402 SDK also supports Solana (ExactSvmServerScheme) if you want to accept SOL-based USDC too — see the commented-out import in app/main.py's dependencies.
  • Add more paid endpoints (e.g. historical sentiment, multi-symbol batch queries) by adding entries to the routes dict in app/main.py.

來源:README.md,提交 705e86c

工具

5

crypto_sentiment

Current Crypto Sentiment

Crypto news sentiment for one coin right now: a bullish/bearish/neutral label, a score from -1 to 1, sample sizes, the Fear & Greed value and up to 5 headlines that moved the score. Paid: $0.01 in USDC on Base per call, from this MCP server's own CDP wallet. Use when an agent needs the current news mood for a crypto ticker. Scores headlines from the last 72 hours across 9 crypto news RSS outlets, newest weighted most. For past readings use get_hourly_history. symbol must be exactly one of the 24 uppercase tickers from list_supported_coins (e.g. BTC); any other symbol is rejected by the input schema before a request is sent, so nothing is charged. With too few recent headlines the API refuses with HTTP 422 "insufficient recent news", returned as an error with charged: false (archive_coverage shows each coin's coverage_7d_pct). Without CDP keys the tool returns a no-wallet message and pays nothing.

輸入參數symbol必填

get_hourly_history

Hourly Sentiment History

Historical crypto news sentiment for one coin: hourly readings (score, sample size, Fear & Greed and the top headlines for each hour), oldest first. Paid: $0.05 in USDC on Base per call, from this MCP server's own CDP wallet. Use when an agent needs how a coin's news sentiment moved over past hours or days, e.g. to line it up with price. For the current reading use crypto_sentiment. Range: omit both bounds for the 7 days up to now. With only end, the range starts 7 days before it; with only start, it runs to now. A reading is included when start <= observed_at < end. The span can be at most 30 days, so split longer periods into several calls. Readings are recorded live at the top of each UTC hour and never backfilled; a missed hour stays missing. Refused and not charged (returned as an error with charged: false): - 400: malformed symbol or time, start not before end, or a span over 30 days. - 404: symbol not in the archive. - 404 no_readings_in_range: no readings in the range (gives first_reading). - 404 no_headlines_in_range: every hour in the range had zero matching headlines (gives rows_in_range and coverage_7d_pct). A range with at least one hour of headlines returns all its rows. For low-coverage coins, check archive_coverage first: its coverage_7d_pct and first_reading show where data exists. Without CDP keys the tool returns a no-wallet message and pays nothing.

輸入參數endstartsymbol必填

list_supported_coins

List Supported Coins

The 24 crypto tickers (symbol and name) that crypto_sentiment and price_quote accept. Free: no wallet needed and no network call. Use when choosing a symbol before calling crypto_sentiment or price_quote. The coin list is fixed per release: new coins come with a new version of this package, never while the server runs. Any other symbol is rejected by those tools' input schema before a request is sent, so nothing is charged.

無需輸入參數。

archive_coverage

Archive Coverage

Free: what the hourly sentiment archive holds (GET /archive). No wallet needed. Per symbol: first and latest reading, row counts, missing hours, and coverage_7d_pct, the share of the last 7 days' logged hours that had at least one matching headline (with hours_with_headlines_7d and hours_logged_7d). Check it before get_hourly_history to pick a symbol and range with data: low-coverage coins often get no_headlines_in_range from get_hourly_history or "insufficient recent news" from crypto_sentiment, both refused and not charged.

無需輸入參數。

price_quote

Price Quote

Free: the live x402 price of one crypto_sentiment call, read from an unpaid request's 402 response. Nothing is signed; no wallet needed. When not to use it: prices are fixed at $0.01 per crypto_sentiment call and $0.05 per get_hourly_history call, so there's no need to call this before every paid call. Use it to confirm the live price and payment requirements, e.g. before funding a wallet. It quotes crypto_sentiment only. symbol must be exactly one of the 24 uppercase tickers from list_supported_coins; lowercase or any other symbol is rejected by the input schema before a request is sent. A low-coverage coin still gets a quote; a crypto_sentiment call for it may then be refused with "insufficient recent news" (not charged).

輸入參數symbol必填

版本歷史

5
  1. v0.1.6Oct 26, 2026
  2. v0.1.4Oct 21, 2026
  3. v0.1.2Oct 16, 2026
  4. v0.1.1Oct 5, 2026
  5. v0.1.0Sep 23, 2026

評分

已滿足適用檢查項的 80%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。