Introduction

    API Endpoint

        https://smapi.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.

sm.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://smapi.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.


Exchanges


Possible Values Description
NSE NSE (National Stock Exchange)
MCX MCX (Multi Commodity Exchange)
BSE BSE (Bombay Stock Exchange)
NFO NFO (Futures and Options)
CDS CDS (Cash Derivatives)

Order Type


Possible Values Description
MKT Market Order
L Limit Order
SL Stop Loss Limit
SL-M Stop loss market

Product Types


Possible Values Description
CNC Cash and Carry(For equity only)
MIS Intraday - Applicable for all segments
NRML Normal - (Applicable only for derivatives)
CO Cover Order
BO Bracket Order

Order Types


Possible Values Description
1 Limit order
2 Market order
3 Stop order (SL-M)
4 Stoplimit order (SL-L)

transactionType


Possible Values Description
BUY Buy
SELL Sell

Order Status


Possible Values Description
pending Pending
executed Executed
rejected Rejected

Order Validity


Possible Values Description
DAY Day is an order type which is valid for the whole trading day and stays pending till it is executed in respective trading day.
IOC Immediate Or Cancel - order type is where once the user punches the order, the order hits the exchange and if not executed immediately, the order stands cancelled

PlaceOrder


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/PlaceOrder

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/PlaceOrder



Request example :

{
    "api_key":"03f06157d7faf1ea3b2c3be1fa0",
    "api_secret":"529d68b86de86b737975ab08de8b",
    "data": {
        "strg_name": "Test Strategy",
        "symbolName": "RELIANCE",
        "exchange": "NSE",
        "transactionType": "BUY",
        "orderType": "MKT",
        "quantity": "1",
        "disclosedQuantity": "1",
        "price": "0",
        "priceType": "LTP",
        "marketProtection": "3",
        "orderValidity": "DAY",
        "afterMarketOrderFlag": "NO",
        "productType": "MIS",
        "triggerPrice": "0.00"
    }
}

Response example :

{
  "serverTime": "12/12/19 16:20:11",
  "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
  "orderNumber": "191206000000079",
  "status": "Success",
  "statusMessage": "MIS Order request placed successfully",
  "exchangeOrderStatus": "complete",
  "rejectionReason": "--",
  "orderDetails": {
    "pendingQuantity": "0",
    "avgExecutionPrice": "1193.00",
    "orderPlacedBy": "DV9999",
    "tradingSymbol": "RELIANCE",
    "triggerPrice": "0.00",
    "exchange": "BSE",
    "totalQuantity": "1",
    "expiry": "--",
    "transactionType": "BUY",
    "productType": "MIS",
    "orderType": "L",
    "quantity": "1",
    "filledQuantity": "1",
    "orderPrice": "1240.00",
    "filledPrice": "1240.0",
    "exchangeOrderNo": "1565067682526005486",
    "orderValidity": "DAY",
    "orderTime": "12/12/2019 16:20:09"
  }
}
                

QUERY PARAMETERS

Name Type Description
body object none
symbolName string Trading Symbol Name of the scrip
exchange string Name of the exchange.Valid exchanges values (BSE/ NSE/ NFO/ MCX/ CDS).
If the user does not provide an exchange name, by default considered as NSE.
For trading with BSE, NFO, CDS and MCX, exchange is mandatory
transactionType string Transaction type should be BUY or SELL
orderType string Type of order. It can be one of the following, MKT - Market Order,L- Limit Order,SL - Stop Loss Limit,SL-M - Stop loss market
quantity string Quantity with which order is being placed
disclosedQuantity string If provided should be minimum of 10% of actual quantity
price string Price at which the order will be placed
priceType string Price type required to place an order. Valid price type - LTP/ATP , default is LTP. Applicable for BO orders only
marketProtection string Percentage of MarketProtection required for ordertype MKT/SL-M to limit loss due to market price changes against the price with which order is placed. Default value is 3%
orderValidity string Order validity can be DAY / IOC .Day is an order type which is valid for the whole trading day and stays pending till it is executed in respective trading day. IOC(Immediate Or Cancel) order type is where once the user punches the order, the order hits the exchange and if not executed immediately, the order stands cancelled
afterMarketOrderFlag string After Market Order Flag YES/NO
productType string Product Type of the order. It can be CNC (Cash and Carry)NRML (Normal),MIS (Intraday)
triggerPrice string The price at which an order should be triggered in case of SL, SL-M

PlaceMultiOrder


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/PlaceMultiOrder

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/PlaceMultiOrder



Request example :

{
    "api_key":"f08314a536d73093a074507bd7a4989f",
    "api_secret":"329721394eef6e41ac2728d75148d265",
    "data":
      {
          "orders" : 
            [
                {
                "order_refno":"1",
                "user_apikey":"f08314a536d73093a074507bd7a4989f",
                "api_secret":"329721394eef6e41ac2728d75148d265",
                "strg_name": "Test Strategy",
                "symbolName": "RELIANCE",
                "exchange": "NSE",
                "transactionType": "BUY",
                "orderType": "MKT",
                "quantity": "1",
                "disclosedQuantity": "1",
                "price": "0",
                "priceType": "LTP",
                "marketProtection": "3",
                "orderValidity": "DAY",
                "afterMarketOrderFlag": "NO",
                "productType": "MIS",
                "triggerPrice": "0.00"
                },
                {
                "order_refno":"2",
                "strg_name": "Test Strategy",
                "user_apikey":"f08314a536d73093a074507bd7a4989f",
                "api_secret":"329721394eef6e41ac2728d75148d265",
                "symbolName": "RELIANCE",
                "exchange": "NSE",
                "transactionType": "BUY",
                "orderType": "MKT",
                "quantity": "1",
                "disclosedQuantity": "1",
                "price": "0",
                "priceType": "LTP",
                "marketProtection": "3",
                "orderValidity": "DAY",
                "afterMarketOrderFlag": "NO",
                "productType": "MIS",
                "triggerPrice": "0.00"
                }
            ]
      }
}

