WebSocket - NAV

The WebSocket endpoint returns a WebSocket connection that can receive real-time updates on the NAV values for a specific instrument.

The endpoint accepts all three frequencies of symbols: daily, hourly and real-time .

You should pass the symbol of the index that you want to receive updates in the path.

The endpoint also requires an API key passed as a query parameter token for authentication.

The schema of the received data is the same for the corresponding REST endpoints. This means that if you request a real-time feed for the symbol "btc-usd-p-r" you receive the requested data on the same schema described here. The same holds for hourly and daily frequencies, their schema is the same in the WebSocket endpoint as the corresponding REST endpoint.

URL Pattern:

wss://www.vinterapi.com/ws/nav/{symbol}/?token={your_secret_token}

Example URL for Symbol: vnfa-btca-15-h

wss://www.vinterapi.com/ws/nav/vnfa-btca-15-h/?token={your_secret_token}

Python code example:

# https://websocket-client.readthedocs.io/en/latest/examples.html

import websocket 
def on_message(wsapp, message):
    print(message)

url = f"wss://www.vinterapi.com/ws/nav/vnfa-btca-15-h/?token={your_secret_token}"
wsapp = websocket.WebSocketApp(url, on_message=on_message)
wsapp.run_forever()

Last updated