|
By using this API, you agree to the following: Web API EULA...click Here
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
if you would like for us to program your strategy with our API. We have offshore developers who can do it very quickly and cost effectively. Are you an extremely active day trader? You may qualify for our free API subscription in addition to reduced commissions.
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
your monthly trading level and we will respond with your API fee and commission level. URL for accessing Web API: https://www.junotrade.com API Functions: Note: You will receive a demo account after subscribing to API. This demo account simulates the stock market including market, limit, stop, stop limit, and trailing stop order fills. If you have any questions about the demo account, you can
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Please find a sample PERL usage of our WebAPI here Please find a sample PHP usage of our WebAPI here Please find a sample C# .NET Console application usage of our WebAPI here /webapi/login?UserName=&Password=
Description: Login to the Web API.
Arguments:
UserName: Your User Name Password; Your Password Returns: S|<positive or negative value>|<Order System Status>
Success: S|1|Loggedon
Failure, Bad Login Credentials: S|-1
Failure, Order System Queuing Orders: S|-20|Reconnecting Note: In Reconnecting State, if you send an order, it will be queued and sent to exchange at a later time. Be careful when sending orders in this state.
Failure, Order System Unavailable: S|-20|Order Server is unavailable Failure, Order System Not Connected: S|-20|Unknown
/webapi/logout
Description: Logout of the Web API. Returns:
Success: S|1 Failure: S|-1
/webapi/getStockQuote?Symbol= Description: get a RealTime quote for specific symbol. Single Symbol Highest frequency stock quote.
It returns in this format:
AskPrice|AskSize|BidPrice|BidSize|Close|High|Low|NetChange|Open|Price|Size|Symbol|Tick|Timestamp|TotalVolume
/webapi/getMultipleStockQuotes?Symbol= Description: get multiple RealTime quotes for multiple symbols. Highest frequency multiple stock quote request. Pass comma delimited list of Symbols. It returns in this format:
AskPrice|AskSize|BidPrice|BidSize|Close|High|Low|NetChange|Open|Price|Size|Symbol|Tick|Timestamp|TotalVolume|Timestamp2 Timestamp = Time of Last Trade Timestamp2 = Time request was made to quote server
/webapi/getSymbol?sym=
Description (DEPRECATED, please use higher speed functions above unless you need fundamental data): get a RealTime quote for specific symbol. Also, get fundamental data for symbol. Not available on weekends.
Arguments: sym: Symbol Note: sym can be a single symbol or a comma delimited list of symbols. G1req: Optional - Request fundamental data
Returns:
S|-1 - not logged in
If only sym sent:
G|<Symbols>|<Price>|<Last Trade Time>|<High>|<Low>|<Last>|<Open>|<Bid>|<Ask>|<Tota Volume>|<Net Change>|<Tick><CR><LF> Note: There will be 1 line of data for each symbol sent with "sym" request.
Example - /webapi/getSymbol?sym=IBM G|IBM|161.33|07:27:25|0.00|0.00|0.00|0.00|161.12|161.40|600|0.56|0.00
Example - /webapi/getSymbol?sym=IBM,DELL G|IBM|161.33|07:27:25|0.00|0.00|0.00|0.00|161.12|161.40|600|0.56|0.00 G|DELL|21.33|07:27:25|0.00|0.00|0.00|0.00|21.12|21.40|300|0.56|0.00 If G1req sent: G1|<Symbol>|<Company Name>|<52 Week High>|<52 Week Low>|<Market Cap>|<EPS>|<P/E Ratio>|<Dividend Yield>|<Price/Book>|<Price/Earnings Forward>|<Graham Factor><CR><LF> Example - /webapi/getSymbol?sym=IBM&G1req=true
G|IBM|161.35|08:03:23|0.00|0.00|0.00|0.00|161.20|161.33|1700|0.58|0.00 G1|IBM|"International Bus"|166.25|116.00|197.70|11.52|13.96|1.62|8.58|11.13|95.50
/webapi/getSymbolWithTimeOfRequest?sym=
Description: (DEPRECATED, please use higher speed functions above unless you need fundamental data) get a RealTime quote for specific symbol with time quote sample was taken from market. Also, get fundamental data for symbol.
Arguments: sym: Symbol Note: sym can be a single symbol or a comma delimited list of symbols. G1req: Optional - Request fundamental data
Returns:
S|-1 - not logged in
If only sym sent:
G|<Symbols>|<Price>|<Last Trade Time>|<High>|<Low>|<Last>|<Open>|<Bid>|<Ask>|<Tota Volume>|<Net Change>|<Tick>|<Time of Quote Sample><CR><LF> Note: There will be 1 line of data for each symbol sent with "sym" request.
Example - /webapi/getSymbol?sym=IBM G|IBM|161.33|07:27:25|0.00|0.00|0.00|0.00|161.12|161.40|600|0.56|0.00|07:27:25 Example - /webapi/getSymbol?sym=IBM,DELL G|IBM|161.33|07:27:25|0.00|0.00|0.00|0.00|161.12|161.40|600|0.56|0.00|07:27:25 G|DELL|21.33|07:27:25|0.00|0.00|0.00|0.00|21.12|21.40|300|0.56|0.00|07:27:25 If G1req sent: G1|<Symbol>|<Company Name>|<52 Week High>|<52 Week Low>|<Market Cap>|<EPS>|<P/E Ratio>|<Dividend Yield>|<Price/Book>|<Price/Earnings Forward>|<Graham Factor>|<Time of Quote Sample><CR><LF> Example - /webapi/getSymbol?sym=IBM&G1req=true
G|IBM|161.35|08:03:23|0.00|0.00|0.00|0.00|161.20|161.33|1700|0.58|0.00|07:27:25 G1|IBM|"International Bus"|166.25|116.00|197.70|11.52|13.96|1.62|8.58|11.13|95.50|07:27:25 /webapi/getOptionChains?Symbol= Description: Returns a list of Option Symbols in Ascending chronological order.
Arguments: Symbol: Symbol Example: /webapi/getOptionChains?Symbol=INTC Returns: <Symbol1><CR><LF> <Symbo2><CR>LF> Return Example: INTC 120218C00012000 INTC 120218C00013000 INTC 120218C00014000 INTC 120218C00015000 INTC 120218C00016000 INTC 120218C00017000 <...> /webapi/getOptionQuote?Symbol= Description: Returns a Real Time quote for an Option Symbol Arguments: Symbol: Symbol Example: /webapi/getOptionQuote?Symbol=C 120218C00013000 Note: you may need to escape spaces with %20 depending on your system.
Returns: <AskPrice><AskSize><BidPrice><BidSize><ExpirationCycle><ExpirationDate><Last><Net><OpenInt><Price><PutCall><RootSymbol><Strike><Symbol><Timestamp><Volume><CR><LF> Return Example: 19.7|369|19.6|515|MarchCycle|02/18/2012 00:00:00|19.6|0.3|93|19.6|67|C|13|C 120218C00013000|02/16/2012 15:54:07.075|10
/webapi/makeOrder
Description: Single function for placing all Equity Order Types.
Arguments: Symbol - Required OrderSide - Required: 49 = Buy 50 = Sell 53 = SellShort OrderType - Required: 49 = Market 50 = Limit 51 = Stop 52 = StopLimit OrderQty – Required
tan – Required, your account number. Price StopPrice TrailingAmt TrailingType: Per = % Pts = Pts TimeInForce: 48 = Day 49 = GTC PositionEffect: 79 = OPEN 67 = CLOSE ExecBroker
Error Returns:
S|-1 - not logged in E|-20 - missing a parameter: tan, Symbol, OrderSide, OrderType, or OrderQty
Success: O|<ClOrdID>|<ExecInst>|<MinQty>|<OrderID>|<OrderQty>|<OrderSide>|<OrderType>|<PositionEffect>|<Price>|<SecurityType>|<StopPrice>|<Symbol>|<TimeInForce>|<TrailingStopDelta>|<ExecBroker>|<account>|<Status><CR><LF>
Examples: Buy 10 of A at Market: /webapi/makeOrder?OrderSide=49&OrderType=49&OrderQty=10&Symbol=a&tan=sim-nexademo7
Returns:
O|0.46566300 1298642639||||10|49|49|||CS||A||||sim-nexademo7
Buy 10 GOOG Limit $10
/webapi/makeOrder?OrderSide=49&OrderType=50&TimeInForce=48&OrderQty=10&Price=10&Symbol=GOOG&tan=sim-nexademo7&PositionEffect=79
Returns:
O|0.67211300 1298650058||||10|49|50||10|CS||GOOG|48|||sim-nexademo7| /webapi/makeOptionOrder Description: Single function for placing all Option order Order Types.
Arguments: Symbol - Required OrderSide - Required: 49 = Buy 50 = Sell 53 = SellShort OrderType - Required: 49 = Market 50 = Limit 51 = Stop 52 = StopLimit OrderQty – Required
tan – Required, your account number. Price StopPrice TrailingAmt TrailingType: Per = % Pts = Pts TimeInForce: 48 = Day 49 = GTC ExecBroker
Error Returns:S|-1 - not logged in E|-20 - missing a parameter: tan, Symbol, OrderSide, OrderType, or OrderQty Success: O|<ClOrdID>|<ExecInst>|<MinQty>|<OrderID>|<OrderQty>|<OrderSide>|<OrderType>|<PositionEffect>|<Price>|<SecurityType>|<StopPrice>|<Symbol>|<TimeInForce>|<TrailingStopDelta>|<ExecBroker>|<account>|<Status><CR><LF>
Examples: Note: Our Option Symbology includes 6 characters for option symbol which is padded with spaces. Make sure you "escape" the space and fill with a %20.
Buy 10 of IBM 110820C00220000 at Market: /webapi/makeOptionOrder?OrderSide=49&OrderType=49&OrderQty=10&Symbol=IBM%20%20%20110820C00220000&tan=sim-nexademo7
Returns:
O|0.46566300 1298642639||||10|49|49|||CS||A||||sim-nexademo7
/webapi/getOrderStatus
Description: Pass in a Client Order ID, and get the status of an open order. Example: /webapi/getOrderStatus?ClOrdID=0.343434343 878734 Returns: O|<ClOrdID>|<ExecInst>|<MinQty>|<OrderID>|<Qty>|<Side>|<Type>|<PositionEffect>|<Price>|<SecurityType>|<StopPrice>|<Symbol>|<TimeInForce>|<TrailingStopDelta>|<ExecBroker>|<tan>|<Status>|<AvgPx>|<TotalQty>|<Info>|<TransactTimeStamp><CR><LF>
Note: make sure to pass a %20 for the space in ClOrdID if your web platform does not automatically encode URL.
/webapi/getOpenOrders
Description: Returns all "Pending Orders".
Returns: S|-1 - not logged in Success: O|<ClOrdID>|<ExecInst>|<MinQty>|<OrderID>|<Qty>|<Side>|<Type>|<PositionEffect>|<Price>|<SecurityType>|<StopPrice>|<Symbol>|<TimeInForce>|<TrailingStopDelta>|<ExecBroker>|<tan>|<Status>|<AvgPx>|<TotalQty>|<Info>|<TransactTimeStamp><CR><LF>
Example:
O|0.85674400 1298647151|||sim-nexademo7.110225.e.GOOG.d1de.23ed.3|||||10||0|GOOG||0|SIM||New O|0.78194400 1298606071|||sim-nexademo7.110224.e.MSFT.d1dd.5d68.6|||||1||0|MSFT||0|SIM||New O|0.50676000 1298597230|||sim-nexademo7.110224.e.GOOG.4|||||10||0|GOOG||0|SIM||New O|0.64689400 1298597015|||sim-nexademo7.110224.e.GOOG.3|||||10||0|GOOG||0|SIM||New O|0.44287700 1298596957|||sim-nexademo7.110224.e.GOOG.2|||||10||0|GOOG||0|SIM||New O|0.63230800 1298596809|||sim-nexademo7.110224.e.GOOG.1|||||10||0|GOOG||0|SIM||New O|0.52816800 1298596744|||sim-nexademo7.110224.e.GOOG.d1de.6b0e.6|||||10||0|GOOG||0|SIM||New
/webapi/cancelOrder
Description: Cancels an open order.
Arguments: Symbol - Required OrderID - Required for the order ClOrdID - Required for the order Side - Required for the order: 49 = Buy 50 = Sell 53 = SellShort
Returns: S|-1 - not logged in S|-10 - missing argument(s) Success: Example - /webapi/cancelOrder?OrderID=simnexademo7.110225.e.AAPL.d1dd.399f.6&ClOrdID=0.51267900 1298651226&Side=49&Symbol=AAPL
S|1
/webapi/getPositions Description: Returns all open Positions.
Returns: S|-1 - not logged in Success: P|<ClosePL>|<CommisionGross>|<CommisionNet>|<InstrumentType>|<LongAveragePriceAmount|LongAveragePriceCurrency>|<LongQuantity>|<LongCashAveragePriceAmount|<LongCashAveragePriceCurrency>|<LongCashQuantity>|<LongMarginAveragePriceAmount>|<LongMarginAveragePriceCurrency>|<LongMarginQuantity>|<ShortAveragePriceAmount>|<ShortAveragePriceCurrency>|<ShortQuantity>|<ShortCashAveragePriceAmount>|<ShortCashAveragePriceCurrency>|<ShortCashQuantity>|<ShortMarginAveragePriceAmount>|<ShortMarginAveragePricCurrency>|<ShortMarginQuantity>| <Symbol>|<accounted>|<TransactTimestamp><CR><LF>
Example: - /webapi/getPositions
P||||equity|101.15|0|USD|0|101.15|USD|20|0|USD|0|0|USD|0|0|USD|0|CAT|sim-nexademo7|02.24.11 23:09:29 EST P||||equity|161.2|0|USD|0|161.2|USD|10|0|USD|0|0|USD|0|0|USD|0|IBM|sim-nexademo7|02.24.11 23:09:28 EST P||||equity|56.91|0|USD|0|56.91|USD|10|0|USD|0|0|USD|0|0|USD|0|QQQQ|sim-nexademo7|02.24.11 23:09:28 EST P||||equity|80.79|0|USD|0|80.79|USD|10|0|USD|0|0|USD|0|0|USD|0|RIG|sim-nexademo7|02.24.11 23:09:28 EST
/webapi/closePositions
Description: Places a market order to close a Position.
Arguments: Symbol - Required Type - Required Long/Short
Returns: S|-1 - not logged in S|-10 - invalid request S|-11 - invalid position S|-20 - server error S|1 - Success Example: https://www.junotrade.com/webapi/closePositions?Symbol=BAC&Type=Long
/webapi/getProfitLoss
Description: Returns Realized Profit and Loss for Positions closed today. Returns:
PL|<TodaysRealizedDeltaEquity>|<TodaysRealizedPL>
/webapi/getBuyingPower
Description: Gets your current real-time Buying Power. Returns:
B|<BeginningDaytradeAmount>|<BeginningOvernightAmount>|<CurrentDaytradeAmount>|<CurrentOvernightAmount>|<DaytradeMultiplier>|<OvernightMultiplier>
/webapi/getSymbolHistory Description: get Open,High,Low,Close,Volume 1 minute bars for a specific date range. Example with just Date: getSymbolHistory?Symbol=BAC&StartYear=2010&StartMonth=3&StartDay=25&EndYear=2011&EndMonth=3&EndDay=1&Type=Minute&BarSize=1 Example with Date and Time: getSymbolHistory?Symbol=SPY&StartYear=2012&StartMonth=2&StartDay=9&StartHour=9&StartMinute=30&EndYear=2012&EndMonth=2&EndDay=9&EndHour=9&EndMinute=0&Type=Minute&BarSize=1
Returns on unsuccessful: E|-10
On successful it will return multiple 1 minute bars of format:
<Symbol>|<DateTime>|<Open>|<High>|<Low>|<Close>|<Volume><CR><LF>
Here is an example of data that is returned: BAC|3/1/2011 2:00:00 PM|14.0295|14.03|14.01|14.03|360642 BAC|3/1/2011 2:01:00 PM|14.0299|14.03|14.01|14.025|232456 BAC|3/1/2011 2:02:00 PM|14.025|14.03|14.01|14.03|23570 BAC|3/1/2011 2:03:00 PM|14.025|14.03|14|14.0025|841649 BAC|3/1/2011 2:04:00 PM|14.005|14.01|14|14.0089|184635 BAC|3/1/2011 2:05:00 PM|14.001|14.01|14|14|690665 BAC|3/1/2011 2:06:00 PM|14.01|14.01|13.98|13.98|1774652
/webapi/getOrders Description: Gets a full order history. Order history is returned in blocks of 100 records, in reverse chronological order i.e. latest orders are first. You must look at date of last record and pass as <end> parameter as described below. Example: If there are less than 100 Orders, then all records are returned in 1 call with first record of: OH|<Orders Returned>|<Total Orders in database><CR><LF> Example: OH|55|55 O|<ClOrdID>|<ExecInst>|<MinQty>|<OrderID>|<Qty>|<Side>|<Type>|<PositionEffect>|<Price>|<SecurityType>|<StopPrice>|<Symbol>|<TimeInForce>|<TrailingStopDelta>|<ExecBroker>|<tan>|<Status>|<AvgPx>|<TotalQty>|<Info>|<TransactTimeStamp><CR><LF> If there are more than 100 Orders, then for example you will receive: OH|100|216 First call to getOrders returns 100 records: /webapi/getOrders Second call to getOrders: /webapi/getOrders?end=2010-06-01 Where "end" is the date of the last record returned in the last call to getOrders.
|