← Arendustööriistad

Reaalajas andmevoog (SSE)

GET /stream

Ühenduge to a Server-Sent Events stream for reaalajas push updates. Subscribe to broad topics or filter to specific items using the topic:filter syntax. Events include unique IDs for reconnection (pass Last-Event-ID header to resume). Heartbeat keeps the connection alive. Use curl -N or JavaScript EventSource. 14 topics available: vahetuskursid, crypto, electricity, commodities, economics, holidays, weather, earthquakes, space weather, NASA, sports, news, VAT, and currencies.

Parameetrid

teemad kohustuslik

Comma-separated subscriptions with optional filters (e.g. crypto:bitcoin,electricity:NO1)

südamelöök valikuline vaikeväärtus: 30

Heartbeat interval in seconds (5-300)

Näidispäringud

Põhikasutus
curl -N "https://nordapi.ee/api/v1/stream?topics=crypto:bitcoin,electricity:NO1"
Only Bitcoin price updates
curl -N "https://nordapi.ee/api/v1/stream?topics=crypto:bitcoin"
Only Oslo electricity zone
curl -N "https://nordapi.ee/api/v1/stream?topics=electricity:NO1"
EUR/USD and gold
curl -N "https://nordapi.ee/api/v1/stream?topics=exchange_rates:EUR/USD,commodities:gold"
All Nordic electricity with fast heartbeat
curl -N "https://nordapi.ee/api/v1/stream?topics=electricity&heartbeat=15"
Everything crypto and commodities
curl -N "https://nordapi.ee/api/v1/stream?topics=crypto,commodities"
NOK exchange rates only
curl -N "https://nordapi.ee/api/v1/stream?topics=exchange_rates:NOK"

Reaalajas vastus

See on Server-Sent Events (SSE) voogedastuse lõpp-punkt. See hoiab ühendust avatuna ja edastab sündmusi reaalajas.

Proovige käsuga:
  curl -N "https://nordapi.ee/stream?topics=crypto:bitcoin"