Skip to content

Get market data from Yahoo Finance websocket in near-real time.

License

Notifications You must be signed in to change notification settings

yahoofinancelive/yliveticker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python package Upload Python Package

Live from Yahoo Finance

Get market data from Yahoo Finance websocket in near-real time. wss://streamer.finance.yahoo.com/

Setup

pip install yliveticker

pypi package home

Example

The following snippet prints out live metrics in console output. You can follow other symbols by providing them in ticker_names.

import yliveticker


# this function is called on each ticker update
def on_new_msg(ws, msg):
    print(msg)


yliveticker.YLiveTicker(on_ticker=on_new_msg, ticker_names=[
    "BTC=X", "^GSPC", "^DJI", "^IXIC", "^RUT", "CL=F", "GC=F", "SI=F", "EURUSD=X", "^TNX", "^VIX", "GBPUSD=X", "JPY=X", "BTC-USD", "^CMC200", "^FTSE", "^N225"])

Note Check trading hours for your market if you don't observe any live metrics