algorithmic-trading-python icon indicating copy to clipboard operation
algorithmic-trading-python copied to clipboard

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

Open Shanu2092 opened this issue 1 year ago • 4 comments

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}')

Shanu2092 avatar Apr 04 '23 12:04 Shanu2092

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

rayna0921 avatar May 31 '23 13:05 rayna0921

Let me know if you guys find something!

syedr-prog avatar Jul 20 '23 22:07 syedr-prog

I think the solution have already been solved

joethesaint avatar Jun 27 '24 15:06 joethesaint

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

joethesaint avatar Jun 27 '24 16:06 joethesaint