https://github.com/yahoofinancelive/yliveticker
Get market data from Yahoo Finance websocket in near-real time.
https://github.com/yahoofinancelive/yliveticker
financial-data livedata market-data stock-market yahoo-finance
Last synced: 1 day ago
JSON representation
Get market data from Yahoo Finance websocket in near-real time.
- Host: GitHub
- URL: https://github.com/yahoofinancelive/yliveticker
- Owner: yahoofinancelive
- License: mit
- Created: 2020-05-24T23:48:44.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-02T18:42:51.000Z (almost 4 years ago)
- Last Synced: 2025-04-18T17:00:40.417Z (22 days ago)
- Topics: financial-data, livedata, market-data, stock-market, yahoo-finance
- Language: Python
- Size: 68.4 KB
- Stars: 152
- Watchers: 8
- Forks: 32
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-quant - yliveticker - Live stream of market data from Yahoo Finance websocket. (Python / Data Sources)
README


# Live from Yahoo FinanceGet market data from Yahoo Finance websocket in near-real time.
wss://streamer.finance.yahoo.com/## Setup
```bash
pip install yliveticker
```
[pypi package home](https://pypi.org/project/yliveticker/)## Example
The following snippet prints out live metrics in console output. You can follow other symbols by providing them in `ticker_names`.
```python
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*