Skip to main content
The REST API is in beta. This endpoint’s response shape may change.
Returns a paginated list of trades for a brokerage connection. Trades are fetched live from the brokerage provider. No investment data is stored on Redbark servers.
This endpoint requires a Pro plan subscription. Requests from Starter plan API keys return a 403 error with code pro_required.

Request

GET /v1/trades

Headers

HeaderRequiredDescription
AuthorizationYesBearer rbk_live_...

Query parameters

ParameterTypeRequiredDefaultDescription
connectionIdstringYesBrokerage connection to fetch trades from
accountIdstringNoAll accountsFilter to a specific brokerage account
fromstringNoAll historyStart date (YYYY-MM-DD or ISO 8601)
tostringNoNowEnd date (YYYY-MM-DD or ISO 8601)
limitintegerNo200Maximum items to return (1 to 500)
offsetintegerNo0Number of items to skip
connectionId must refer to a brokerage connection. Passing a banking connection ID returns a 400 error. Use the List Connections endpoint to find your brokerage connection IDs.

Response

{
  "data": [
    {
      "id": "trade_abc123",
      "accountId": "acc_abc123",
      "accountName": "Trading Account",
      "symbol": "VAS.AX",
      "name": "Vanguard Australian Shares ETF",
      "type": "buy",
      "quantity": "50.0000",
      "price": "89.75",
      "currency": "AUD",
      "totalAmount": "4487.50",
      "fees": "9.50",
      "tradeDate": "2026-03-15",
      "settlementDate": "2026-03-17",
      "description": null
    },
    {
      "id": "trade_def456",
      "accountId": "acc_abc123",
      "accountName": "Trading Account",
      "symbol": "CBA.AX",
      "name": "Commonwealth Bank of Australia",
      "type": "sell",
      "quantity": "20.0000",
      "price": "142.30",
      "currency": "AUD",
      "totalAmount": "2846.00",
      "fees": "9.50",
      "tradeDate": "2026-03-10",
      "settlementDate": "2026-03-12",
      "description": null
    }
  ],
  "pagination": {
    "total": -1,
    "limit": 200,
    "offset": 0,
    "hasMore": true
  }
}

Trade object

FieldTypeDescription
idstringUnique trade identifier
accountIdstringID of the brokerage account
accountNamestringAccount display name
symbolstringTicker symbol (e.g. VAS.AX, AAPL)
namestring | nullSecurity name
typestringTrade type (e.g. buy, sell)
quantitystringNumber of units traded
pricestringPrice per unit at execution
currencystringCurrency code (e.g. AUD, USD)
totalAmountstringTotal value of the trade
feesstring | nullBrokerage fees charged
tradeDatestringDate the order was executed
settlementDatestring | nullDate the trade settled
descriptionstring | nullAdditional description from the broker, if any
All monetary and quantity fields are strings to preserve decimal precision. Parse them as decimals in your application.

Pagination object

FieldTypeDescription
totalintegerTotal number of matching trades. Returns -1 when hasMore is true (the total is not known until all pages have been fetched).
limitintegerLimit applied to this request
offsetintegerOffset applied to this request
hasMorebooleantrue if more items exist beyond this page

Error responses

StatusWhen
400Missing connectionId, invalid date format, or connection is not a brokerage
403API key is not on the Pro plan
404Connection or account not found, or does not belong to you
503Brokerage provider temporarily unavailable. Retry later.

Date validation

The from and to parameters accept:
  • Date strings: 2026-03-01
  • Full ISO 8601: 2026-03-01T00:00:00Z
Invalid formats return a 400 with details:
{
  "error": {
    "message": "Invalid date parameters",
    "details": [
      "from: Must be a valid ISO 8601 date string (YYYY-MM-DD or YYYY-MM-DDTHH:mm:ssZ)"
    ]
  }
}

Examples

All trades for a connection

curl -H "Authorization: Bearer rbk_live_..." \
  "https://api.redbark.co/v1/trades?connectionId=conn_abc123"

Filter by date range

curl -H "Authorization: Bearer rbk_live_..." \
  "https://api.redbark.co/v1/trades?connectionId=conn_abc123&from=2026-01-01&to=2026-03-31"

Paginate

curl -H "Authorization: Bearer rbk_live_..." \
  "https://api.redbark.co/v1/trades?connectionId=conn_abc123&limit=50&offset=50"

Python: fetch all pages

import requests

API_KEY = "rbk_live_..."
BASE = "https://api.redbark.co"

all_trades = []
offset = 0
limit = 200

while True:
    resp = requests.get(
        f"{BASE}/v1/trades",
        headers={"Authorization": f"Bearer {API_KEY}"},
        params={
            "connectionId": "conn_abc123",
            "from": "2026-01-01",
            "to": "2026-03-31",
            "limit": limit,
            "offset": offset,
        },
    )
    data = resp.json()
    all_trades.extend(data["data"])

    if not data["pagination"]["hasMore"]:
        break
    offset += limit

print(f"Fetched {len(all_trades)} trades")

JavaScript: fetch all pages

const API_KEY = "rbk_live_...";
const BASE = "https://api.redbark.co";

const allTrades = [];
let offset = 0;
const limit = 200;

while (true) {
  const params = new URLSearchParams({
    connectionId: "conn_abc123",
    from: "2026-01-01",
    to: "2026-03-31",
    limit: String(limit),
    offset: String(offset),
  });

  const resp = await fetch(`${BASE}/v1/trades?${params}`, {
    headers: { Authorization: `Bearer ${API_KEY}` },
  });
  const { data, pagination } = await resp.json();

  allTrades.push(...data);

  if (!pagination.hasMore) break;
  offset += limit;
}

console.log(`Fetched ${allTrades.length} trades`);