JustForFund

API Documentation

With our API endpoints you can post trading signals from your own strategies, get access to data and interact with your investments.



Publish algorithms

To publish an algorithm you first need to create an app and generate your api keys.

Create App

[POST] Create trading signal

/v1/create_order

Python example:

      
        import requests
        import os
        
        API_ENDPOINT = 'http://localhost:5000/api'
        API_KEY = os.environ['API_KEY']
        API_SECRET = os.environ['API_SECRET']
        HEADERS = {'API-KEY': API_KEY, 'API-SECRET': API_SECRET}
        
        def create_trading_signal(algorithm_id, symbol, portfolio_ratio_investment, order_type, side, time_in_force):
            data = {
                "algorithm_id":algorithm_id,
                "ticker_symbol":symbol,
                "order_type": order_type, 
                "portfolio_ratio_investment": portfolio_ratio_investment, 
                "side":side, 
                "time_in_force":time_in_force
            }
            url = "{}/create_trading_signal".format(API_ENDPOINT)
            r = requests.post(url, json=data ,headers=HEADERS)
            return r
        
        if __name__ == '__main__':
            create_trading_signal(1, 'AAPL', 0.1, 'market', 'buy', 'gtc')
      
    

symbol: stock symbol (e.g. : "AAPL") (String)

percentage_of_buying_power: The percentage of the current buying power that will be spent on the stock (float number) (String) (e.g. : "0.01" --> 1%)

order_type: Only "market" orders supported at this time (String)

side: "buy" or "sell" (String)

time_in_force: "day" (String) (Must be "day" for fractional trading)



[GET] load algorithm by id

/v1/get_algorithm

Python example:

      
      import requests
      import json
      import os

      API_ENDPOINT = 'https://justfor.fund/api/'
      API_KEY = os.environ['API_KEY']
      API_SECRET = os.environ['API_SECRET']
      HEADERS = {'API-KEY': API_KEY, 'API-SECRET': API_SECRET}

      def get_algorithm():
        data = {
          "algorithm_id":algorithm_id
        }
        url = "{}/v1/get_algorithm".format(API_ENDPOINT)
        r = requests.get(url, json=data ,headers=HEADERS)
        return json.loads(r.content)
      
    

algorithm_id: the id of the algorithm you want to get a signal from.


[GET] load available algorithms

/v1/get_algorithms

Python example:

      
      import requests
      import json
      import os

      API_ENDPOINT = 'https://justfor.fund/api/'
      API_KEY = os.environ['API_KEY']
      API_SECRET = os.environ['API_SECRET']
      HEADERS = {'API-KEY': API_KEY, 'API-SECRET': API_SECRET}

      def get_algorithms():
        url = "{}/v1/get_algorithms".format(API_ENDPOINT)
        r = requests.get(url, json=data ,headers=HEADERS)
        return json.loads(r.content)
      
    

[GET] trading signals

/v1/get_signal

Python example:

      
      import requests
      import json
      import os

      API_ENDPOINT = 'https://justfor.fund/api/'
      API_KEY = os.environ['API_KEY']
      API_SECRET = os.environ['API_SECRET']
      HEADERS = {'API-KEY': API_KEY, 'API-SECRET': API_SECRET}

      def get_signal(algorithm_id):
        data = {
          "algorithm_id":algorithm_id
        }
        url = "{}/v1/get_signal".format(API_ENDPOINT)
        r = requests.get(url, json=data ,headers=HEADERS)
        return json.loads(r.content)
      
    

algorithm_id: the id of the algorithm you want to get a signal from.