API question

I am attempting to utilize the API wrapper in Python. The screen_run example runs with no errors, but I cannot figure out how to use Get Data. I keep getting the error “API request failed: Cannot deserialize tickers parameter value.”. Could you please let me know what is wrong with the script below?

import p123api
try:
client = p123api.Client(api_id=‘xx’, api_key=‘xxxxxxxxxxxxxxxxxxxxxxxxxx’)
print(client.data(
{
‘tickers’: ‘IBM’,
‘formula’: ‘price’,
‘startDt’: ‘2020-02-01’,
‘endDt’: ‘2020-03-01’
}
))
except p123api.ClientException as e:
print(e)

Hey Dan,
The Data endpoint supports multiple p123 uids / tickers / cusips / formulas per request (up to 50) so they are all arrays (see https://api.portfolio123.com:8443/docs/index.html#/Data/_data ).

Hi Marius,
Thanks for the reply. I have it working now. There seems to be an issue with the frequency parameter. No matter what I pass it, it always returns data for Every Week.

import p123api
try:
client = p123api.Client(api_id=‘xx’, api_key=‘xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’)
print(client.data(
{
‘engine’: ‘Legacy’, #legacy or current
‘vendor’: ‘Compustat’, #Factset or Compustat
‘pitMethod’: ‘Prelim’, #Prelim or Complete
‘tickers’: [‘IBM’,‘MSFT’],
‘formulas’: [‘price’,‘mktcap’,‘eval(ROA%TTM>0 and ROA%5YAvg>0,(ROA%TTM - ROA%5YAvg) / ABS(ROA%5YAvg),NA)’],
‘startDt’: ‘2019-01-01’,
‘endDt’: ‘2020-03-01’,
‘frequency’: ‘Every 13 Weeks’ #Every Day, Every Week, Every 2 Weeks, Every 3 Weeks, Every 4 Weeks, Every 6 Weeks, Every 8 Weeks, Every 13 Weeks, Every 26 Weeks, Every 52 Weeks
}
))
except p123api.ClientException as e: