Introduction
API Endpoint https://upapi.algomojo.com/1.0/
Algomojo API Bridge which helps traders/investors to build, monitor, execute their trading requirement automatically.
To use this API, you need an API key. Please login to your algomojo broker terminal to get your own API key.
up.algomojo.com
Version and API root URL
The current major stable version of the API is 1.0. All requests go to it by default. It is recommended that a specific version be requested explicity for production applications as major releases may break older implementations.
Root URL
https://upapi.algomojo.com/1.0/
Each rest call will have 3 compulsory request parameters
1. api_key
2. api_secret
3. data
api_key is a key allocated to the User. Input will be in string format.
api_secret is a id received as response from Login 2FA.Input will be in string format.
data is a JSON object which is referred as Input in rest description table. If there is no input mentioned in the table you need to send it as a blank object or a blank string. Input will be in string format.
NOTE: - All APIs are considered as POST method. All the input as well as output data type will be in string format unless its mentioned in rest explanation section.
Exchange
bse_index - BSE Index
nse_index - NSE Index
bse_eq - BSE Equity
bcd_fo - BSE Currency Futures & Options
nse_eq - NSE Equity
nse_fo - NSE Futures & Options
ncd_fo - NSE Currency Futures & Options
mcx_fo - MCX Futures
Symbol format
The trading symbol should be sent in the following format at the time of request
For BSE and NSE enter the scrip name as RELIANCE, AXISBANK etc
For NSE futures enter the symbol as NIFTY17JUNFUT where NIFTY is the scrip name, 17 [YY] is the year, JUN [MMM] is the month name, FUT is the instrument
For NSE monthly options enter the symbol as NIFTY17JUN9500CE where NIFTY is the scrip name, 17[YY] is the year, JUN [MMM] is the month name, 9500 is the strike price and CE is the option type
For NSE weekly options it should be BANKNIFTY1750423200CE where BANKNIFTY is the scrip name, 17[YY] is the year, 5 [M] is the month, 04 [DD] is the day, 23200 is the strike price and CE is the option type. The format of month will be different for October, November and December. It will show like this BANKNIFTY17111623200CE where 11 is the month and 16 is the day.
Order Type
MKT - Market Order
LMT - Limit Order
SL - Stop Loss Order
SL-M - Stop loss Market Order
Product Type
MIS - Intraday Order
CNC - Delivery Order
NRML - Delivery Order
CO - Cover Order
BO - Bracket Order
PlaceOrder
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/PlaceOrder
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/PlaceOrder
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b70",
"api_secret":"5306433329e81ba41203653417063c",
"data":
{
"stgy_name":"Test Strategy",
"symbol":"RELIANCE",
"exchange":"NSE_EQ",
"transaction_type":"B",
"duration":"DAY",
"order_type":"MKT",
"quantity":"1",
"disclosed_quantity":"0",
"MktPro":"NA",
"price":"0",
"trigger_price":"0",
"product":"MIS",
"is_amo":"NO"
}
}
Response example :
{
"order_id": "200810000277991",
"stat": "Ok"
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
stgy_name | Strategy Name | Yes |
symbol | Trading Symbol | Yes |
exchange | Exchange name | Yes |
transaction_type | Transtaction Type | Yes |
duration | duration - It can be one of the following DAY IOC GTD |
Yes |
order_type | Order Type - It can be one of the following MKT - refers to Market Order LMT - refers to Limit Order SL - refers to Stop Loss Limit SL-M - refers to Stop loss market |
Yes |
quantity | Quantity | Yes |
disclosed_quantity | Disclosed Quantity | Yes |
price | Price | Yes |
trigger_price | Trigger Price | Yes |
product | Shows if the order was either MIS - MIS Type CNC - CNC Type NRML - NRML Type CO - CO Type |
Yes |
is_amo | AMO - It can be one of the following YES NO |
Yes |
PlaceMultiOrder
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/PlaceMultiOrder
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/PlaceMultiOrder
Request example :
{
"api_key":"781981bf5cc2662152dab1ed64e830",
"api_secret":"02aa902dbe344f7a88af59e0aa7ed01",
"data":
{
"orders" :
[
{
"order_refno":"1",
"user_apikey":"781981bf5cc2662152dab1ed64e830",
"api_secret":"02aa902dbe344f7a88af59e0aa7ed01",
"stgy_name":"HDFCB",
"symbol":"HDFCBANK",
"exchange":"NSE_EQ",
"transaction_type":"S",
"duration":"DAY",
"order_type":"MKT",
"quantity":"10",
"disclosed_quantity":"0",
"MktPro":"NA",
"price":"0",
"trigger_price":"0",
"product":"MIS",
"is_amo":"NO"
},
{
"order_refno":"2",
"user_apikey":"781981bf5cc2662152dab1ed64e8ef30",
"api_secret":"02aa902dbe344f7a88af59e0aa7e5d01",
"stgy_name":"HDFCB",
"symbol":"HDFCBANK",
"exchange":"NSE_EQ",
"transaction_type":"S",
"duration":"DAY",
"order_type":"MKT",
"quantity":"10",
"disclosed_quantity":"0",
"MktPro":"NA",
"price":"0",
"trigger_price":"0",
"product":"MIS",
"is_amo":"NO"
}
]
}
}
Response example :
[
{
"code": 200,
"status": "OK",
"timestamp": "2021-01-17T12:53:43+05:30",
"message": "success",
"data": {
"client_id": "331828",
"exchange": "NSE_EQ",
"token": 1333,
"symbol": "HDFCBANK",
"product": "I",
"order_type": "M",
"duration": "DAY",
"price": 0,
"trigger_price": 0,
"quantity": 10,
"disclosed_quantity": 0,
"transaction_type": "S",
"average_price": 0,
"traded_quantity": 0,
"message": "",
"exchange_order_id": "",
"parent_order_id": "NA",
"order_id": "210117000004159",
"exchange_time": "",
"time_in_micro": "1610868223122798",
"status": "put order req received",
"is_amo": false,
"valid_date": "",
"order_request_id": "1",
"report": "",
"text": "",
"user_comment": "",
"trading_symbol": "HDFCBANK"
}
},
{
"code": 200,
"status": "OK",
"timestamp": "2021-01-17T12:53:43+05:30",
"message": "success",
"data": {
"client_id": "331828",
"exchange": "NSE_EQ",
"token": 1333,
"symbol": "HDFCBANK",
"product": "I",
"order_type": "M",
"duration": "DAY",
"price": 0,
"trigger_price": 0,
"quantity": 10,
"disclosed_quantity": 0,
"transaction_type": "S",
"average_price": 0,
"traded_quantity": 0,
"message": "",
"exchange_order_id": "",
"parent_order_id": "NA",
"order_id": "210117000004160",
"exchange_time": "",
"time_in_micro": "1610868223922877",
"status": "put order req received",
"is_amo": false,
"valid_date": "",
"order_request_id": "1",
"report": "",
"text": "",
"user_comment": "",
"trading_symbol": "HDFCBANK"
}
}
]
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
order_refno | Order Reference Number | Yes |
user_apikey | User API Key | Yes |
api_secret | API Secret Key | Yes |
stgy_name | Strategy Name | Yes |
symbol | Trading Symbol | Yes |
exchange | Exchange name | Yes |
transaction_type | Transtaction Type | Yes |
duration | duration - It can be one of the following DAY IOC GTD |
Yes |
order_type | Order Type - It can be one of the following MKT - refers to Market Order LMT - refers to Limit Order SL - refers to Stop Loss Limit SL-M - refers to Stop loss market |
Yes |
quantity | Quantity | Yes |
disclosed_quantity | Disclosed Quantity | Yes |
price | Price | Yes |
trigger_price | Trigger Price | Yes |
product | Shows if the order was either MIS - MIS Type CNC - CNC Type NRML - NRML Type CO - CO Type |
Yes |
is_amo | AMO - It can be one of the following YES NO |
Yes |
PlaceBOOrder
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/PlaceBOOrder
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/PlaceBOOrder
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b70",
"api_secret":"5306433329e81ba41203653417063c",
"data":
{
"strg_name":"Test Strategy",
"symbol":"RELIANCE",
"exchange":"NSE_EQ",
"transaction_type":"B",
"duration":"DAY",
"order_type":"SL",
"quantity":"1",
"disclosed_quantity":"0",
"MktPro":"NA",
"price":"52",
"trigger_price":"55",
"product":"OCO",
"stoploss": "1",
"squareoff": "1",
"trailing_ticks": "21"
}
}
Response example :
{
"order_id": "200810000277991",
"stat": "Ok"
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
strg_name | Strategy Name | Yes |
symbol | Trading Symbol | Yes |
exchange | Exchange to which the order is associated | Yes |
transaction_type | Indicates whether its a buy(b) or sell(s) order | Yes |
duration | duration - It can be one of the following DAY IOC GTD |
Yes |
order_type | Order Type - It can be one of the following MKT - refers to Market Order LMT - refers to Limit Order SL - refers to Stop Loss Limit SL-M - refers to Stop loss market |
Yes |
quantity | Quantity | Yes |
product | OCO | Yes |
disclosed_quantity | Disclosed Quantity | Yes |
price | Price at which the order will be placed | Yes |
trigger_price | If the order is a stop loss order then the trigger price set is mentioned here | Yes |
is_amo | AMO - It can be one of the following YES NO |
Yes |
stoploss | Set a difference from the entry price for stoploss. Use in case the product is OCO | Yes |
squareoff | Set a difference from the entry price for profit. Use in case the product is OCO | Yes |
trailing_ticks | Indicates the number of ticks if the order placed was a trailing order. se in case the product is OCO | Yes |
PlaceMultiBOOrder
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/PlaceMultiBOOrder
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/PlaceMultiBOOrder
Request example :
{
"api_key":"781981bf5cc2662152dab1ed64e8ef30",
"api_secret":"02aa902dbe344f7a88af59e0aa7e5d01",
"data" : {
"orders" :
[
{
"order_refno": "1",
"user_apikey":"781981bf5cc2662152dab1ed64e8ef30",
"api_secret":"02aa902dbe344f7a88af59e0aa7e5d01",
"strg_name":"Test Strategy",
"symbol":"IDFCFIRSTB",
"exchange":"NSE_EQ",
"transaction_type":"B",
"duration":"DAY",
"order_type":"SL",
"quantity":"1",
"disclosed_quantity":"0",
"MktPro":"NA",
"price":"52",
"trigger_price":"55",
"product":"NRML",
"stoploss": "1",
"squareoff": "1",
"trailing_ticks": "21"
},
{
"order_refno": "2",
"user_apikey":"781981bf5cc2662152dab1ed64e8ef30",
"api_secret":"02aa902dbe344f7a88af59e0aa7e5d01",
"strg_name":"Test Strategy",
"symbol":"RCOM",
"exchange":"NSE_EQ",
"transaction_type":"B",
"duration":"DAY",
"order_type":"SL",
"quantity":"1",
"disclosed_quantity":"0",
"MktPro":"NA",
"price":"52",
"trigger_price":"55",
"product":"NRML",
"stoploss": "1",
"squareoff": "1",
"trailing_ticks": "21"
}
]
}
}
Response example :
[
{
"code": 200,
"status": "OK",
"timestamp": "2021-01-17T15:54:41+05:30",
"message": "success",
"data": {
"client_id": "331828",
"exchange": "NSE_EQ",
"token": 11184,
"symbol": "IDFCFIRSTB",
"product": "D",
"order_type": "SL",
"duration": "DAY",
"price": 52,
"trigger_price": 55,
"quantity": 1,
"disclosed_quantity": 0,
"transaction_type": "B",
"average_price": 0,
"traded_quantity": 0,
"message": "",
"exchange_order_id": "",
"parent_order_id": "NA",
"order_id": "210117000006131",
"exchange_time": "",
"time_in_micro": "1610879081150338",
"status": "put order req received",
"is_amo": false,
"valid_date": "",
"order_request_id": "1",
"report": "",
"text": "",
"user_comment": "",
"trading_symbol": "IDFCFIRSTB"
}
},
{
"code": 200,
"status": "OK",
"timestamp": "2021-01-17T15:54:41+05:30",
"message": "success",
"data": {
"client_id": "331828",
"exchange": "NSE_EQ",
"token": 13187,
"symbol": "RCOM",
"product": "D",
"order_type": "SL",
"duration": "DAY",
"price": 52,
"trigger_price": 55,
"quantity": 1,
"disclosed_quantity": 0,
"transaction_type": "B",
"average_price": 0,
"traded_quantity": 0,
"message": "",
"exchange_order_id": "",
"parent_order_id": "NA",
"order_id": "210117000006132",
"exchange_time": "",
"time_in_micro": "1610879081975120",
"status": "put order req received",
"is_amo": false,
"valid_date": "",
"order_request_id": "1",
"report": "",
"text": "",
"user_comment": "",
"trading_symbol": "RCOM"
}
}
]
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
order_refno | Order Reference Number | Yes |
strg_name | Strategy Name | Yes |
symbol | Trading Symbol | Yes |
exchange | Exchange to which the order is associated | Yes |
transaction_type | Indicates whether its a buy(b) or sell(s) order | Yes |
duration | duration - It can be one of the following DAY IOC GTD |
Yes |
order_type | Order Type - It can be one of the following MKT - refers to Market Order LMT - refers to Limit Order SL - refers to Stop Loss Limit SL-M - refers to Stop loss market |
Yes |
quantity | Quantity | Yes |
product | OCO | Yes |
disclosed_quantity | Disclosed Quantity | Yes |
price | Price at which the order will be placed | Yes |
trigger_price | If the order is a stop loss order then the trigger price set is mentioned here | Yes |
is_amo | AMO - It can be one of the following YES NO |
Yes |
stoploss | Set a difference from the entry price for stoploss. Use in case the product is OCO | Yes |
squareoff | Set a difference from the entry price for profit. Use in case the product is OCO | Yes |
trailing_ticks | Indicates the number of ticks if the order placed was a trailing order. se in case the product is OCO | Yes |
PlaceFOOptionsOrder
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/PlaceFOOptionsOrder
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/PlaceFOOptionsOrder
Request example :
{
"api_key":"781981bf5cc2662152dab1ed64e8ef30",
"api_secret":"02aa902dbe344f7a88af59e0aa7e5d01",
"data":
{
"stgy_name":"Options",
"spot_sym":"BANKNIFTY",
"expiry_dt":"211104",
"opt_type":"CE",
"transaction_type":"B",
"order_type":"MKT",
"quantity":"25",
"price":"0",
"trigger_price":"0",
"product":"MIS",
"strike_int":"100",
"offset":"10"
}
}
Response example :
{
"order_id": "200810000277991",
"stat": "Ok"
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
stgy_name | Strategy Name | Yes |
spot_sym | Trading Symbol | Yes |
expiry_dt | Expiry Date - [YY][M][DD] | Yes |
opt_type | CE PE |
Yes |
transaction_type | Transtaction Type | Yes |
order_type | Order Type - It can be one of the following MKT - refers to Market Order LMT - refers to Limit Order SL - refers to Stop Loss Limit SL-M - refers to Stop loss market |
Yes |
quantity | Quantity | Yes |
price | Price | Yes |
trigger_price | Trigger Price | Yes |
product | Shows if the order was either MIS - MIS Type CNC - CNC Type NRML - NRML Type CO - CO Type |
Yes |
strike_int | Strike Interval | Yes |
offset | Off Set | Yes |
ModifyOrder
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/ModifyOrder
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/ModifyOrder
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b70",
"api_secret":"5306433329e81ba41203653417063c",
"data":
{
"strg_name":"Test Strategy",
"order_id":"200810000277991",
"quantity":"1",
"order_type":"M",
"price":"0",
"trigger_price":"0",
"disclosed_quantity":"0"
}
}
Response example :
{
"order_id": "200810000277991",
"stat": "Ok"
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
order_id | the order id for which the order must be modified | Yes |
quantity | Quantity with which the order was placed | Yes |
order_type | Type of order. It can be one of the following M refers to market order L refers to Limit Order SL refers to Stop Loss Limit SL-M refers to Stop Loss Market |
Yes |
price | Price at which the order was placed | Yes |
trigger_price | If the order was a stop loss order then the trigger price set is mentioned here | Yes |
disclosed_quantity | The quantity that should be disclosed in the market depth | Yes |
CancelOrder
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/CancelOrder
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/CancelOrder
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b70",
"api_secret":"5306433329e81ba41203653417063c",
"data":
{
"order_id":"170831000041785"
}
}
Response example :
{
"code": 200,
"status": "OK",
"timestamp": "2017-08-31T06:06:00+00:00",
"message": "success",
"data": "Cancellation sent for [170831000041785,170831000041799,170831000041776,170831000041769]"
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
order_id | comma separated order ID assigned internally for the order placed | Yes |
Profile
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/Profile
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/Profile
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b70",
"api_secret":"5306433329e81ba41203653417063c"
}
Result Example:
{
"code":200,
"status":"OK",
"timestamp":"2017-07-18T10:32:02+05:30",
"message":"success",
"data":{
"client_id": "240001",
"name": "Raj Prakash",
"email": "raj.prakash@mymail.com",
"phone": "9820098200",
"exchanges_enabled":[
"BSE_EQ",
"NSE_EQ",
"NSE_FO",
"MCX_FO",
"NCD_FO",
"BCD_FO"
],
"products_enabled":[
"OCO",
"D",
"CO",
"I"
]
}
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
api_key | Algomojo API Key | Yes |
api_secret | Algomojo API Secret | Yes |
RESPONSE ATTRIBUTES
Attribute | Datatype | Description |
---|---|---|
client_id | string | Uniquely identifies the user |
name | string | Name of the user |
string | E-mail address of the user | |
phone | string | Phone number of the user |
exchanges_enabled | array | Lists the exchanges to which the user has access |
products_enabled | array | Lists the products types to which the user has access |
Balance
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/Balance
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/Balance
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b70",
"api_secret":"5306433329e81ba41203653417063c"
}
Response example :
{
"code": 200,
"status": "OK",
"timestamp": "2017-05-15T14:35:57+05:30",
"message": "success",
"data": {
"equity": {
"used_margin": 67.2125,
"payin_amount": 0,
"span_margin": 0,
"adhoc_margin": 0,
"notional_cash": 0,
"available_margin": 99320.78,
"exposure_margin": 0
},
"commodity": {
"used_margin": 0,
"payin_amount": 0,
"span_margin": 0,
"adhoc_margin": 0,
"notional_cash": 0,
"available_margin": 5200.45,
"exposure_margin": 0
}
}
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
api_key | Algomojo API Key | Yes |
api_secret | Algomojo API Secret | Yes |
RESPONSE ATTRIBUTES
Attribute | Datatype | Description |
---|---|---|
used_margin | number | Positive values denote the amount blocked into a Open order or position. Negative value denotes the amount being released. |
payin_amount | number | Instant payin will reflect here |
span_margin | number | Amount blocked on futures and options towards SPAN |
adhoc_margin | number | Payin amount credited through a manual process |
notional_cash | number | The amount maintained for withdrawal |
available_margin | number | Total margin available for trading |
exposure_margin | number | Amount blocked on futures and options towards Exposure |
Holdings
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/Holdings
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/Holdings
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b70",
"api_secret":"5306433329e81ba41203653417063c"
}
Response example:
{
"code": 200,
"status": "OK",
"timestamp": "2017-07-27T13:06:03+05:30",
"message": "success",
"data": [
{
"instrument": [
{
"exchange": "NSE_EQ",
"symbol": "ASHOKLEY",
"token": 212
},
{
"exchange": "BSE_EQ",
"symbol": "ASHOKLEY",
"token": 500477
}
],
"product": "D",
"collateral_type": "WC",
"cnc_used_quantity": 0,
"quantity": 10,
"collateral_qty": 0,
"haircut": 25,
"avg_price": "76"
}
]
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
api_key | Algomojo API Key | Yes |
api_secret | Algomojo API Secret | Yes |
RESPONSE ATTRIBUTES
Attributes | Datatype | Description |
---|---|---|
exchange | string | Exchange to which the holding is associated |
symbol | string | Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc |
token | number | Unique identifier of a security in BSE and NSE |
product | string | Shows if the order was either Intraday, Delivery, CO or OCO |
collateral_type | string | Category of collateral assigned by RMS |
cnc_used_quantity | number | Quantity either blocked towards open or completed order |
quantity | number | The total holding qty |
collateral_qty | number | Quantity marked as collateral by RMS on users request |
haircut | number | This is the haircut percentage applied from RMS (applicable incase of collateral) |
avg_price | number | It indicates the consolidated price across all the orders placed for the scrip. (Note: Corporate actions are not taken into consideration) |
Orders
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/Orders
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/Orders
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b7087",
"api_secret":"5306433329e81ba41203653417063c71"
}
Response example :
[
{
"exchange": "NSE_EQ",
"token": 2885,
"symbol": "RELIANCE",
"product": "I",
"order_type": "L",
"duration": "DAY",
"price": 1080,
"trigger_price": 0,
"quantity": 1,
"disclosed_quantity": 0,
"transaction_type": "B",
"average_price": 1080,
"traded_quantity": 1,
"message": "",
"exchange_order_id": "1100000000006972",
"parent_order_id": "NA",
"order_id": "170328000000030",
"exchange_time": "28-Mar-2017 12:42:42",
"time_in_micro": "1490697859120172",
"status": "complete",
"is_amo": false,
"valid_date": "--",
"order_request_id": "1"
}
]
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
api_key | Algomojo API Key | Yes |
api_secret | Algomojo API Secret | Yes |
RESPONSE ATTRIBUTES
Attributes | Datatype | Description |
---|---|---|
exchange | string | Exchange to which the order is associated |
token | number | Token number of the instrument |
symbol | string | Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc |
product | string | Shows if the order was either Intraday, Delivery, CoverOrder or OneCancelsOther |
order_type | string | Type of order. It can be one of the following M refers to market order L refers to Limit Order SL refers to Stop Loss Limit SL-M refers to Stop loss market |
duration | string | It can be one of the following DAY IOC GTD |
price | number | Price at which the order was placed |
trigger_price | number | If the order was a stop loss order then the trigger price set is mentioned here |
quantity | number | Quantity with which the order was placed |
disclosed_quantity | number | The quantity that should be disclosed in the market depth |
transaction_type | string | Indicates whether the order was a buy or sell order |
average_price | string | Average price at which the qty got traded |
traded_quantity | string | The total quantity traded from this particular order |
message | string | Indicates the reason when any order is rejected, not modified or cancelled |
exchange_order_id | string | Unique order ID assigned by the exchange for the order placed |
parent_order_id | string | In case the order is part of the second or third leg of a CO or OCO, the parent order ID is indicated here |
order_id | string | Unique order ID assigned internally for the order placed |
exchange_time | string | User readable time at which the order was placed or updated |
time_in_micro | string | Time in microseconds (Unix Epoch) at which the order was placed or updated |
status | string | Indicates the current status of the order. Valid order status’ are outlined in the table below |
is_amo | string | Indicates whether the order is an AMO order or not |
valid_date | string | If the order is GTD (Good-Till-Date), this shows the valid date |
order_request_id | string | Apart from 1st order it shows the count of how many requests were sent |
OrderHistory
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/OrderHistory
To get characters you need to make a POST call to the following url :
https:/upapi.algomojo.com/1.0/OrderHistory
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b7087",
"api_secret":"5306433329e81ba41203653417063c71",
"data":
{
"order_id": "170328000000030"
}
}
Response example :
{
"code": 200,
"status": "OK",
"timestamp": "2017-08-03T15:16:38+05:30",
"message": "success",
"data": [
{
"exchange": "NSE_EQ",
"token": 3045,
"symbol": "SBIN",
"product": "I",
"order_type": "M",
"duration": "DAY",
"price": 0,
"trigger_price": 0,
"quantity": 1,
"disclosed_quantity": 0,
"transaction_type": "B",
"average_price": 299.4,
"traded_quantity": 1,
"message": "",
"exchange_order_id": "1100000000062530",
"parent_order_id": "NA",
"order_id": "170803000000038",
"exchange_time": "03-Aug-2017 15:03:42",
"time_in_micro": "1501752667641223",
"status": "complete",
"is_amo": false,
"valid_date": "",
"fill_leg": "111",
"order_request_id": "1",
"report": "",
"text": ""
},
{
"exchange": "NSE_EQ",
"token": 3045,
"symbol": "SBIN",
"product": "I",
"order_type": "M",
"duration": "DAY",
"price": 0,
"trigger_price": 0,
"quantity": 1,
"disclosed_quantity": 1,
"transaction_type": "B",
"average_price": 0,
"traded_quantity": 0,
"message": "",
"exchange_order_id": "1100000000062530",
"parent_order_id": "NA",
"order_id": "170803000000038",
"exchange_time": "03-Aug-2017 15:03:42",
"time_in_micro": "1501752667639709",
"status": "open",
"is_amo": false,
"valid_date": "",
"fill_leg": "0",
"order_request_id": "1",
"report": "",
"text": ""
},
{
"exchange": "NSE_EQ",
"token": 3045,
"symbol": "SBIN",
"product": "I",
"order_type": "M",
"duration": "DAY",
"price": 0,
"trigger_price": 0,
"quantity": 1,
"disclosed_quantity": 1,
"transaction_type": "B",
"average_price": 0,
"traded_quantity": 0,
"message": "",
"exchange_order_id": "",
"parent_order_id": "NA",
"order_id": "170803000000038",
"exchange_time": "",
"time_in_micro": "1501752667600392",
"status": "open pending",
"is_amo": false,
"valid_date": "",
"fill_leg": "0",
"order_request_id": "1",
"report": "",
"text": ""
},
{
"exchange": "NSE_EQ",
"token": 3045,
"symbol": "SBIN",
"product": "I",
"order_type": "M",
"duration": "DAY",
"price": 0,
"trigger_price": 0,
"quantity": 1,
"disclosed_quantity": 1,
"transaction_type": "B",
"average_price": 0,
"traded_quantity": 0,
"message": "",
"exchange_order_id": "",
"parent_order_id": "NA",
"order_id": "170803000000038",
"exchange_time": "",
"time_in_micro": "1501752667308275",
"status": "validation pending",
"is_amo": false,
"valid_date": "",
"fill_leg": "0",
"order_request_id": "1",
"report": "",
"text": ""
},
{
"exchange": "NSE_EQ",
"token": 3045,
"symbol": "SBIN",
"product": "I",
"order_type": "M",
"duration": "DAY",
"price": 0,
"trigger_price": 0,
"quantity": 1,
"disclosed_quantity": 1,
"transaction_type": "B",
"average_price": 0,
"traded_quantity": 0,
"message": "",
"exchange_order_id": "",
"parent_order_id": "NA",
"order_id": "170803000000038",
"exchange_time": "",
"time_in_micro": "1501752667303641",
"status": "put order req received",
"is_amo": false,
"valid_date": "",
"fill_leg": "0",
"order_request_id": "1",
"report": "",
"text": ""
}
]
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
order_id | Order ID | Yes |
RESPONSE ATTRIBUTES
Attributes | Datatype | Description |
---|---|---|
exchange | string | Exchange to which the order is associated |
token | number | Token number of the instrument |
symbol | string | Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc |
product | string | Shows if the order was either Intraday, Delivery, CoverOrder or OneCancelsOther |
order_type | string | Type of order. It can be one of the following M refers to market order L refers to Limit Order SL refers to Stop Loss Limit SL-M refers to Stop loss market |
duration | string | It can be one of the following DAY IOC GTD |
price | number | Price at which the order was placed |
trigger_price | number | If the order was a stop loss order then the trigger price set is mentioned here |
quantity | number | Quantity with which the order was placed |
disclosed_quantity | number | The quantity that should be disclosed in the market depth |
transaction_type | string | Indicates whether the order was a buy or sell order |
average_price | string | Average price at which the qty got traded |
traded_quantity | string | The total quantity traded from this particular order |
message | string | Indicates the reason when any order is rejected, not modified or cancelled |
exchange_order_id | string | Unique order ID assigned by the exchange for the order placed |
parent_order_id | string | In case the order is part of the second or third leg of a CO or OCO, the parent order ID is indicated here |
order_id | string | Unique order ID assigned internally for the order placed |
exchange_time | string | User readable time at which the order was placed or updated |
time_in_micro | string | Time in microseconds (Unix Epoch) at which the order was placed or updated |
status | string | Indicates the current status of the order. Valid order status’ are outlined in the table below |
is_amo | string | Indicates whether the order is an AMO order or not |
valid_date | string | If the order is GTD (Good-Till-Date), this shows the valid date |
order_request_id | string | Apart from 1st order it shows the count of how many requests were sent |
Positions
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/Positions
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/Positions
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b7087",
"api_secret":"5306433329e81ba41203653417063c71"
}
Response example :
[
{
"exchange": "NSE_FO",
"product": "D",
"symbol": "NIFTY17AUG10100CE",
"token": 66416,
"buy_amount": 0,
"sell_amount": 0,
"buy_quantity": 0,
"sell_quantity": 0,
"cf_buy_amount": 0,
"cf_sell_amount": 751548.75,
"cf_buy_quantity": 0,
"cf_sell_quantity": 75,
"avg_buy_price": "",
"avg_sell_price": 108.6,
"net_quantity": -75,
"close_price": 108.6,
"last_traded_price": 128,
"realized_profit": "",
"unrealized_profit": -1455.0000000000005,
"cf_avg_price": "72.00"
}
]
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
api_key | Algomojo API Key | Yes |
api_secret | Algomojo API Secret | Yes |
Tradebook
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/Tradebook
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/Tradebook
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b7087",
"api_secret":"5306433329e81ba41203653417063c71"
}
Response example :
{
"code": 200,
"status": "OK",
"timestamp": "2017-08-03T15:24:06+05:30",
"message": "success",
"data": [
{
"exchange": "NSE_EQ",
"token": 3045,
"symbol": "SBIN",
"product": "I",
"order_type": "M",
"transaction_type": "B",
"traded_quantity": 1,
"exchange_order_id": "1100000000062530",
"order_id": "170803000000038",
"exchange_time": "03-Aug-2017 15:03:42",
"time_in_micro": "1501752667641223",
"traded_price": 299.4,
"trade_id": "50091502"
},
{
"exchange": "NSE_EQ",
"token": 3045,
"symbol": "SBIN",
"product": "I",
"order_type": "M",
"transaction_type": "B",
"traded_quantity": 1,
"exchange_order_id": "1100000000068410",
"order_id": "170803000000040",
"exchange_time": "03-Aug-2017 15:23:01",
"time_in_micro": "1501753826450445",
"traded_price": 294.55,
"trade_id": "50091780"
},
{
"exchange": "NSE_EQ",
"token": 694,
"symbol": "CIPLA",
"product": "I",
"order_type": "M",
"transaction_type": "B",
"traded_quantity": 1,
"exchange_order_id": "1000000000054988",
"order_id": "170803000000041",
"exchange_time": "03-Aug-2017 15:23:15",
"time_in_micro": "1501753840617453",
"traded_price": 559.7,
"trade_id": "75686"
}
]
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
api_key | Algomojo API Key | Yes |
api_secret | Algomojo API Secret | Yes |
RESPONSE ATTRIBUTES
Attributes | Datatype | Description |
---|---|---|
exchange | string | Exchange to which the order is associated |
token | number | Token number of the instrument |
symbol | string | Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc |
product | string | Shows if the order was either Intraday, Delivery, CO or OCO |
order_type | string | Type of order. It can be one of the following M refers to market order L refers to Limit Order SL refers to Stop Loss Limit SL-M refers to Stop loss market |
transaction_type | string | Indicates whether the order was a buy or sell order |
traded_quantity | string | The total quantity traded from this particular order |
exchange_order_id | string | Unique order ID assigned by the exchange for the order placed |
order_id | string | Unique order ID assigned internally for the order placed |
exchange_time | string | User readable time at when the trade occurred |
time_in_micro | string | Time in microseconds (Unix Epoch) when the trade occurred |
trade_id | string | Trade ID generated from exchange towards traded transaction |
traded_price | string | Price at which the traded quantity is traded |
Feed
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/Feed
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/Feed
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b7087",
"api_secret":"5306433329e81ba41203653417063c71",
"data": {
"exchange" : "nse_eq",
"symbol": "RELIANCE",
"type" : "full"
}
}
Response example :
If you request for LTP, the following will be the response
{
"code": 200,
"status": "OK",
"timestamp": "2017-05-15T16:45:12+05:30",
"message": "feed",
"data": {
"timestamp": 1494843956000,
"exchange": "NSE_EQ",
"symbol": "RELIANCE",
"ltp": 1344.1,
"close": 1350.45
}
}
If you request for Full, the following will be the response for indexes:
{
"code":200,
"status":"OK",
"timestamp":"2017-07-19T11:11:32+05:30",
"message":"feed",
"data":{
"timestamp":1454498203000,
"exchange":"NSE_INDEX",
"symbol":"NIFTY_100",
"ltp":7452.05,
"open":7482.5,
"high":7510.4,
"low":7441.5,
"close":7452.05,
"yearly_high":9105.4,
"yearly_low":7340.95
}
}
If you request for Full, the following will be the response for other scrips:
{
"code": 200,
"status": "OK",
"timestamp": "2017-05-15T15:10:42+05:30",
"message": "feed",
"data": {
"timestamp": 1494837991000,
"exchange": "NSE_FO",
"symbol": "NIFTY17MAYFUT",
"ltp": 9446.8,
"open": 9448,
"high": 9454.4,
"low": 9437,
"close": 9414.8,
"vtt": 2802525,
"atp": 9446.71,
"oi": 21256725,
"spot_price": 9442.15,
"total_buy_qty": 830925,
"total_sell_qty": 858375,
"lower_circuit": 8473.35,
"upper_circuit": 10356.3,
"bids": [
{
"quantity": 900,
"price": 9446.7,
"orders": 2
},
{
"quantity": 75,
"price": 9446.65,
"orders": 1
},
{
"quantity": 1050,
"price": 9446.6,
"orders": 4
},
{
"quantity": 150,
"price": 9446.55,
"orders": 1
},
{
"quantity": 75,
"price": 9446.1,
"orders": 1
}
],
"asks": [
{
"quantity": 450,
"price": 9447,
"orders": 1
},
{
"quantity": 450,
"price": 9447.3,
"orders": 1
},
{
"quantity": 900,
"price": 9447.4,
"orders": 1
},
{
"quantity": 75,
"price": 9447.45,
"orders": 1
},
{
"quantity": 75,
"price": 9447.55,
"orders": 1
}
],
"ltt": 1494837991000
}
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
exchange | Name of the exchange bse_index - BSE Index nse_index - NSE Index bse_eq - BSE Equity bcd_fo - BSE Currency Futures & Options nse_eq - NSE Equity nse_fo - NSE Futures & Options ncd_fo - NSE Currency Futures & Options mcx_fo - MCX Futures |
Yes |
symbol | Shows the trading symbol which could be a combination of symbol name, instrument, expiry date etc | Yes |
type | There are two ways in which you can request for feeds. ltp (default) full |
Yes |
RESPONSE ATTRIBUTES
For LTP
Attributes | Datatype | Description |
---|---|---|
timestamp | string | Time in milliseconds at which the feeds was updated |
exchange | string | Name of the exchange |
symbol | string | Shows the trading symbol |
ltp | number | LTP is the last traded price of symbol |
close | string | Close is the close price of the symbol from the previous session of trading |
For FULL (Index)
Attributes | Datatype | Description |
---|---|---|
timestamp | string | Time in milliseconds at which the feeds was updated |
exchange | string | Name of the exchange |
symbol | string | Shows the trading symbol |
ltp | number | LTP is the last traded price of symbol |
open | string | It will show the open price of the trading session |
high | string | This will show the high price of the trading session |
low | string | This will show the low price of the trading session |
close | string | Close is the close price of the symbol from the previous session of trading |
yearly_high | number | Indicates the highest value of the index in the current year |
yearly_low | number | Indicates the lowest value of the index in the current year |
For FULL (Index)
Attributes | Datatype | Description |
---|---|---|
timestamp | string | Time in milliseconds at which the feeds was updated |
exchange | string | Name of the exchange |
symbol | string | Shows the trading symbol |
ltp | number | LTP is the last traded price of symbol |
open | string | It will show the open price of the trading session |
high | string | This will show the high price of the trading session |
low | string | This will show the low price of the trading session |
close | string | Close is the close price of the symbol from the previous session of trading |
vtt | number | VTT is the volume traded today on symbol |
atp | number | It stands for average traded price for the entire quantity traded in the exchange |
oi | number | OI stands for open interest. It is applicable on future and option segments |
spot_price | number | It means the underlying price of a stock. It is applicable on future and option segments |
total_buy_qty | string | This show the total nos of bid quantity available for trading |
total_sell_qty | string | This show the total nos of ask quantity available for trading |
lower_circuit | number | Shows lower circuit of symbol |
upper_circuit | number | Shows upper circuit of symbol |
bid quantity | string | Bid quantity available for trading |
bid price | string | Price at which the Bid quantity is available |
bid orders | string | Number of orders requesting bids at this price |
ask quantity | string | Ask quantity available for trading |
ask price | string | Price at which the Ask quantity is available |
ask orders | string | Number of orders requesting asks at this price |
ltt | string | Time in milliseconds at which last trade happened |
Historical
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/Historical
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/Historical
Request example :
{
"api_key":"781981bf5cc2662152dab1ed64e8ef30",
"api_secret":"02aa902dbe344f7a88af59e0aa7e5d01",
"data":
{
"symbol":"RELIANCE",
"exchange":"NSE_EQ",
"interval":"1",
"start_date":"19-01-2021",
"end_date":"25-01-2021",
"format":"json"
}
}
Response example :
{
"code": 200,
"status": "OK",
"timestamp": "2021-01-28T12:56:41+05:30",
"message": "historical-data",
"data": [
"1611027900000,1995,2030.3,1995,2015,14708289",
"1611114300000,2019.7,2058,2001.4,2053,14219816",
"1611200700000,2081,2120,2075.55,2107.05,17797889",
"1611287100000,2111,2115,2035.8,2047.1,14009117",
"1611546300000,2029.75,2030.8,1933.2,1935,24749871"
]
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
exchange | name of the exchange bse_index - BSE Index nse_index - NSE Index bse_eq - BSE Equity bcd_fo - BSE Currency Futures & Options nse_eq - NSE Equity nse_fo - NSE Futures & Options ncd_fo - NSE Currency Futures & Options mcx_fo - MCX Futures |
Yes |
symbol | Trading symbol which could be a combination of symbol name, instrument, expiry date etc | Yes |
interval | optional (Default: 1day Allowed Values: 1 5 10 30 60 day week month |
No |
start_date | Default: 15 days before today Date format: DD-MM-YYYY eg: 20-01-2017 |
No |
end_date | Default: today Date format: DD-MM-YYYY eg: 20-01-2017 |
No |
format | The data format of the ohlc representation. csv json (default) |
No |
SecurityInfo
# Here is a curl example
curl \
-X POST https://upapi.algomojo.com/1.0/SecurityInfo
To get characters you need to make a POST call to the following url :
https://upapi.algomojo.com/1.0/SecurityInfo
Request example :
{
"api_key":"c1997d92a3bb556a67dca7d1446b7087",
"api_secret":"5306433329e81ba41203653417063c71",
"data": {
"exchange" : "nse_eq",
"symbol" : "RELIANCE"
}
}
Response example :
{
"code":200,
"status":"OK",
"timestamp":"2017-07-18T10:47:32+05:30",
"message":"success",
"data":{
"lower_circuit":1396.6,
"upper_circuit":1706.9,
"instrument_name":"EQUITY",
"gn":-1,
"gd":-1,
"pn":-1,
"pd":-1,
"circuit_limit":"1396.60-1706.90",
"status":"Eligible",
"yearly_low":930,
"yearly_high":1550,
"symbol":"RELIANCE",
"lot_size":1,
"exchange":"NSE_EQ",
"closing_price":1551.75,
"open_interest":"",
"tick_size":5,
"name":"RELIANCE INDUSTRIES LTD",
"token":2885,
"isin":"INE002A01018"
}
}
QUERY PARAMETERS
Request Parameter | Description | Mandatory |
---|---|---|
exchange | name of the exchange bse_index - BSE Index nse_index - NSE Index bse_eq - BSE Equity bcd_fo - BSE Currency Futures & Options nse_eq - NSE Equity nse_fo - NSE Futures & Options ncd_fo - NSE Currency Futures & Options mcx_fo - MCX Futures |
Yes |
symbol | Trading symbol which could be a combination of symbol name, instrument, expiry date etc | Yes |