For the complete documentation index, see llms.txt. This page is also available as Markdown.

Tradebook

Get all executed trades for the current trading day.

Endpoint URL

Local Host   :  POST http://127.0.0.1:5000/api/v1/tradebook
Ngrok Domain :  POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/tradebook
Custom Domain:  POST https://<your-custom-domain>/api/v1/tradebook

Sample API Request

{
  "apikey": "<your_app_apikey>"
}

Sample cURL Request

curl -X POST http://127.0.0.1:5000/api/v1/tradebook \
  -H 'Content-Type: application/json' \
  -d '{
  "apikey": "<your_app_apikey>"
}'

Sample API Response

Request Body

Parameter
Description
Mandatory/Optional
Default Value

apikey

Your OpenAlgo API key

Mandatory

-

Response Fields

Field
Type
Description

status

string

"success" or "error"

data

array

Array of trade objects

Trade Object Fields

Field
Type
Description

orderid

string

Order ID that generated this trade

symbol

string

Trading symbol

exchange

string

Exchange code

action

string

BUY or SELL

quantity

number

Traded quantity

average_price

number

Execution price

product

string

MIS, CNC, NRML

timestamp

string

Trade execution time

trade_value

number

Total trade value (quantity × price)

Notes

  • Contains only executed trades (not pending orders)

  • A single order may have multiple trades (partial fills)

  • trade_value is the monetary value of the trade

  • Use for trade reconciliation and P&L calculation

  • Trades are sorted by execution time

Difference: OrderBook vs TradeBook

Aspect
OrderBook
TradeBook

Contains

All orders (including pending)

Only executed trades

Multiple entries

One per order

One per fill (partial fills)

Shows

Order status

Execution details


Back to: API Documentation

Last updated