Our service provides a 100% free "paper money" investment platform. A paper trade is simulated trading which allows investors to practice buying and selling securities without risking real money. Our API is very simple and exclusively uses GET HTTP requests. You can find the documentation and specification below.
Create a new portfolio
This is the first request that you make to use the service. This will return an ID string that corresponds to the newly created portfolio. You use this ID for every service that follows. Keep this ID in a safe place! There is no way of recovering it and if someone else obtained it, they can execute transactions in your account.
Parameters
Example
Example Response
This is the first request that you make to use the service. This will return an ID string that corresponds to the newly created portfolio. You use this ID for every service that follows. Keep this ID in a safe place! There is no way of recovering it and if someone else obtained it, they can execute transactions in your account.
Parameters
- ownername - The name that will be attached to the portfolio as the portfolio owner.
Example
- GET http://papertrade.azurewebsites.net/api/CreatePortfolio?ownername=KenSmith
Example Response
- 01c1b435-4857-4ffe-8d05-42edd9e6bf85
Add or Subtract Cash from your portfolio
To purchase stock you must first have cash! Use this call to add or subtract cash to your portfolio. This call will either return true (the call executed successfully) or false (the call failed).
Parameters
Example
To purchase stock you must first have cash! Use this call to add or subtract cash to your portfolio. This call will either return true (the call executed successfully) or false (the call failed).
Parameters
- portfolioId - The unique ID of your portfolio.
- amount - the amount which you want to add or subtract to your portfolio. Positive = add, negative = subtract.
Example
- GET http://papertrade.azurewebsites.net/api/EditCash?portfolioId=03701dc3-311e-459e-91f3-0c47387c6f51&amount=1500
Buy or Sell a Stock
Use this to purchase or sell shares of stock. This call will either return true (the call executed successfully) or false (the call failed).
Parameters
Example
Use this to purchase or sell shares of stock. This call will either return true (the call executed successfully) or false (the call failed).
Parameters
- portfolioId - The unique ID of your portfolio.
- stocksymbol - the symbol of the equity you would like to trade.
- ordertype - either buy or sell.
- quantity - the quantity of shares you would like to trade.
Example
- GET http://papertrade.azurewebsites.net/api/TradeEquity?portfolioId=03701dc3-311e-459e-91f3-0c47387c6f51&stocksymbol=msft&ordertype=buy&quantity=10
- This is buying 10 shares of Microsoft stock.
- GET http://papertrade.azurewebsites.net/api/TradeEquity?portfolioId=03701dc3-311e-459e-91f3-0c47387c6f51&stocksymbol=crm&ordertype=sell&quantity=3
- This is selling 3 shares of Salesforce stock.
List portfolio holdings
Use this call to get a list of the stocks that your portfolio holds.
Parameters
Example
Example Response
Use this call to get a list of the stocks that your portfolio holds.
Parameters
- portfolioId - The unique ID of your portfolio.
Example
- GET http://papertrade.azurewebsites.net/api/ListHoldings?portfolioId=03701dc3-311e-459e-91f3-0c47387c6f51
Example Response
- [{"Symbol":"MSFT","Quantity":1},{"Symbol":"AMD","Quantity":1}]
Get portfolio cash balance
Use this call to get the cash balance of the portfolio.
Parameters
Example
Use this call to get the cash balance of the portfolio.
Parameters
- portfolioId - The unique ID of your portfolio.
Example
- GET http://papertrade.azurewebsites.net/api/CashBalance?portfolioId=03701dc3-311e-459e-91f3-0c47387c6f51
Calculate portfolio net gain or loss
Use this call to calculate the net gain or loss of your portfolio.
Parameters
Example
Use this call to calculate the net gain or loss of your portfolio.
Parameters
- portfolioId - The unique ID of your portfolio.
Example
- GET http://papertrade.azurewebsites.net/api/CalculateProfit?portfolioId=03701dc3-311e-459e-91f3-0c47387c6f51
List Equity Transactions (new 2/20/2020)
Use this call to get a list of all equity transactions (buying or selling a stock).
Parameters
Example
Example Response
Use this call to get a list of all equity transactions (buying or selling a stock).
Parameters
- portfolioId - The unique ID of your portfolio.
Example
- GET http://papertrade.azurewebsites.net/api/ListEquityTransactions?portfolioId=03701dc3-311e-459e-91f3-0c47387c6f51
Example Response
- [{"StockSymbol":"TSLA","Quantity":1,"OrderType":0,"TransactedOn":"2020-02-19T20:25:47.2239604+00:00"}]
List Cash Transactions (new 2/20/2020)
Use this call to get a list of all cash transactions (adding or subtracting cash from a portfolio).
Parameters
Example
Example Response
Use this call to get a list of all cash transactions (adding or subtracting cash from a portfolio).
Parameters
- portfolioId - The unique ID of your portfolio.
Example
- GET http://papertrade.azurewebsites.net/api/ListCashTransactions?portfolioId=03701dc3-311e-459e-91f3-0c47387c6f51
Example Response
- [{"CashChange":1000.0,"TransactedOn":"2020-02-19T20:25:46.4270948+00:00"},{"CashChange":-40.8800049,"TransactedOn":"2020-02-20T12:49:59.8779176-08:00"}]
Set Cash Balance (new 2/20/2020)
Use this call to set a specific cash balance for your portfolio. This call will return true if successful and false if unsuccessful.
Parameters
Example
Use this call to set a specific cash balance for your portfolio. This call will return true if successful and false if unsuccessful.
Parameters
- portfolioId - The unique ID of your portfolio.
- cashamount - The amount of cash that you wish to set your portfolio cash balance to.
Example
- GET http://papertrade.azurewebsites.net/api/SetCash?portfolioId=03701dc3-311e-459e-91f3-0c47387c6f51&cashamount=700