cURL
#!/bin/sh
# getAccountBalances: Get your balance on every venue. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base.
curl -sS "${TRENDLINE_API_BASE:-https://systems.trendlinelabs.ai}/public/v1/account/balances" \
-H "X-Client-Id: $TRENDLINE_CLIENT_ID" \
-H "X-Api-Key: $TRENDLINE_API_KEY" \
-H "X-Api-Secret: $TRENDLINE_API_SECRET""""getAccountBalances: Get your balance on every venue. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base."""
import os
import requests
BASE = os.environ.get("TRENDLINE_API_BASE", "https://systems.trendlinelabs.ai")
HEADERS = {"X-Client-Id": os.environ["TRENDLINE_CLIENT_ID"], "X-Api-Key": os.environ["TRENDLINE_API_KEY"],
"X-Api-Secret": os.environ["TRENDLINE_API_SECRET"]}
r = requests.get(f"{BASE}/public/v1/account/balances", params={}, headers=HEADERS, timeout=10)
r.raise_for_status()
print(r.json())
// getAccountBalances: Get your balance on every venue. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base.
const BASE = process.env.TRENDLINE_API_BASE ?? "https://systems.trendlinelabs.ai";
const HEADERS = { "X-Client-Id": process.env.TRENDLINE_CLIENT_ID, "X-Api-Key": process.env.TRENDLINE_API_KEY,
"X-Api-Secret": process.env.TRENDLINE_API_SECRET };
const r = await fetch(`${BASE}/public/v1/account/balances`, { headers: HEADERS });
console.log(r.status, await r.json());
{
"as_of_ms": 1791266400000,
"venues": {
"kalshi": {
"held": [
{
"address": null,
"amounts": [
{
"amount": "123.45",
"amount_base_units": "12345",
"asset": "USD",
"chain": null,
"decimals": 2,
"source": "kalshi"
}
],
"kinds": [
"account"
]
}
],
"status": "ok"
},
"limitless": {
"reason": "timeout",
"status": "unavailable"
},
"polymarket": {
"held": [
{
"address": "0x5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c",
"amounts": [
{
"amount": "0.920000",
"amount_base_units": "920000",
"asset": "pUSD",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
},
{
"amount": "0.080000",
"amount_base_units": "80000",
"asset": "USDC.e",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
}
],
"kinds": [
"deposit_wallet"
]
},
{
"address": "0x6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d",
"amounts": [
{
"amount": "0.000000",
"amount_base_units": "0",
"asset": "pUSD",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
},
{
"amount": "0.000000",
"amount_base_units": "0",
"asset": "USDC.e",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
}
],
"kinds": [
"safe"
]
},
{
"address": "0x3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a",
"amounts": [
{
"amount": "0.000000",
"amount_base_units": "0",
"asset": "pUSD",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
},
{
"amount": "0.000000",
"amount_base_units": "0",
"asset": "USDC.e",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
}
],
"kinds": [
"eoa"
]
}
],
"status": "ok",
"wallet": "0x3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a"
},
"predictfun": {
"held": [
{
"address": "0x4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b",
"amounts": [
{
"amount": "4.210000000000000000",
"amount_base_units": "4210000000000000000",
"asset": "USDT",
"chain": "bnb",
"decimals": 18,
"source": "onchain"
}
],
"kinds": [
"wallet"
]
}
],
"status": "ok",
"wallet": "0x4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}Account
Get your balance on every venue
Your balance on every venue. venues always holds kalshi, polymarket, limitless and predictfun.
- Each venue has a
status: ok, not_connected, unavailable or unsupported, with areasonfor the last three. held(each address read, its kinds and amounts as integer base units plus their exact decimal) appears only when ok.- There is no cross-venue total.
- A venue over its budget reads unavailable with reason venue_busy, while the route still answers 200.
Errors
| Status | Code | When |
|---|---|---|
| 503 | dependency_unavailable | Our store is unavailable. |
Any route can also answer 401, 403, 429, 500 or 503 dependency_unavailable, described on the Errors page.
GET
/
public
/
v1
/
account
/
balances
cURL
#!/bin/sh
# getAccountBalances: Get your balance on every venue. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base.
curl -sS "${TRENDLINE_API_BASE:-https://systems.trendlinelabs.ai}/public/v1/account/balances" \
-H "X-Client-Id: $TRENDLINE_CLIENT_ID" \
-H "X-Api-Key: $TRENDLINE_API_KEY" \
-H "X-Api-Secret: $TRENDLINE_API_SECRET""""getAccountBalances: Get your balance on every venue. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base."""
import os
import requests
BASE = os.environ.get("TRENDLINE_API_BASE", "https://systems.trendlinelabs.ai")
HEADERS = {"X-Client-Id": os.environ["TRENDLINE_CLIENT_ID"], "X-Api-Key": os.environ["TRENDLINE_API_KEY"],
"X-Api-Secret": os.environ["TRENDLINE_API_SECRET"]}
r = requests.get(f"{BASE}/public/v1/account/balances", params={}, headers=HEADERS, timeout=10)
r.raise_for_status()
print(r.json())
// getAccountBalances: Get your balance on every venue. Needs TRENDLINE_CLIENT_ID, TRENDLINE_API_KEY and TRENDLINE_API_SECRET; TRENDLINE_API_BASE overrides the base.
const BASE = process.env.TRENDLINE_API_BASE ?? "https://systems.trendlinelabs.ai";
const HEADERS = { "X-Client-Id": process.env.TRENDLINE_CLIENT_ID, "X-Api-Key": process.env.TRENDLINE_API_KEY,
"X-Api-Secret": process.env.TRENDLINE_API_SECRET };
const r = await fetch(`${BASE}/public/v1/account/balances`, { headers: HEADERS });
console.log(r.status, await r.json());
{
"as_of_ms": 1791266400000,
"venues": {
"kalshi": {
"held": [
{
"address": null,
"amounts": [
{
"amount": "123.45",
"amount_base_units": "12345",
"asset": "USD",
"chain": null,
"decimals": 2,
"source": "kalshi"
}
],
"kinds": [
"account"
]
}
],
"status": "ok"
},
"limitless": {
"reason": "timeout",
"status": "unavailable"
},
"polymarket": {
"held": [
{
"address": "0x5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c5c",
"amounts": [
{
"amount": "0.920000",
"amount_base_units": "920000",
"asset": "pUSD",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
},
{
"amount": "0.080000",
"amount_base_units": "80000",
"asset": "USDC.e",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
}
],
"kinds": [
"deposit_wallet"
]
},
{
"address": "0x6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d6d",
"amounts": [
{
"amount": "0.000000",
"amount_base_units": "0",
"asset": "pUSD",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
},
{
"amount": "0.000000",
"amount_base_units": "0",
"asset": "USDC.e",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
}
],
"kinds": [
"safe"
]
},
{
"address": "0x3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a",
"amounts": [
{
"amount": "0.000000",
"amount_base_units": "0",
"asset": "pUSD",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
},
{
"amount": "0.000000",
"amount_base_units": "0",
"asset": "USDC.e",
"chain": "polygon",
"decimals": 6,
"source": "onchain"
}
],
"kinds": [
"eoa"
]
}
],
"status": "ok",
"wallet": "0x3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a"
},
"predictfun": {
"held": [
{
"address": "0x4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b",
"amounts": [
{
"amount": "4.210000000000000000",
"amount_base_units": "4210000000000000000",
"asset": "USDT",
"chain": "bnb",
"decimals": 18,
"source": "onchain"
}
],
"kinds": [
"wallet"
]
}
],
"status": "ok",
"wallet": "0x4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>"
}
}