80trust / 100

Prices

by StableFinance in Markets & finance

x402 APIPassing, checked 2 h ago

Historical OHLCV bars for a US stock. Required: ticker, interval (day|week|month|year), start_date (YYYY-MM-DD), end_date (YYYY-MM-DD).

GET https://stablefinance.dev/api/prices

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
295 ms typical, 295 ms slowest 5%
Last check
2 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X GET "https://stablefinance.dev/api/prices?end_date=2024-01-31&interval=day&start_date=2024-01-02&ticker=AAPL"
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fstablefinance.dev%2Fapi%2Fprices
const res = await pay("https://stablefinance.dev/api/prices?end_date=2024-01-31&interval=day&start_date=2024-01-02&ticker=AAPL");
console.log(await res.json());

Example input

{
  "end_date": "2024-01-31",
  "interval": "day",
  "start_date": "2024-01-02",
  "ticker": "AAPL"
}

Example output

{
  "prices": [
    {
      "close": 185.64,
      "high": 188.44,
      "low": 183.89,
      "open": 187.15,
      "time": "2024-01-02",
      "volume": 82488700
    }
  ],
  "ticker": "AAPL"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
2 h agoPassed402354 ms$0.02
5 h agoPassed402261 ms$0.02
10 h agoPassed402295 ms$0.02