Skip to content
Fourohtwo

Get a fresh read-only snapshot of Coinbase Exchange spot markets

api.macaroonnetwork.com/execute/crypto-market-snapshot-v1

Get a fresh read-only snapshot of Coinbase Exchange spot markets: price, bid, ask, mid, spread and 24-hour volume for up to ten products. No account or trading access is used.

BaseAnswering
POSThttps://api.macaroonnetwork.com/execute/crypto-market-snapshot-v1

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://api.macaroonnetwork.com/execute/crypto-market-snapshot-v1", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"input":{"products":["BTC-USD","ETH-USD"]},"predicate":{"conditions":[{"field":"$.status","operator":"eq","type":"field_changed","value":"ok"},{"field":"$.snapshots","type":"count_gte","value":1},{"duration_hours":1,"field":"$.fetched_at","type":"within"},{"field":"$.read_only","operator":"eq","type":"field_changed","value":true},{"field":"$.trading_enabled","operator":"eq","type":"field_changed"),
});
console.log(await res.json());

Example input

{"input":{"products":["BTC-USD","ETH-USD"]},"predicate":{"conditions":[{"field":"$.status","operator":"eq","type":"field_changed","value":"ok"},{"field":"$.snapshots","type":"count_gte","value":1},{"duration_hours":1,"field":"$.fetched_at","type":"within"},{"field":"$.read_only","operator":"eq","type":"field_changed","value":true},{"field":"$.trading_enabled","operator":"eq","type":"field_changed"

More from Macaroon Network