← Arendustööriistad

Voo teemad ja filtrid

GET /stream/topics

Kuva all 14 available streaming topics with descriptions, update frequencies, and supported filters. Each topic can be filtered to specific items (nt crypto:bitcoin, electricity:NO1, exchange_rates:EUR/USD). Also shows JavaScript EventSource and curl usage examples.

Näidispäringud

Põhikasutus
curl https://nordapi.ee/api/v1/stream/topics

Reaalajas vastus

{
  "filter_examples": {
    "commodities:gold": "Only gold price updates",
    "crypto:ETH": "Only Ethereum updates",
    "crypto:bitcoin": "Only Bitcoin price updates",
    "earthquakes:5.0": "Only magnitude 5.0+ earthquakes",
    "electricity:NO1": "Only Oslo zone electricity",
    "electricity:SE3": "Only Stockholm zone",
    "exchange_rates:EUR/USD": "Only EUR/USD rate changes",
    "exchange_rates:NOK": "Any pair involving Norwegian Krone",
    "sports:eng.1": "Only Premier League scores"
  },
  "success": true,
  "topics": {
    "commodities": {
      "description": "Gold, silver, oil, and other commodity price updates",
      "filters": "Commodity name (e.g. commodities:gold)",
      "update_frequency": "Daily at 16:00 UTC"
    },
    "crypto": {
      "description": "Cryptocurrency price updates for 250+ coins",
      "filters": "Coin ID or symbol (e.g. crypto:bitcoin or crypto:ETH)",
      "update_frequency": "Every 10 minutes"
    },
    "currencies": {
      "description": "Currency list updates (when new currencies are added)",
      "filters": "Currency code (e.g. currencies:USD)",
      "update_frequency": "Daily at 16:30 CET"
    },
    "earthquakes": {
      "description": "Earthquake alerts above magnitude threshold",
      "filters": "Minimum magnitude (e.g. earthquakes:5.0)",
      "update_frequency": "Real-time from USGS"
    },
    "economics": {
      "description": "Economic indicator updates (GDP, inflation, PPP, etc.)",
      "filters": "Country code (e.g. economics:US)",
      "update_frequency": "On demand / when World Bank data refreshes"
    },
    "electricity": {
      "description": "Nordic electricity spot prices (Norway NO1-NO5, Sweden SE1-SE4)",
      "filters": "Zone code (e.g. electricity:NO1 or electricity:SE3)",
      "update_frequency": "Hourly"
    },
    "exchange_rates": {
      "description": "Exchange rate updates for 30 currencies",
      "filters": "Currency pair (e.g. exchange_rates:EUR/USD or exchange_rates:NOK)",
      "update_frequency": "Daily at 16:30 CET"
    },
    "holidays": {
      "description": "Public holiday data updates",
      "filters": "Country code (e.g. holidays:NO)",
      "update_frequency": "Yearly (January 1st)"
    },
    "nasa": {
      "description": "New NASA Astronomy Picture of the Day and asteroid alerts",
      "filters": "Type (e.g. nasa:apod or nasa:asteroids)",
      "update_frequency": "Daily (APOD), real-time (asteroids)"
    },
    "news": {
      "description": "Trending stories from Hacker News, Wikipedia featured content",
      "filters": "Source (e.g. news:hackernews or news:wikipedia)",
      "update_frequency": "Hourly"
    },
    "space_weather": {
      "description": "Solar flare alerts, geomagnetic storm warnings, Kp index changes",
      "filters": "Event type (e.g. space_weather:flare or space_weather:kp)",
      "update_frequency": "As events occur"
    },
    "sports": {
      "description": "Live sports score updates",
      "filters": "League (e.g. sports:nfl or sports:eng.1)",
      "update_frequency": "During live games"
    },
    "vat": {
      "description": "EU/EEA VAT rate updates",
      "filters": "Country code (e.g. vat:DE)",
      "update_frequency": "Monthly (1st of month)"
    },
    "weather": {
      "description": "Significant weather alerts and updates",
      "filters": "City name (e.g. weather:oslo)",
      "update_frequency": "As conditions change"
    }
  },
  "usage": {
    "basic": "GET /api/v1/stream?topics=crypto,electricity",
    "curl": "curl -N \"https://nordapi.ee/api/v1/stream?topics=crypto:bitcoin\"",
    "filtered": "GET /api/v1/stream?topics=crypto:bitcoin,electricity:NO1",
    "javascript": "const es = new EventSource('/api/v1/stream?topics=crypto'); es.onmessage = e => console.log(JSON.parse(e.data));",
    "reconnect": "Include Last-Event-ID header to resume from where you left off",
    "with_heartbeat": "GET /api/v1/stream?topics=crypto&heartbeat=15"
  }
}