API = os.getenv('API_KEY')
IQ = requests.get('https://financialmodelingprep.com/api/v3/stock-screener?marketCapMoreThan=1÷ndMoreThan=0&limit=100000000&&apikey=API').json()
Stocks = pd.DataFrame(IQ) Stocks.set_index("symbol", inplace = True)```
response:
If using all scalar values, you must pass an index
您已经写了它,apikey等于字符串“ API”。而是使用此:
IQ = requests.get(f'https://financialmodelingprep.com/api/v3/stock-screener?marketCapMoreThan=1÷ndMoreThan=0&limit=100000000&&apikey={API}').json()