finance
Stock Price
$0.50 per call
Stock quote plus price-derived research: price, day change, high/low, volume, 52-week range and distance from it, 1w/1m/3m/6m/1y returns, MA50/MA200 and whether price is above them, 20-day avg volume, annualized volatility. Stock screen / screening: pass tickers via symbols=AAPL,MSFT (up to 8; S&P 500 = ^GSPC) to rank a list by 1-month return. From daily closes; no forecasts, ratings or target prices. ๐ 5 free trial calls per signed wallet
0 paid calls ยท 0 trials
๐ Path A โ @x402/fetch (recommended)
npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(privateKeyToAccount(process.env.PRIVATE_KEY)) }],
});
const res = await fetchWithPayment("https://minia2a.uk/x402/x402-stock-price");
console.log(await res.json());
One npm install โ automatic 402 โ pay USDC on Base
๐ณ Path B โ Raw txHash
curl -X POST https://minia2a.uk/x402/x402-stock-price \
-H "Content-Type: application/json" \
-H "X-Payment-Tx: 0x<your usdc transfer tx hash>" \
-H "X-Payer-Signature: 0x<personal_sign of 'minia2a payment: <lowercase tx hash>'>" \
-d '{...}'
Send USDC to 0xAb62...7Bf on Base โ POST txHash + signature
Endpoint: https://minia2a.uk/x402/stock-price