agentsvc.io

services / stock-prices

financeoperational · 152 ms

Stock Price Lookup

Real-time stock data via Yahoo Finance. Returns price, change, change_pct, previous_close, market_cap, pe_ratio, week_52_high, week_52_low, volume, and market_state. Max 10 symbols per call. Non-US exchange suffixes: 'SAP.DE' (Xetra), 'VOD.L' (London LSE), 'AIR.PA' (Paris Euronext), 'ASML.AS' (Amsterdam).

Run free trial ↗3 free calls per day with the example input. Paid: $0.002 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/stock-prices", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"symbols":["AAPL","MSFT"]}),
});
const { data, payment } = await res.json();  // payment.transaction = on-chain receipt

Input

FieldTypeDescription
symbols *arrayList of stock ticker symbols. Max 10 per call. Examples: ['AAPL', 'MSFT', 'NVDA'] for US stocks, ['SAP.DE', 'BAYN.DE'] for German XETRA stocks, ['TSLA', 'GOOGL', 'AMZN']. Use the exchange suffix for non-US stocks (e.g. .DE, .L, .PA).

Output

FieldTypeDescription
stocksobjectMap of ticker symbol → stock data
not_foundarraySymbols that could not be resolved
fetched_atstringISO 8601 timestamp
sourcestringAlways: 'Yahoo Finance'

Example response (data)

{
  "stocks": {
    "AAPL": {
      "symbol": "AAPL",
      "name": "Apple Inc.",
      "exchange": "NMS",
      "currency": "USD",
      "price": 260.49,
      "change": 1.59,
      "change_pct": 0.61,
      "previous_close": 258.9,
      "open": 259.5,
      "day_high": 261.2,
      "day_low": 258.75,
      "volume": 48200000,
      "market_cap": 3910000000000,
      "pe_ratio": 32.4,
      "week_52_high": 273.59,
      "week_52_low": 169.21,
      "market_state": "REGULAR"
    },
    "MSFT": {
      "symbol": "MSFT",
      "name": "Microsoft Corporation",
      "exchange": "NMS",
      "currency": "USD",
      "price": 373.07,
      "change": 1.43,
      "change_pct": 0.38,
      "previous_close": 371.64,
      "market_state": "REGULAR"
    }
  },
  "not_found": [],
  "fetched_at": "2026-04-10T14:00:00.000Z",
  "source": "Yahoo Finance"
}