Response example :

[
    {
      "serverTime": "12/12/19 16:20:11",
      "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
      "orderNumber": "191206000000079",
      "status": "Success",
      "statusMessage": "MIS Order request placed successfully",
      "exchangeOrderStatus": "complete",
      "rejectionReason": "--",
      "orderDetails": {
        "pendingQuantity": "0",
        "avgExecutionPrice": "1193.00",
        "orderPlacedBy": "DV9999",
        "tradingSymbol": "RELIANCE",
        "triggerPrice": "0.00",
        "exchange": "BSE",
        "totalQuantity": "1",
        "expiry": "--",
        "transactionType": "BUY",
        "productType": "MIS",
        "orderType": "L",
        "quantity": "1",
        "filledQuantity": "1",
        "orderPrice": "1240.00",
        "filledPrice": "1240.0",
        "exchangeOrderNo": "1565067682526005486",
        "orderValidity": "DAY",
        "orderTime": "12/12/2019 16:20:09"
      }
    },
    {
          "serverTime": "12/12/19 16:20:11",
          "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
          "orderNumber": "191206000000079",
          "status": "Success",
          "statusMessage": "MIS Order request placed successfully",
          "exchangeOrderStatus": "complete",
          "rejectionReason": "--",
          "orderDetails": {
            "pendingQuantity": "0",
            "avgExecutionPrice": "1193.00",
            "orderPlacedBy": "DV9999",
            "tradingSymbol": "IDFC",
            "triggerPrice": "0.00",
            "exchange": "BSE",
            "totalQuantity": "1",
            "expiry": "--",
            "transactionType": "BUY",
            "productType": "MIS",
            "orderType": "L",
            "quantity": "1",
            "filledQuantity": "1",
            "orderPrice": "1240.00",
            "filledPrice": "1240.0",
            "exchangeOrderNo": "1565067682526005486",
            "orderValidity": "DAY",
            "orderTime": "12/12/2019 16:20:09"
          }
        }
]
                

QUERY PARAMETERS

Request Parameter Description Mandatory
body object none
symbolName string Trading Symbol Name of the scrip
exchange string Name of the exchange.Valid exchanges values (BSE/ NSE/ NFO/ MCX/ CDS).
If the user does not provide an exchange name, by default considered as NSE.
For trading with BSE, NFO, CDS and MCX, exchange is mandatory
transactionType string Transaction type should be BUY or SELL
orderType string Type of order. It can be one of the following, MKT - Market Order,L- Limit Order,SL - Stop Loss Limit,SL-M - Stop loss market
quantity string Quantity with which order is being placed
disclosedQuantity string If provided should be minimum of 10% of actual quantity
price string Price at which the order will be placed
priceType string Price type required to place an order. Valid price type - LTP/ATP , default is LTP. Applicable for BO orders only
marketProtection string Percentage of MarketProtection required for ordertype MKT/SL-M to limit loss due to market price changes against the price with which order is placed. Default value is 3%
orderValidity string Order validity can be DAY / IOC .Day is an order type which is valid for the whole trading day and stays pending till it is executed in respective trading day. IOC(Immediate Or Cancel) order type is where once the user punches the order, the order hits the exchange and if not executed immediately, the order stands cancelled
afterMarketOrderFlag string After Market Order Flag YES/NO
productType string Product Type of the order. It can be CNC (Cash and Carry)NRML (Normal),MIS (Intraday)
triggerPrice string The price at which an order should be triggered in case of SL, SL-M

PlaceBOOrder


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/PlaceBOOrder

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/PlaceBOOrder



Request example :

{
    "api_key":"03f06157d7faf1ea3b2c93e5c3be1fa0",
    "api_secret":"529d68b86de86b7379a8c975ab08de8b",
    "data": {
        "strg_name": "Test Strategy",
        "symbolName": "RELIANCE",
        "exchange": "NSE",
        "transactionType": "BUY",
        "orderType": "L",
        "quantity": "1",
        "disclosedQuantity": "1",
        "price": "100",
        "priceType": "LTP",
        "orderValidity": "DAY",
        "productType": "BO",
        "squareOffValue": "5",
        "stopLossValue": "5",
        "valueType": "Ticks",
        "trailingStopLoss": "5"
    }
}

Response example :

{
    "serverTime": "23/09/21 12:01:24",
    "msgId": "e5192d08-3037-45a1-9ada-3311c2506be7",
    "orderNumber": "210923000085204",
    "status": "Success",
    "statusMessage": "Bracket Order request placed successfully",
    "exchangeOrderStatus": "REJECTED",
    "rejectionReason": "BO: Order price not within circuit limits",
    "orderDetails": {
        "pendingQuantity": "0",
        "avgExecutionPrice": "0.00",
        "orderPlacedBy": "--",
        "tradingSymbol": "RELIANCE-EQ",
        "triggerPrice": "0.00",
        "exchange": "NSE",
        "totalQuantity": "1",
        "transactionType": "BUY",
        "productType": "BO",
        "orderType": "L",
        "quantity": "1",
        "filledQuantity": "0",
        "orderPrice": "100.0",
        "filledPrice": "0.00",
        "orderValidity": "DAY",
        "orderTime": "23/09/2021 12:01:24"
    }
}
                

QUERY PARAMETERS

