nickmccullum / algorithmic-trading-python

The repository for freeCodeCamp's YouTube course, Algorithmic Trading in Python
2.35k stars 2.37k forks source link

Getting error 403,Tried replacing token with a new one, used try except clause #54

Open Shanu2092 opened 1 year ago

Shanu2092 commented 1 year ago

final_dataframe = pd.DataFrame(columns = mycolumns)

for stock in stocks['Ticker']: api_url = f'https://sandbox.iexapis.com/stable/stock/{stock}/quote/?token=sk_b92781ff259841bead23d3012a9f8cf3' data = requests.get(api_url)

if data.status_code == 200:
    data = data.json()
    final_dataframe = final_dataframe.append(
        pd.Series(
            [stock, data['latestPrice'], data['marketCap'], 'N/A'], 
            index = mycolumns
        ), 
        ignore_index = True
    )
else:
    print(f'An error occurred, status code: {data.status_code}')
rayna0921 commented 1 year ago

me2!!!! still dont know how to fix this

syedr-prog commented 11 months ago

Let me know if you guys find something!

joethesaint commented 1 week ago

I think the solution have already been solved

joethesaint commented 1 week ago

Okay, it has not been solved. Instead, IEX Cloud seems to have updated over the years