Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.redbark.co/llms.txt

Use this file to discover all available pages before exploring further.

The REST API is in beta. This endpoint’s response shape may change.
Returns a list of current holdings for a brokerage connection. Holdings are fetched live from the brokerage provider. No investment data is stored on Redbark servers.
This endpoint requires a Professional plan subscription. Saver-plan API keys get a generic 403 (API access requires a Developer or Professional plan). Developer-plan keys get a 403 with "code": "professional_required" specifically for this endpoint.

Request

GET /v1/holdings

Headers

HeaderRequiredDescription
AuthorizationYesBearer YOUR_API_KEY

Query parameters

ParameterTypeRequiredDescription
connectionIdstringYesBrokerage connection to fetch holdings from
accountIdstringNoFilter to a specific brokerage account. Defaults to all accounts on the connection.
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

Responses are cached at the edge for 10 minutes per key+connection.
{
  "data": [
    {
      "id": "abc123def456ghi789jkl012",
      "accountId": "d4e5f6a7-b8c9-0123-d4e5-f6a7b8c90123",
      "accountName": "Trading Account",
      "symbol": "VAS.AX",
      "name": "Vanguard Australian Shares ETF",
      "exchange": "ASX",
      "currency": "AUD",
      "quantity": "150.0000",
      "averagePrice": "85.50",
      "currentPrice": "92.30",
      "marketValue": "13845.00",
      "unrealizedPnl": "1020.00"
    },
    {
      "id": "mno345pqr678stu901vwx234",
      "accountId": "d4e5f6a7-b8c9-0123-d4e5-f6a7b8c90123",
      "accountName": "Trading Account",
      "symbol": "AAPL",
      "name": "Apple Inc.",
      "exchange": "NASDAQ",
      "currency": "USD",
      "quantity": "25.0000",
      "averagePrice": "178.20",
      "currentPrice": "195.40",
      "marketValue": "4885.00",
      "unrealizedPnl": "430.00"
    }
  ]
}

Holding object

FieldTypeDescription
idstringOpaque holding identifier from the brokerage provider
accountIdstringUUID of the brokerage account this holding belongs to
accountNamestringAccount display name
symbolstringTicker symbol (e.g. AAPL, VAS.AX)
namestring | nullSecurity name
exchangestring | nullExchange the security is listed on (e.g. ASX, NASDAQ)
currencystringCurrency code (e.g. AUD, USD)
quantitystringNumber of units held (decimal string; supports fractional shares)
averagePricestring | nullAverage cost basis per unit
currentPricestring | nullLatest market price per unit
marketValuestring | nullCurrent total value of the position
unrealizedPnlstring | nullUnrealised gain or loss since purchase
All monetary and quantity fields are strings to preserve decimal precision. Parse them as decimals in your application.

Error responses

StatusWhen
400Missing connectionId, or connection is not a brokerage
403API access requires a Developer or Professional plan (Saver), or professional_required for brokerage endpoints (Developer plan on a brokerage endpoint)
404Connection or account not found, or does not belong to you
503Brokerage provider temporarily unavailable. Retry later.

Examples

All holdings for a brokerage connection

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.redbark.co/v1/holdings?connectionId=e8f1a2b3-7c4d-5e6f-8a9b-0c1d2e3f4a5b"

Filter to a specific account

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.redbark.co/v1/holdings?connectionId=e8f1a2b3-7c4d-5e6f-8a9b-0c1d2e3f4a5b&accountId=d4e5f6a7-b8c9-0123-d4e5-f6a7b8c90123"

Python

import requests

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

resp = requests.get(
    f"{BASE}/v1/holdings",
    headers={"Authorization": f"Bearer {API_KEY}"},
    params={"connectionId": "e8f1a2b3-7c4d-5e6f-8a9b-0c1d2e3f4a5b"},
)
holdings = resp.json()["data"]

for h in holdings:
    print(f"{h['symbol']}: {h['quantity']} @ {h['currentPrice']} ({h['currency']})")

JavaScript

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

const params = new URLSearchParams({
  connectionId: "conn_abc123",
});

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

for (const h of holdings) {
  console.log(`${h.symbol}: ${h.quantity} @ ${h.currentPrice} (${h.currency})`);
}