உள்ளடக்கத்திற்குச் செல்லவும்
The Consortium

Risks Index APIOperational

GET_v1_changes_stream

Change feed as Server-Sent Events

Request

முயன்று பாருங்கள்

Available · No credits

https://api.risksindex.com

GET/v1/changes/stream

curl -s "https://api.risksindex.com/v1/changes/stream"
const res = await fetch("https://api.risksindex.com/v1/changes/stream");
const { data, meta } = await res.json();
import json, urllib.request

req = urllib.request.Request("https://api.risksindex.com/v1/changes/stream")
with urllib.request.urlopen(req) as res:
    answer = json.load(res)

The events of /v1/changes pushed as text/event-stream (id, event: change, one CloudEvent JSON line). Resume with Last-Event-ID (or ?lastEventId=); a stream ends after 5 minutes with retry: 3000 and the client reconnects. event: gap says the last id is no longer held; read /v1/changes for the span. Filters: since, type, subject. Availability: Available.

Parameters

Parameters

  • qoptional

    query · string

    Search terms over the event type and subject

  • sinceoptional

    query · string

    ISO date YYYY-MM-DD: events on or after it

  • typeoptional

    query · string

    Comma-separated event types, for example index.hazard.updated

  • subjectoptional

    query · string

    A UNI, e.g. index:indicator/: the history of one record

Answers

Responses

  • 200

    Server-Sent Events: one CloudEvent per event: change frame

  • 304

    Not modified: If-None-Match matched the snapshot digest

  • 401

  • 404Problem, RFC 9457

    Not found. Codes: NOT_FOUND

  • 414

  • 429Problem, RFC 9457

    Rate limited. Codes: RATE_LIMITED

  • 500Problem, RFC 9457

    Internal error. Codes: INTERNAL

Get started

Get a key with a free account, or choose who the account is for, its seats and any council, and see your workstation first.