investfly.api.InvestflyApiClient

class InvestflyApiClient:

Investfly API Client. This class should be used as the entry point to make all API calls. After authentication, access marketApi or portfolioApi to make calls to /market or /portfolio endpoints

InvestflyApiClient(baseUrl: str = 'https://api.investfly.com', logEnabled: bool = False)
restApiClient
marketApi

Class used to make calls to /marketdata and /symbol endpoint to get market and symbol data

portfolioApi

Class used to make calls to /portfolio endpoint to get portfolio and brokerage account data

strategyApi

Class used to make calls to /strategy endpoint to operate on trading strategies

indicatorApi
def login(self, username, password) -> investfly.models.CommonModels.Session:

Login to investfly backend.

Parameters
  • username: Username
  • password: Password
Returns

Session object representing authenticated session

def logout(self):
def isLoggedIn(self) -> bool:
def getSession(self) -> investfly.models.CommonModels.Session:
def enableLogging(self, enable: bool = True):

Enable or disable HTTP request/response logging for this client. Note: Logging configuration should be done separately by the application using standard Python logging.

Parameters
  • enable: Whether to enable logging
@staticmethod
def parseDatetime(date_str: str) -> datetime.datetime: