Vinter API
Search
⌃K

Websocket - Multi Assets

The websocket endpoint returns a websocket connection that can be used to receive real-time updates on the index values.
The endpoint accepts all three frequencies of symbols: daily, hourly and real-time.
The symbol of the index that you want to receive updates on should be passed in the path.
The endpoint also requires an API key passed as a query parameter token for authentication.

URL Pattern:

wss://www.vinterapi.com/ws/multiassets/{symbol}/?token={your_secret_token}
Example URL for Symbol: vntr-eq-5-r
wss://www.vinterapi.com/ws/multiassets/vntr-eq-5-r/?token={your_secret_token}
* The response will match the JSON format with the REST APIs mentioned above.
# 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/multiassets/vntr-eq-5-r/?token={your_secret_token}"
wsapp = websocket.WebSocketApp(url, on_message=on_message)
wsapp.run_forever()