Yahoo Finance’dan Anlık Kripto Varlık Verileri Nasıl Çekilir ?

Solidity Programming Language
2 min readJun 2, 2021

--

https://finance.yahoo.com/cryptocurrencies

Öncelikle aşağıdaki kütüphaneleri yüklemiş olmanız gerekiyor.

  • Pandas
  • NumPy
  • Yfinance
  • Plotly

Yükleyelim.

pip install pandas
pip install numpy
pip install yfinance
pip install plotly

Şimdi kütüphaneleri python çalışma sayfamıza çekiyoruz.

import numpy as np
import pandas as pd
import yfinance as yf
import plotly.graph_objs as go

Yahoo Finance API’si sizden 3 bilgi isteyecektir

  • Kripto Varlık (1)
  • Periyod (2)
  • Aralık (3)
https://finance.yahoo.com/cryptocurrencies

Örnek olarak;

  • UNI3-USD
  • Son 10 saat bilgisi
  • 5 dk’lık aralıkla

data = yf.download(tickers=’UNI3-USD’, period = ‘10h’, interval = ‘5m’)

Görüntü Zamanı

fig = go.Figure()

fig.add_trace(go.Candlestick(x=data.index,
open=data[‘Open’],
high=data[‘High’],
low=data[‘Low’],
close=data[‘Close’], name = ‘market data’))

fig.update_layout(
title=’UNI3 DOLAR Paritesi’,
yaxis_title=’UNI3 Fiyatı (Dolar)’)

fig.update_xaxes(
rangeslider_visible=True,
rangeselector=dict(
buttons=list([
dict(count=15, label=”15m”, step=”minute”, stepmode=”backward”),
dict(count=45, label=”45m”, step=”minute”, stepmode=”backward”),
dict(count=1, label=”HTD”, step=”hour”, stepmode=”todate”),
dict(count=6, label=”6h”, step=”hour”, stepmode=”backward”),
dict(step=”all”)
])
)
)

fig.show()

UNI3/$

Not: https://medium.datadriveninvestor.com/python-how-to-get-live-cryptocurrency-data-less-than-0-1-second-lag-7f23d854314a sayfasından çevrilmiştir.

--

--

Solidity Programming Language
Solidity Programming Language

Written by Solidity Programming Language

Solidity basics for beginners: Learn the fundamentals of smart contract development and build your first DApp! #Solidity #Foundry #Ethereum #Opcodes #DApps

No responses yet