API Access
Pay-per-call access to the Bitcoin Euphoria Score via the x402 protocol
How It Works
The Euphoria Score API uses the x402 protocol for payments. There are no API keys, no accounts, and no subscriptions. You pay per request with USDC on Base, and the payment settles on-chain in seconds.
Any x402-compatible client can call the API. When you make a request, the server responds with HTTP 402 and payment terms. Your client signs a USDC authorization, retries the request with proof of payment, and receives the data. The entire flow happens in a single HTTP round-trip.
Pricing
Current Score
- Composite score (0-100)
- Regime classification
- Plain English interpretation
- Signal levels for all 7 metrics
- Weighted contributions
- Data quality status
Score + History
- Everything in current score
- Historical daily scores
- Up to 365 days of data
- Regime labels per day
Payments settle in USDC on Base. Transaction costs are under $0.001.
Endpoint
?history=trueInclude historical score data ($0.05 tier)?days=90Number of days of history (1-365, default 30)Response
{
"score": 34.3,
"regime": {
"label": "Neutral",
"description": "Market conditions are balanced..."
},
"interpretation": "Market conditions are neutral. Funding,
open interest, and sentiment show balanced activity.",
"timestamp": "2026-03-06T06:07:25.000Z",
"methodologyVersion": "1.0",
"dataQuality": {
"activeMetrics": 7,
"totalMetrics": 7,
"status": "complete"
},
"signals": [
{
"name": "BTC Funding Rate",
"signal": "low",
"weight": 0.2,
"contribution": 5.9,
"available": true
},
...
]
}signal values: extreme elevated moderate low minimal
contribution is how many points each metric adds to the composite score.
Client Setup
Use any x402-compatible client. The simplest option is @x402/fetch which wraps the standard fetch API and handles payment automatically.
import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
const signer = privateKeyToAccount(process.env.PRIVATE_KEY);
const client = new x402Client();
registerExactEvmScheme(client, { signer });
const paidFetch = wrapFetchWithPayment(fetch, client);
// Just fetch like normal - payment is handled automatically
const res = await paidFetch("https://euphoriascore.com/api/v1/score");
const data = await res.json();
console.log(data.score); // 34.3
console.log(data.regime.label); // "Neutral"
console.log(data.interpretation); // "Market conditions are..."
// With history ($0.05)
const history = await paidFetch(
"https://euphoriascore.com/api/v1/score?history=true&days=90"
);Install dependencies:
npm install @x402/fetch @x402/evm viem
Requirements
- Wallet with USDC on Base (for payment signing)
- USDC balance on Base mainnet (minimum $0.01 per call)
- No gas needed for the caller. The x402 facilitator covers transaction gas.
- No API key required. Payment is your authentication.
Use Cases
- AI trading agents that check market conditions before executing
- Portfolio management bots that adjust risk based on euphoria levels
- Dashboards and analytics platforms integrating market regime data
- Alert systems that trigger when the score crosses a threshold
The x402 protocol is open source and maintained by the x402 Foundation. Payments settle on Base via Coinbase Developer Platform.