P123 API: Ability to Download Live Strategy Performance History

Would be very helpful to be able to download the Performance History for Live Strategies using the API. Ideally just return the dataframe equivalent of the csv file that can be downloaded from the Charting page. I haven’t been able to figure out how to do this, so I don’t believe the capability exists.

Thanks,

Daniel

Hi Daniel,
The strategy endpoint has the ability to retrieve the same data you would get from the download button on the Charts page.

Example:

    data = client.strategy(1701030)  #P123 SmallCap Focus
    daily_perf = data.get("dailyPerf", [])
    # Convert to DataFrame for column format
    df = pd.DataFrame(daily_perf)
    print(df.to_string(index=False))

image

1 Like

Thanks Dan!

Dan is this new? How long has this been a thing?

I believe that endpoint has been available for at least a year. But we did just release additional Strategy endpoints a few months ago. We were waiting to do an official announcement because there were some bugs, but they have been fixed. I just did the announcement.

For a list of all the available endpoints, see Swagger.

1 Like