Attribute Data Type Description
body object none
symbolName strin Trading Symbol Name of the scrip
exchange string Name of the exchange.Valid exchanges values (NSE/ NFO/ MCX/ CDS).If the user does not provide an exchange name, by default considered as NSE.For trading with NFO, CDS and MCX, exchange is mandatory. BO orders not applicable to place in BSE exchange
transactionType string Transaction type should be BUY or SELL
orderType string Type of order. It should be L- Limit Order
quantity string Quantity with which order is being placed
stopPrice* float Default => 0
Provide valid price for Stop and Stoplimit orders
disclosedQuantity string If provided should be minimum of 10% of actual quantity
price string Price at which the order will be placed
priceType string Price type required to place an order. Valid price type - LTP/ATP , default is LTP. Applicable for BO orders only.
orderValidity string Order validity should be DAY .Day is an order type which is valid for the whole trading day and stays pending till it is executed in respective trading day
productType string Product Type of the order. It can be BO (Bracket Order))
squareOffValue string Price difference from entry price at which the order should be squared off to limit losses (eg: if Order price is 300. Profit target is 305. So target = 5). Applicable for BO orders only
stopLossValue string Stoploss price difference from the entry price at which the order should be squared off (eg: if Order price is 300. Stoploss target is 295. So stop loss = 5). Applicable for both BO & CO
valueType string ValueType required to place an Order. Applicable for both Stop Loss Value and Square off value. Valid value types - Absolute/Ticks. Default is Absolute.Applicable for BO orders only
trailingStopLoss string Incremental value set as % of change from the market price. Trailing stop moves as the price moves up. but, if the price starts to fall, the stop loss does not move (For example, if you buy a stock at Rs 100 and set a trailing stop loss value of Rs 2. If the stock price moves up to say Rs 105, the trailing stop loss value also would move up to be Rs 103 and stays Rs 2 less than the current market price. But if the stock price starts to fall and becomes Rs 103, trailing stop loss order will become a market order. Applicable for BO orders only

PlaceMultiBOOrder


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/PlaceMultiBOOrder

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/PlaceMultiBOOrder



Request example :

{
    "api_key":"f08314a536d73093a074507bd7a4989f",
    "api_secret":"329721394eef6e41ac2728d75148d265",
    "data":
      {
          "orders" : 
            [
                {
                "order_refno":"1",
                "user_apikey":"f08314a536d73093a074507bd7a4989f",
                "api_secret":"329721394eef6e41ac2728d75148d265",
                "strg_name": "Test Strategy",
                "symbolName": "RELIANCE",
                "exchange": "NSE",
                "transactionType": "BUY",
                "orderType": "L",
                "quantity": "1",
                "disclosedQuantity": "1",
                "price": "100",
                "priceType": "LTP",
                "orderValidity": "DAY",
                "productType": "BO",
                "squareOffValue": "5",
                "stopLossValue": "5",
                "valueType": "Ticks",
                "trailingStopLoss": "5"
                },
                {
                "order_refno":"2",
                "strg_name": "Test Strategy",
                "user_apikey":"f08314a536d73093a074507bd7a4989f",
                "api_secret":"329721394eef6e41ac2728d75148d265",
                "symbolName": "RELIANCE",
                "exchange": "NSE",
                "transactionType": "BUY",
                "orderType": "L",
                "quantity": "1",
                "disclosedQuantity": "1",
                "price": "100",
                "priceType": "LTP",
                "orderValidity": "DAY",
                "productType": "BO",
                "squareOffValue": "5",
                "stopLossValue": "5",
                "valueType": "Ticks",
                "trailingStopLoss": "5"
                }
            ]
      }
}

Response example :

[
    {
        "serverTime": "23/09/21 12:01:24",
        "msgId": "e5192d08-3037-45a1-9ada-3311c2506be7",
        "orderNumber": "210923000085204",
        "status": "Success",
        "statusMessage": "Bracket Order request placed successfully",
        "exchangeOrderStatus": "REJECTED",
        "rejectionReason": "BO: Order price not within circuit limits",
        "orderDetails": {
            "pendingQuantity": "0",
            "avgExecutionPrice": "0.00",
            "orderPlacedBy": "--",
            "tradingSymbol": "RELIANCE-EQ",
            "triggerPrice": "0.00",
            "exchange": "NSE",
            "totalQuantity": "1",
            "transactionType": "BUY",
            "productType": "BO",
            "orderType": "L",
            "quantity": "1",
            "filledQuantity": "0",
            "orderPrice": "100.0",
            "filledPrice": "0.00",
            "orderValidity": "DAY",
            "orderTime": "23/09/2021 12:01:24"
        }
    },
    {
        "serverTime": "23/09/21 12:01:24",
        "msgId": "e5192d08-3037-45a1-9ada-3311c2506be7",
        "orderNumber": "210923000085204",
        "status": "Success",
        "statusMessage": "Bracket Order request placed successfully",
        "exchangeOrderStatus": "REJECTED",
        "rejectionReason": "BO: Order price not within circuit limits",
        "orderDetails": {
            "pendingQuantity": "0",
            "avgExecutionPrice": "0.00",
            "orderPlacedBy": "--",
            "tradingSymbol": "RELIANCE-EQ",
            "triggerPrice": "0.00",
            "exchange": "NSE",
            "totalQuantity": "1",
            "transactionType": "BUY",
            "productType": "BO",
            "orderType": "L",
            "quantity": "1",
            "filledQuantity": "0",
            "orderPrice": "100.0",
            "filledPrice": "0.00",
            "orderValidity": "DAY",
            "orderTime": "23/09/2021 12:01:24"
        }
    }
]
                

QUERY PARAMETERS

Attribute Data Type Description
body object none
symbolName strin Trading Symbol Name of the scrip
exchange string Name of the exchange.Valid exchanges values (NSE/ NFO/ MCX/ CDS).If the user does not provide an exchange name, by default considered as NSE.For trading with NFO, CDS and MCX, exchange is mandatory. BO orders not applicable to place in BSE exchange
transactionType string Transaction type should be BUY or SELL
orderType string Type of order. It should be L- Limit Order
quantity string Quantity with which order is being placed
stopPrice* float Default => 0
Provide valid price for Stop and Stoplimit orders
disclosedQuantity string If provided should be minimum of 10% of actual quantity
price string Price at which the order will be placed
priceType string Price type required to place an order. Valid price type - LTP/ATP , default is LTP. Applicable for BO orders only.
orderValidity string Order validity should be DAY .Day is an order type which is valid for the whole trading day and stays pending till it is executed in respective trading day
productType string Product Type of the order. It can be BO (Bracket Order))
squareOffValue string Price difference from entry price at which the order should be squared off to limit losses (eg: if Order price is 300. Profit target is 305. So target = 5). Applicable for BO orders only
stopLossValue string Stoploss price difference from the entry price at which the order should be squared off (eg: if Order price is 300. Stoploss target is 295. So stop loss = 5). Applicable for both BO & CO
valueType string ValueType required to place an Order. Applicable for both Stop Loss Value and Square off value. Valid value types - Absolute/Ticks. Default is Absolute.Applicable for BO orders only
trailingStopLoss string Incremental value set as % of change from the market price. Trailing stop moves as the price moves up. but, if the price starts to fall, the stop loss does not move (For example, if you buy a stock at Rs 100 and set a trailing stop loss value of Rs 2. If the stock price moves up to say Rs 105, the trailing stop loss value also would move up to be Rs 103 and stays Rs 2 less than the current market price. But if the stock price starts to fall and becomes Rs 103, trailing stop loss order will become a market order. Applicable for BO orders only

ModifyOrder


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/ModifyOrder

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/ModifyOrder



Request example :

{
    "api_key":"03f06157d7faf1ea3b2c93e5c3be1fa0",
    "api_secret":"529d68b86de86b7379a8c975ab08de8b",
    "data": {
        "strg_name": "Test Strategy",
        "orderNumber": "210923000028886",
        "orderType": "L",
        "quantity": "3",
        "disclosedQuantity": "1",
        "orderValidity": "DAY",
        "price": "1240.00",
        "triggerPrice": "1070.00",
        "parentOrderId": "",
        "marketProtection": "5"
    }
}

Response example :

{
  "serverTime": "12/12/19 16:20:11",
  "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
  "orderNumber": "191206000000079",
  "status": "Success",
  "statusMessage": "MIS Order request placed successfully",
  "exchangeOrderStatus": "complete",
  "rejectionReason": "--",
  "orderDetails": {
    "pendingQuantity": "0",
    "avgExecutionPrice": "1193.00",
    "orderPlacedBy": "DV9999",
    "tradingSymbol": "RELIANCE",
    "triggerPrice": "0.00",
    "exchange": "BSE",
    "totalQuantity": "1",
    "expiry": "--",
    "transactionType": "BUY",
    "productType": "MIS",
    "orderType": "L",
    "quantity": "1",
    "filledQuantity": "1",
    "orderPrice": "1240.00",
    "filledPrice": "1240.0",
    "exchangeOrderNo": "1565067682526005486",
    "orderValidity": "DAY",
    "orderTime": "12/12/2019 16:20:09"
  }
}
                

QUERY PARAMETERS

Attribute Data Type Description
orderNumber string Unique Order identifier of the order which needs to be modified
body object Type of order. MKT - Market Order,L - Limit Order, SL - Stop Loss Limit, SL-M - Stop Loss Market
orderType string Type of order user has placed . It can be one of the following, MKT - Market Order,L- Limit Order,SL - Stop Loss Limit,SL-M - Stop loss market
quantity string Quantity of the order user wants to modify
disclosedQuantity string Quantity to disclose publicly
orderValidity string Order validity can be DAY or IOC
price string Price at which the order was placed
triggerPrice string The price at which an order should be triggered in case of SL, SL-M.
parentOrderId string ParentOrderId required to modify an order (applicable for BO orders only)
marketProtection string Percentage of MarketProtection required for ordertype MKT/SL-M to limit loss due to market price changes against the price with which order is placed. Default value is 3%.

CancelOrder


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/CancelOrder

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/CancelOrder



Request example :

{
    "api_key":"03f06157d7faf1ea3b2c93e5c3be1fa0",
    "api_secret":"529d68b86de86b7379a8c975ab08de8b",
    "data": {
        "strg_name": "Test Strategy",
        "orderNumber": "210923000028886"
    }
}

Response example :

{
  "serverTime": "12/12/19 16:20:11",
  "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
  "status": "Success",
  "orderNumber": "190722000000243",
  "statusMessage": "Order cancellation request placed successfully"
}
                

QUERY PARAMETERS

Attribute Data Type Description
orderNumber string The order identifier provided as an input which needs to be cancelled

Limits


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/Limits

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/Limits



Request example :

{
  "api_key":"c1997d92a3bb556a67dca7d1446b70",
  "api_secret":"5306433329e81ba41203653417063c"
}

Response example :

{
    "serverTime": "23/09/21 11:55:25",
    "msgId": "a7c3131b-d33b-458b-906e-f7949034b038",
    "status": "Success",
    "statusMessage": "User Limit details retrieved successfully",
    "equityLimit": {
        "grossAvailableMargin": "0",
        "payInToday": "0",
        "notionalCash": "0",
        "marginUsed": "0",
        "netAvailableMargin": "0"
    },
    "commodityLimit": {
        "grossAvailableMargin": "0",
        "payInToday": "0",
        "notionalCash": "0",
        "marginUsed": "0",
        "netAvailableMargin": "0"
    }
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
api_key Algomojo API Key Yes
api_secret Algomojo API Secret Yes

RESPONSE ATTRIBUTES

Attribute Datatype Description
serverTime string Time at Server
msgId string This is a unique identifier for every request into the system.
Please quote this identifier to the support team if you face issues with the API request.
status string Response status. Can be Success or Failure
statusMessage string status Message
equityLimit object none
grossAvailableMargin string Total amount of margins or balances available for trading. Opening balance for current day
payInToday string Current day deposited amount
notionalCash string Additional Limit that may or may not be given by RMS for Trading.
collateralMarginAgainstShares string Margin against shares offered by SAMCO to their clients for trading in stock and shares.
marginUsed string The amount deducted from opening balance for trading on the current day, and the amount blocked for creating a position when user places an order.
netAvailableMargin string Actual margin available with user for Trading after making all necessary adjustments.
commodityLimit object none
grossAvailableMargin string Total amount of margins or balances available for trading. Opening balance for current day
payInToday string Current day deposited amount
notionalCash string Additional Limit that may or may not be given by RMS for Trading.
collateralMarginAgainstShares string Margin against shares offered by SAMCO to their clients for trading in stock and shares.
marginUsed string The amount deducted from opening balance for trading on the current day, and the amount blocked for creating a position when user places an order.
netAvailableMargin string Actual margin available with user for Trading after making all necessary adjustments.

Holdings


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/Holdings

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/Holdings



Request example :

{
  "api_key":"c1997d92a3bb556a67dca7d1446b70",
  "api_secret":"5306433329e81ba41203653417063c"
}

Response example:

{
  "serverTime": "12/12/19 16:20:11",
  "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
  "status": "Success",
  "statusMessage": "Request successful",
  "holdingSummary": {
    "gainingTodayCount": "2",
    "losingTodayCount": "2",
    "totalGainAndLossAmount": "0.00",
    "dayGainAndLossAmount": "-4910.00",
    "portfolioValue": "343.80"
  },
  "holdingDetails": [
    {
      "averagePrice": "1560.15",
      "exchange": "BSE",
      "markToMarketPrice": "-182.70",
      "lastTradedPrice": "1,550.00",
      "previousClose": "1552.55",
      "productCode": "CNC",
      "symbolDescription": "RELIANCE INDUSTRIES LTD.",
      "tradingSymbol": "RELIANCE",
      "totalGainAndLoss": "0.00",
      "calculatedNetQuantity": "18.0",
      "holdingsQuantity": "3",
      "collateralQuantity": "2",
      "holdingsValue": "436.46",
      "isin": "INE917I01010",
      "sellableQuantity": "1",
      "totalMarketToMarketPrice": "0"
    }
  ]
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
api_key Algomojo API Key Yes
api_secret Algomojo API Secret Yes

RESPONSE ATTRIBUTES

Attributes Datatype Description
serverTime string Time at Server
msgId string This is a unique identifier for every request into the system. Please quote this identifier to the support team if you face issues with the API request
status string Response status. Can be Success or Failure
statusMessage string status Message
holdingSummary object none
gainingTodayCount string Count of scrips which are gaining in value in a trading day
losingTodayCount string Count of scrips which are losing in value in a trading day
totalGainAndLossAmount string Total amount of Gain / Loss for all existing positions since their creation
dayGainAndLossAmount string Amount of Gain / Loss for all positions on a specific trading day
portfolioValue string Value of the portfolio
holdingDetails [object] Details of the user holdings
averagePrice string Average trading price of the equity
exchange string Name of the exchange.Valid exchanges values (BSE/ NSE) If the user does not provide an exchange name, by default considered as NSE
markToMarketPrice string Price change between previous close price and current price
lastTradedPrice string Price at which last transaction/trade is done
previousClose string Previous close refers to the prior day's final price of security when the market officially closes for the day
productCode string Type of the product, allowable type is CNC
symbolDescription string Scrip Description
tradingSymbol string Trading Symbol of the scrip
totalGainAndLoss string Total Gain/Loss for all existing positions since their creation
calculatedNetQuantity string Quantity left after the day
holdingsQuantity string Currently holding(CNC) quantity
collateralQuantity string Quantity of loan against shares offered by SAMCO to their clients for trading in stock and shares
holdingsValue string Limit value of the available holdings
isin string The standard ISIN representing stocks uniquely at international level. It is same for every exchange
sellableQuantity string Quantity which is open for sale
totalMarketToMarketPrice string Total price change between previous close price and current price

OrderBook


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/OrderBook

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/OrderBook



Request example :

{
    "api_key":"c1997d92a3bb556a67dca7d1446b7087",
    "api_secret":"5306433329e81ba41203653417063c71"
}

Response example :
{
  "serverTime": "12/12/19 16:20:11",
  "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
  "status": "Success",
  "statusMessage": "Request successful",
  "orderBookDetails": [
    {
      "orderNumber": "191206000000079",
      "exchange": "BSE",
      "tradingSymbol": "RELIANCE",
      "symbolDescription": "RELIANCE INDUSTRIES LTD.",
      "transactionType": "BUY",
      "productCode": "MIS",
      "orderType": "L",
      "orderPrice": "1560.15",
      "quantity": "13",
      "disclosedQuantity": "1",
      "triggerPrice": "1090.00",
      "marketProtection": "3",
      "orderValidity": "DAY",
      "orderStatus": "Complete",
      "orderValue": "20281.95",
      "instrumentName": "NA",
      "orderTime": "06-Dec-2019 13:47:04",
      "userId": "DV99999",
      "filledQuantity": "13",
      "fillPrice": "1560.15",
      "averagePrice": "1560.15",
      "unfilledQuantity": "0",
      "exchangeOrderId": "1575608622401000995",
      "rejectionReason": "NA",
      "exchangeConfirmationTime": "06-Dec-2019 14:14:47",
      "cancelledQuantity": "0",
      "referenceLimitPrice": "0.00",
      "coverOrderPercentage": "0.00",
      "orderRemarks": "--",
      "exchangeOrderNumber": "1575608622401000995",
      "symbol": "52310_NFO",
      "displayStrikePrice": "0.00",
      "displayNetQuantity": "10",
      "status": "complete",
      "exchangeStatus": "complete",
      "expiry": "--",
      "pendingQuantity": "0",
      "instrument": "--",
      "scripName": "--",
      "totalQuanity": "13",
      "optionType": "--",
      "orderPlaceBy": "DV99999",
      "lotQuantity": "1",
      "parentOrderId": "200824000050316"
    }
  ]
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
api_key Algomojo API Key Yes
api_secret Algomojo API Secret Yes

RESPONSE ATTRIBUTES

Attributes Datatype Description
serverTime string Time at Server
msgId string This is a unique identifier for every request into the system. Please quote this identifier to the support team if you face issues with the API request
status string Response status. Can be Success or Failure
statusMessage string status Message
orderBookDetails [object] List of all orders with details during the day
orderNumber string Unique Order identifier generated after placing an order
exchange string Name of the exchange.
Valid exchanges values (BSE/ NSE/ NFO/ MCX/ CDS).
If the user does not provide an exchange name, by default considered as NSE.
For trading with BSE, NFO, CDS and MCX, exchange is mandatory.
tradingSymbol string Trading Symbol of the scrip
symbolDescription string Scrip description
transactionType string Type of the transaction, BUY / SELL
productCode string Product Type of order as placed by the user.
It can be CNC (Cash and Carry),BO (Bracket Order),CO (Cover Order),NRML (Normal),MIS (Intraday).
orderType string Type of order user has placed .
It can be one of the following, MKT - Market Order,L- Limit Order,SL - Stop Loss Limit,SL-M - Stop loss market.
orderPrice string The product type
quantity string Total Quantity as placed by the user
disclosedQuantity string If provided should be minimun of 10% of actual quantity
triggerPrice string The price at which an order should be triggered in case of SL, SL-M
marketProtection string Percentage of MarketProtection required for ordertype MKT/SL-M to limit loss due to market price changes against the price with which order is placed. Default value is 3%.
orderValidity string Order validity can be DAY / IOC
orderStatus string Status of the order at Exchange side, either executed successfully or pending or rejected
orderValue string Value of the order
instrumentName string Name of the instrument
orderTime string Order placement time
userId string The client Code provided to you by SAMCO after opening an account
filledQuantity string Quantity which is filled in a specific trade. Can be less than or equal to the total quantity
fillPrice string Price at which exchange has filled the order
averagePrice string Average trading price of the equity
unfilledQuantity string Quantity which is not filled in a partially filled order. Can be less than or equal to the total quantity
exchangeOrderId string Unique Order identifier generated from exchange
rejectionReason string If order is rejected, Cause of order Rejection
exchangeConfirmationTime string Order confirmation time at exchange
cancelledQuantity string cancelled quantity for partial cancelled orders
referenceLimitPrice string Limit Price reference
coverOrderPercentage string Percentage of cover order
orderRemarks string Remarks about order
exchangeOrderNumber string Unique Order identifier generated after placing an order
symbol string symbol about stock
displayStrikePrice string Shows the strick price
displayNetQuantity string Display the limit quantity of order
status string Status will display Executed/Pending/Rejected
exchangeStatus string ExchangeStatus will display Executed/Pending/Rejected
expiry string shows ExpiryDate of the stock
pendingQuantity string PendingQuantity will show pending quantity stock
instrument string Instrument is about the type of stock. FUT/OPT
scripName string Name of the scrip
totalQuanity string Total Quantity
optionType string Option Type (PE/CE).
orderPlaceBy string Client code of the user who placed the order
lotQuantity string lotQuantity represents the number of contracts contained in one derivative security.Applicable for F & O
parentOrderId string order Id of the parent order(it is applicable for only BO/CO orders)

Positions


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/Positions

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/Positions



Request example :

{
    "api_key":"03f06157d7faf1ea3b2c93e5c3be1fa0",
    "api_secret":"529d68b86de86b7379a8c975ab08de8b",
    "data": {
        "pos_type":"NET"
    }
}

Response example :

{
  "serverTime": "12/12/19 16:20:11",
  "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
  "status": "Success",
  "statusMessage": "Request successful",
  "positionSummary": {
    "gainingTodayCount": "2",
    "losingTodayCount": "2",
    "totalGainAndLossAmount": "0.00",
    "dayGainAndLossAmount": "-4910.00"
  },
  "positionDetails": [
    {
      "averagePrice": "1560.15",
      "exchange": "BSE",
      "markToMarketPrice": "-182.70",
      "lastTradedPrice": "1,550.00",
      "previousClose": "1552.55",
      "productCode": "CNC",
      "symbolDescription": "RELIANCE INDUSTRIES LTD.",
      "tradingSymbol": "RELIANCE",
      "calculatedNetQuantity": "18.0",
      "averageBuyPrice": "1560.15",
      "averageSellPrice": "0.00",
      "boardLotQuantity": "1",
      "boughtPrice": "28082.70",
      "buyQuantity": "18",
      "carryForwardQuantity": "0",
      "carryForwardValue": "0.00",
      "multiplier": "1",
      "netPositionValue": "-182.70",
      "netQuantity": "18",
      "netValue": "-182.70",
      "positionType": "DAY",
      "positionConversions": "CNC, NRML",
      "soldValue": "0.00",
      "transactionType": "BUY",
      "realizedGainAndLoss": "0.00",
      "unrealizedGainAndLoss": "-182.70",
      "companyName": "RELIANCE INDUSTRIES LTD.",
      "expiryDate": "--",
      "optionType": "--"
    }
  ]
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
api_key Algomojo API Key Yes
api_secret Algomojo API Secret Yes

RESPONSE ATTRIBUTES

Attributes Datatype Description
serverTime string Time at Server.
msgId string This is a unique identifier for every request into the system. Please quote this identifier to the support team if you face issues with the API request.
status string Response status. Can be Success or Failure
statusMessage string status Message
positionSummary object none
gainingTodayCount string Count of scrips which are gaining in value in a trading day
losingTodayCount string Count of scrips which are losing in value in a trading day
totalGainAndLossAmount string Total amount of Gain / Loss for all existing positions since their creation
dayGainAndLossAmount string Amount of Gain / Loss for all positions on a specific trading day
positionDetails [object] Details of Day/Net positions as queried
averagePrice string Average trading price of the equity
exchange string Name of the exchange.Valid exchanges values (BSE/ NSE) If the user does not provide an exchange name, by default considered as NSE.
markToMarketPrice string Price change between previous close price and current price
lastTradedPrice string Price at which last transaction/trade is done
previousClose string Previous close refers to the prior day's final price of security when the market officially closes for the day.
productCode string Type of the product, allowable type is CNC
symbolDescription string Scrip Description
tradingSymbol string Symbol name of the scrip.
calculatedNetQuantity string Quantity left after the day
averageBuyPrice string Average price at which the quantities were bought
averageSellPrice string Average price at which the quantities were sold
boardLotQuantity string The standardized number of shares decided by the exchange as a trading unit
boughtPrice string Price at which quantities were bought during the day
buyQuantity string Total quantity brought and added to the position during the day
carryForwardQuantity string Quantity bought or sold in previous session
carryForwardValue string Net value of the position in previous session
multiplier string The lot size multiplier used to calculate Profit and Loss
netPositionValue string Net value of the position during the day
netQuantity string Limit quantity of the position
netValue string Net value of the bought quantities
positionType string Type of the position, Ex -Day/Net
positionConversions [string] Different Product types the user can Convert an existing position to
soldValue string Total value of sold quantities
transactionType string Type of the transaction, BUY / SELL.
realizedGainAndLoss string The Profit and Loss returns from a closed position
unrealizedGainAndLoss string The Profit and Loss returns from a open position
companyName string Full name of the trading company
expiryDate string Expiry date of the scrip
optionType string Option Type (PE/CE).

TradeBook


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/TradeBook

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/TradeBook



Request example :

{
    "api_key":"c1997d92a3bb556a67dca7d1446b7087",
    "api_secret":"5306433329e81ba41203653417063c71"
}

Response example :

{
  "serverTime": "12/12/19 16:20:11",
  "msgId": "786cdd94-2fc9-4c38-8f14-672ec64dd032",
  "status": "Success",
  "statusMessage": "Request successful",
  "tradeBookDetails": [
    {
      "orderNumber": "191206000000079",
      "exchange": "BSE",
      "tradingSymbol": "RELIANCE",
      "symbolDescription": "RELIANCE INDUSTRIES LTD.",
      "transactionType": "BUY",
      "productCode": "MIS",
      "orderType": "L",
      "orderPrice": "1560.15",
      "quantity": "13",
      "disclosedQuantity": "1",
      "triggerPrice": "0.00",
      "marketProtection": "3",
      "orderValidity": "DAY",
      "orderStatus": "Complete",
      "orderValue": "20281.95",
      "instrumentName": "NA",
      "orderTime": "06-Dec-2019 13:47:04",
      "userId": "DV99999",
      "filledQuantity": "13",
      "unfilledQuantity": "0",
      "exchangeConfirmationTime": "05:06:12",
      "coverOrderPercentage": "%",
      "exchangeOrderNumber": "1571202357797000054",
      "tradeNumber": "195300",
      "tradePrice": "1560.15",
      "tradeDate": "06DEC2019",
      "tradeTime": "02:14:47 PM",
      "strikePrice": "800.00",
      "optionType": "XX",
      "lastTradePrice": "2,077.00",
      "expiry": "NA"
    }
  ]
}
                

QUERY PARAMETERS

Request Parameter Description Mandatory
api_key Algomojo API Key Yes
api_secret Algomojo API Secret Yes

RESPONSE ATTRIBUTES

Attributes Datatype Description
serverTime string Time at Server.
msgId string This is a unique identifier for every request into the system. Please quote this identifier to the support team if you face issues with the API request.
status string Response status. Can be Success or Failure
statusMessage string status Message
tradeBookDetails [object] Get list of TradeBookEntries.
orderNumber string Unique Order identifier generated after placing an order
exchange string Name of the exchange.Valid exchanges values (BSE/ NSE/ NFO/ MCX/ CDS).If the user does not provide an exchange name, by default considered as NSE.For trading with BSE, NFO, CDS and MCX, exchange is mandatory.
tradingSymbol string Trading Symbol of the scrip.
symbolDescription string Scrip description
transactionType string Type of the transaction, BUY / SELL.
productCode string Product Type of order as placed by the user. It can be CNC (Cash and Carry),BO (Bracket Order),CO (Cover Order),NRML (Normal),MIS (Intraday).
orderType string Type of order user has placed . It can be one of the following, MKT - Market Order,L- Limit Order,SL - Stop Loss Limit,SL-M - Stop loss market.
orderPrice string Limit price of a particular order
quantity string It is the order quantity
disclosedQuantity string Quantity to disclose to public in the market
triggerPrice string The price at which an order should be triggered in case of SL, SL-M.
marketProtection string Percentage of MarketProtection required for ordertype MKT/SL-M to limit loss due to market price changes against the price with which order is placed. Default value is 3%.
orderValidity string Order validity can be DAY / IOC
orderStatus string Status of the order at Exchange side, either executed successfully or pending or rejected
orderValue string Value of the order
instrumentName string Name of the instrument
orderTime string Order placement time
userId string The client Code provided to you by SAMCO after opening an account.
filledQuantity string Quantity which is filled in a specific trade. Can be less than or equal to the total quantity
unfilledQuantity string Quantity which is not filled in a partially filled order. Can be less than or equal to the total quantity
exchangeConfirmationTime string Order confirmation time at exchange
coverOrderPercentage string Percentage of cover order
exchangeOrderNumber string Unique Order identifier generated after placing an order.
tradeNumber string Unique trade identifier generated for every trade.
tradePrice string Price of a trade.
tradeDate string Date of a trade.
tradeTime string Time of a trade.
strikePrice string The strike price is the predetermined price at which a put buyer can sell the underlying asset.
optionType string Option Type (PE/CE).
lastTradePrice string Price at which last transaction/trade is done
expiry string Shows expiry date of a trading symbol.

fetchtoken


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/fetchtoken

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/fetchtoken



Request example :

{
    "api_key":"03f06157d7faf1ea3b2c93e5c3be1fa0",
    "api_secret":"529d68b86de86b7379a8c975ab08de8b",
    "data": {
        "s":"RELIANCE"
    }
}

Response example :

{
    "status": true,
    "statusMessage": "SUCCESS",
    "errorcode": "",
    "data": {
        "token": "500325_BSE",
        "symbol": "RELIANCE",
        "trading_symbol": "RELIANCE"
    }
}

                

QUERY PARAMETERS

Request Parameter Description Mandatory
s Symbol Name (As per Watchlist in the fy.algomojo.com) Yes

RESPONSE ATTRIBUTES

Attributes Datatype Description
token string symbol token
tradingsymbol string Trading Symbol
symbol string Symbol Name

GetQuote


# Here is a curl example
curl \
-X POST https://smapi.algomojo.com/1.0/GetQuote

                

To get characters you need to make a POST call to the following url :
https://smapi.algomojo.com/1.0/GetQuote



Request example :

{
    "api_key":"03f06157d7faf1ea3b2c93e5c3be1fa0",
    "api_secret":"529d68b86de86b7379a8c975ab08de8b",
    "data": {
        "symbol":"RELIANCE"
    }
}

Response example :

{
    "serverTime": "23/09/21 12:09:53",
    "msgId": "0d74acc0-1dde-4073-be87-11ef704ce5af",
    "status": "Success",
    "statusMessage": "Quote details retrieved successfully",
    "symbolName": "RELIANCE",
    "tradingSymbol": "RELIANCE-EQ",
    "exchange": "NSE",
    "companyName": "RELIANCE INDUSTRIES LTD",
    "lastTradedTime": "23/09/2021 12:09:53",
    "lastTradedPrice": "2468.50",
    "previousClose": "2430.50",
    "changeValue": "38.00",
    "changePercentage": "1.56",
    "lastTradedQuantity": "4",
    "lowerCircuitLimit": "2187.45",
    "upperCircuitLimit": "2673.55",
    "averagePrice": "2461.42",
    "openValue": "2447.40",
    "highValue": "2474.35",
    "lowValue": "2445.50",
    "closeValue": "2430.50",
    "totalBuyQuantity": "210615",
    "totalSellQuantity": "591183",
    "totalTradedValue": "676.30099 (Crs)",
    "totalTradedVolume": "2747605",
    "yearlyHighPrice": "2480.00",
    "yearlyLowPrice": "1830.00",
    "tickSize": "0.05",
    "bestBids": [
        {
            "number": "1",
            "quantity": "1",
            "price": "2468.15"
        },
        {
            "number": "2",
            "quantity": "308",
            "price": "2468.10"
        },
        {
            "number": "3",
            "quantity": "10",
            "price": "2468.05"
        },
        {
            "number": "4",
            "quantity": "288",
            "price": "2468.00"
        },
        {
            "number": "5",
            "quantity": "40",
            "price": "2467.85"
        }
    ],
    "bestAsks": [
        {
            "number": "1",
            "quantity": "25",
            "price": "2468.50"
        },
        {
            "number": "2",
            "quantity": "105",
            "price": "2468.55"
        },
        {
            "number": "3",
            "quantity": "180",
            "price": "2468.60"
        },
        {
            "number": "4",
            "quantity": "274",
            "price": "2468.70"
        },
        {
            "number": "5",
            "quantity": "780",
            "price": "2467.85"
        }
    ],
    "listingId": "2885_NSE"
}

                

QUERY PARAMETERS

Request Parameter Description Mandatory
symbol Symbol Name (As per Watchlist in the fy.algomojo.com) Yes
exchange Exchange Name Yes

RESPONSE ATTRIBUTES

Attributes Datatype Description
s string ok / error
ch float Change value
chp string Percentage of change between the current value and the previous day's market close
ip string Last traded price
spread float Difference between lowest asking and highest bidding price
ask float Asking price for the symbol
bid float Bidding price for the symbol
open_price float Price at market opening time
high_price float Highest price for the day
low_price float Lowest price for the day
volume int Volume traded
short_name string Short name for the symbol Eg: “SBIN-EQ”
exchange string Name of the exchange. Eg: “NSE” or “BSE”
description string Description of the symbol
original_name string Original name of the symbol name provided by the use
symbol string Symbol name provided by the user
tt int Today’s time
cmd dict Current time, open, high, low price and volume with
HH:MM timestamp