I'm currently building a program in Pycharm and want to use the Eikon API to retreive 2 fields: CF_Last and TR.priceclose (SDate=-1M). However, when i give up ISIN codes as instrument names, i get an error, while RICs do seem to work. Is there any way to do this based on ISIN?
import tkinter as tk
from tkinter import filedialog
import pandas as pd
import eikon as ek
# API Key
ek.set_app_key('')
# Define the list of instrument codes and fields to retrieve
instrument_codes = ['BE0974293251', 'NL0010273215']
fields = ['CF_LAST', 'TR.PriceClose(SDate=-1M)']
# Retrieve the data using the Eikon API
data, err = ek.get_data(instrument_codes, fields)
# Check for errors
if err:
raise ValueError(err)
# Print the resulting DataFrame
print(data)