1) Set your environment
2) Verify connectivity
/health is public and does not require auth.
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Make your first request to the Monetary Public API
export MONETARY_API_BASE_URL="https://api.monetary.dev"
export MONETARY_API_TOKEN="<your_api_token>"
/health is public and does not require auth.
curl -sS "$MONETARY_API_BASE_URL/health"
{
"result": [{ "ok": 1 }],
"status": "ok",
"uptime": 1234.56
}
curl -sS "$MONETARY_API_BASE_URL/v1/companies?query=nvidia&limit=5" \
-H "Authorization: Bearer $MONETARY_API_TOKEN" \
-H "Accept: application/json"
curl -sS "$MONETARY_API_BASE_URL/v1/prediction_markets/events?provider=kalshi&status=open&limit=10" \
-H "Authorization: Bearer $MONETARY_API_TOKEN" \
-H "Accept: application/json"
const baseUrl = process.env.MONETARY_API_BASE_URL;
const token = process.env.MONETARY_API_TOKEN;
const response = await fetch(
`${baseUrl}/v1/prediction_markets/markets?provider=polymarket&limit=20`,
{
headers: {
Accept: "application/json",
Authorization: `Bearer ${token}`,
},
},
);
if (!response.ok) {
const err = await response.json();
throw new Error(err.message ?? "Request failed");
}
const payload = await response.json();
console.log(payload.data.length);
const ws = new WebSocket("ws://127.0.0.1:3001/ws");
ws.addEventListener("open", () => {
ws.send(JSON.stringify({
action: "subscribe",
channels: ["events", "markets", "trades"],
}));
});