Free stock api with - Alternative for Yahoo finance

free realtime stock api

Phd students at University of South Carolina have been using Finnhub as their primary source for finance data since yahoo finance shut down 2 years ago. Today I just wanna show a quick Python tutorial to get realtime data from Finnhub stock api to draw candlestick chart and do your own analysis.

Make sure to get your Free API key first to access 60 calls/minute. In this tutorial I will use the API without a API key, which will limit me to 2 calls per mintue. Here is an example:

Get 2000 Daily candles for AAPL

import plotly.graph_objects as go
import pandas as pd
from datetime import datetime
df = pd.read_csv('')
fig = go.Figure(data=[go.Candlestick(x=df['t'],

To learn more about Finnhub stock API , read the docs here