Yahoo API into Pandas Dataframe

2431 views pandas
6

I am trying to pull stock data from yahoo and put it into a pandas dataframe. Below is what I wrote but I get an error of "No columns to parse from file". Can someone help?

Thx

input

import pandas as pd
api = 'https://query1.finance.yahoo.com/v8/finance/chart/AAPL?interval=5m' 
df = pd.read_csv(api, skiprows=8, header=None)

answered question

1 Answer

4

I think yahoo finance already shutdown api service to prevent data abuse ,a valid token is required to initiate data transfer,you need to exlplore other services provider like alpha vantage as alternative https://www.alphavantage.co/

posted this

Have an answer?

JD

Please login first before posting an answer.

Ads

Categories