2022-10-29 20:46:20 +07:00
|
|
|
<h1>Get market data from Yahoo Finance using Selenium</h1>
|
|
|
|
<h2>Requirements:</h2>
|
|
|
|
<ul>
|
|
|
|
<li>Python 3.6 or Python 3.7</li>
|
|
|
|
<li>Pip3</li>
|
|
|
|
<li>Selenium Python</li>
|
|
|
|
<li>Chromium driver binary</li>
|
|
|
|
<li>Jupyter Notebook (optional)</li>
|
|
|
|
</ul>
|
|
|
|
<h2>Example:</h2>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
USD-IDR
|
|
|
|
https://api.gabrielkheisa.xyz/stocks/usdidr/
|
|
|
|
</li>
|
|
|
|
|
2022-10-29 22:19:47 +07:00
|
|
|
<pre>
|
|
|
|
{
|
2022-11-04 22:42:29 +07:00
|
|
|
"price": "15,735",
|
|
|
|
"price_change": "+40.0",
|
|
|
|
"change": "(+0.25%)",
|
|
|
|
"last_update": "As of 03:24PM GMT. Market open.",
|
|
|
|
"server_update": "04-11-2022 22:34:34 GMT+7",
|
|
|
|
"color": "#40ff00",
|
|
|
|
"symbol": "🟢"
|
2022-10-29 22:19:47 +07:00
|
|
|
}
|
|
|
|
</pre>
|
|
|
|
|
2022-10-29 20:46:20 +07:00
|
|
|
<li>
|
|
|
|
Dow Jones Industrial Average SPDR ETF
|
|
|
|
https://api.gabrielkheisa.xyz/stocks/sp500/
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
Nasaq Composite
|
|
|
|
https://api.gabrielkheisa.xyz/stocks/ixic/
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
BTC-USD
|
|
|
|
https://api.gabrielkheisa.xyz/stocks/btcusd/
|
2022-11-04 22:42:29 +07:00
|
|
|
<pre>
|
|
|
|
{
|
|
|
|
"price": "21,188.77",
|
|
|
|
"price_change": "+869.87",
|
|
|
|
"change": "(+4.28%)",
|
|
|
|
"last_update": "As of 02:52PM UTC. Market open.",
|
|
|
|
"server_update": "04-11-2022 21:54:44 GMT+7",
|
|
|
|
"color": "#40ff00",
|
|
|
|
"symbol": "🟢"
|
|
|
|
}
|
|
|
|
</pre>
|
2022-10-29 20:46:20 +07:00
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
ETH-USD
|
|
|
|
https://api.gabrielkheisa.xyz/stocks/ethusd/
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
Indeks Harga Saham Gabungan
|
|
|
|
https://api.gabrielkheisa.xyz/stocks/jkse/
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|