Linda is a professional stock trading platform with real-time market data, automated trading bots, and workflow automation (like n8n). This API allows you to programmatically execute trades, create trading bots, and build automated workflows.
Base URL: https://your-domain.com/api/v1
All API endpoints require authentication via API Key.
- Log in to your Linda account at
/login - Go to Settings > API Keys
- Click "Create API Key"
- Select permissions (read, trade, bot, webhook)
- Save your API key - it won't be shown again!
Include your API key in request headers:
# Option 1: X-API-Key header
curl -H "X-API-Key: lnd_your_api_key_here" https://api.example.com/api/v1/account
# Option 2: Bearer token
curl -H "Authorization: Bearer lnd_your_api_key_here" https://api.example.com/api/v1/account| Permission | Description |
|---|---|
read |
View account, portfolio, quotes |
trade |
Execute buy/sell orders |
bot |
Create/manage trading bots and workflows |
webhook |
Create/manage webhooks |
withdraw |
Full access (all permissions) |
GET /api/v1/accountReturns account summary including portfolio, holdings, and recent orders.
Response:
{
"success": true,
"data": {
"user": {
"id": "user_123",
"email": "trader@example.com",
"name": "John Doe"
},
"account": {
"type": "DEMO",
"currency": "USD",
"cashBalance": 85000.00,
"portfolioValue": 15000.00,
"totalValue": 100000.00,
"totalGain": 2500.00,
"totalGainPercent": 2.5
},
"holdings": [
{
"symbol": "AAPL",
"name": "Apple Inc.",
"quantity": 50,
"avgBuyPrice": 175.00,
"currentPrice": 180.50,
"currentValue": 9025.00,
"gain": 275.00,
"gainPercent": 3.14
}
],
"automation": {
"activeBots": 2,
"activeWorkflows": 1
}
}
}GET /api/v1/quote?symbol=AAPLGet real-time stock quote from Yahoo Finance.
Parameters:
| Parameter | Type | Description |
|---|---|---|
symbol |
string | Stock symbol (e.g., AAPL) |
symbols |
string | Comma-separated symbols (max 20) |
Response:
{
"success": true,
"data": {
"symbol": "AAPL",
"name": "Apple Inc.",
"price": 180.50,
"change": 2.35,
"changePercent": 1.32,
"previousClose": 178.15,
"dayHigh": 181.20,
"dayLow": 178.00,
"volume": 45000000,
"timestamp": "2026-01-03T15:30:00Z"
}
}POST /api/v1/tradeExecute a buy or sell order.
Request Body:
{
"symbol": "AAPL",
"side": "BUY",
"quantity": 10,
"type": "MARKET"
}Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol |
string | Yes | Stock symbol |
side |
string | Yes | BUY or SELL |
quantity |
integer | Yes | Number of shares |
type |
string | No | MARKET (default) or LIMIT |
price |
number | No | Required for LIMIT orders |
Response:
{
"success": true,
"data": {
"orderId": "ord_abc123",
"symbol": "AAPL",
"side": "BUY",
"type": "MARKET",
"quantity": 10,
"price": 180.50,
"total": 1805.00,
"status": "FILLED",
"executedAt": "2026-01-03T15:30:00Z",
"newBalance": 83195.00
}
}GET /api/v1/trade?limit=50&offset=0POST /api/v1/botsCreate an automated trading bot.
Request Body:
{
"name": "AAPL DCA Bot",
"symbol": "AAPL",
"strategy": "DCA",
"config": {
"amount": 100,
"frequency": "daily",
"buyOnDip": true,
"dipThreshold": 3
},
"maxInvestment": 5000,
"autoStart": false
}Strategies:
| Strategy | Description | Config |
|---|---|---|
DCA |
Dollar Cost Averaging | amount, frequency, buyOnDip, dipThreshold |
GRID |
Grid Trading | upperPrice, lowerPrice, gridLevels, amountPerGrid |
TRAILING_STOP |
Trailing Stop Loss | trailingPercent, takeProfitPercent, initialStopPercent |
CUSTOM |
Custom Conditions | conditions[], action, amount |
DCA Config Example:
{
"amount": 100, // $100 per buy
"frequency": "daily", // hourly, daily, weekly, monthly
"buyOnDip": true, // Buy extra on dips
"dipThreshold": 3 // Buy on 3%+ drop
}GRID Config Example:
{
"upperPrice": 200, // Sell at $200
"lowerPrice": 150, // Buy at $150
"gridLevels": 5, // 5 grid levels
"amountPerGrid": 500 // $500 per trade
}CUSTOM Config Example:
{
"conditions": [
{ "indicator": "price", "operator": "lt", "value": 150 },
{ "indicator": "change_percent", "operator": "lt", "value": -2 }
],
"action": "BUY",
"amount": 1000
}GET /api/v1/botsGET /api/v1/bots/{id}PATCH /api/v1/bots/{id}{
"status": "ACTIVE",
"config": { ... }
}POST /api/v1/bots/{id}/runTrigger bot execution immediately.
DELETE /api/v1/bots/{id}Workflows allow you to create "if this then that" automation rules.
POST /api/v1/workflowsRequest Body:
{
"name": "Buy on AAPL Dip",
"description": "Buy AAPL when price drops 5%",
"trigger": {
"type": "price_change_percent",
"symbol": "AAPL",
"value": -5
},
"actions": [
{
"type": "buy_stock",
"params": {
"symbol": "AAPL",
"amount": 500
}
},
{
"type": "send_webhook",
"params": {
"url": "https://your-webhook.com/notify",
"method": "POST"
}
}
],
"autoActivate": true
}Trigger Types:
| Trigger | Description | Parameters |
|---|---|---|
price_above |
Price goes above threshold | symbol, value |
price_below |
Price goes below threshold | symbol, value |
price_change_percent |
Price changes by X% | symbol, value |
volume_spike |
Volume exceeds X times average | symbol, value |
time_schedule |
Run at scheduled times | schedule (cron) |
manual |
Only run manually | - |
Action Types:
| Action | Description | Parameters |
|---|---|---|
buy_stock |
Buy shares | symbol, amount or quantity |
sell_stock |
Sell shares | symbol, quantity or sellAll |
send_webhook |
Send HTTP request | url, method, headers |
send_notification |
Send notification | title, message |
start_bot |
Activate a bot | botId |
stop_bot |
Pause a bot | botId |
log_message |
Log a message | message |
GET /api/v1/workflowsPOST /api/v1/workflows/{id}/runReceive real-time notifications when events occur.
POST /api/v1/webhooks{
"name": "Order Notifications",
"url": "https://your-server.com/webhooks/linda",
"events": ["order.filled", "alert.triggered"]
}Events:
order.created- New order placedorder.filled- Order executedorder.cancelled- Order cancelledorder.rejected- Order rejectedalert.triggered- Price alert triggeredbalance.changed- Wallet balance changedbot.executed- Bot made a tradeworkflow.completed- Workflow finished*- All events
{
"event": "order.filled",
"timestamp": "2026-01-03T15:30:00Z",
"data": {
"orderId": "ord_abc123",
"symbol": "AAPL",
"side": "BUY",
"quantity": 10,
"price": 180.50,
"total": 1805.00
}
}Each webhook request includes a signature header:
X-Webhook-Signature: sha256_signature_here
X-Webhook-Event: order.filled
X-Webhook-Timestamp: 2026-01-03T15:30:00Z
Verify with:
import hmac
import hashlib
def verify_signature(payload, signature, secret):
expected = hmac.new(
secret.encode(),
payload.encode(),
hashlib.sha256
).hexdigest()
return hmac.compare_digest(signature, expected)POST /api/v1/webhooks/{id}/testInvest $100 in AAPL every day:
curl -X POST https://api.linda.com/api/v1/bots \
-H "X-API-Key: lnd_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Daily AAPL DCA",
"symbol": "AAPL",
"strategy": "DCA",
"config": {
"amount": 100,
"frequency": "daily"
},
"maxInvestment": 10000,
"autoStart": true
}'Buy when any stock drops 5%:
curl -X POST https://api.linda.com/api/v1/workflows \
-H "X-API-Key: lnd_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Buy NVDA Dip",
"trigger": {
"type": "price_change_percent",
"symbol": "NVDA",
"value": -5
},
"actions": [
{
"type": "buy_stock",
"params": { "symbol": "NVDA", "amount": 1000 }
},
{
"type": "send_webhook",
"params": { "url": "https://hooks.slack.com/your-webhook" }
}
],
"autoActivate": true
}'Profit from price swings:
curl -X POST https://api.linda.com/api/v1/bots \
-H "X-API-Key: lnd_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "TSLA Grid Trader",
"symbol": "TSLA",
"strategy": "GRID",
"config": {
"upperPrice": 300,
"lowerPrice": 200,
"gridLevels": 10,
"amountPerGrid": 500
},
"maxInvestment": 5000,
"autoStart": true
}'| Endpoint | Limit |
|---|---|
/quote |
60 requests/minute |
/trade |
30 requests/minute |
/bots, /workflows |
30 requests/minute |
| All other endpoints | 100 requests/minute |
| Code | Description |
|---|---|
UNAUTHORIZED |
Invalid or missing API key |
FORBIDDEN |
API key lacks required permission |
NOT_FOUND |
Resource not found |
VALIDATION_ERROR |
Invalid request parameters |
INSUFFICIENT_FUNDS |
Not enough balance |
INSUFFICIENT_SHARES |
Not enough shares to sell |
INTERNAL_ERROR |
Server error |
import requests
class LindaAPI:
def __init__(self, api_key):
self.api_key = api_key
self.base_url = "https://api.linda.com/api/v1"
def _request(self, method, endpoint, data=None):
headers = {"X-API-Key": self.api_key}
response = requests.request(
method,
f"{self.base_url}{endpoint}",
headers=headers,
json=data
)
return response.json()
def get_quote(self, symbol):
return self._request("GET", f"/quote?symbol={symbol}")
def buy(self, symbol, quantity):
return self._request("POST", "/trade", {
"symbol": symbol,
"side": "BUY",
"quantity": quantity,
"type": "MARKET"
})
def sell(self, symbol, quantity):
return self._request("POST", "/trade", {
"symbol": symbol,
"side": "SELL",
"quantity": quantity,
"type": "MARKET"
})
# Usage
api = LindaAPI("lnd_your_api_key")
quote = api.get_quote("AAPL")
print(f"AAPL: ${quote['data']['price']}")
# Buy 10 shares
result = api.buy("AAPL", 10)
print(f"Bought: {result}")class LindaAPI {
constructor(apiKey) {
this.apiKey = apiKey;
this.baseUrl = 'https://api.linda.com/api/v1';
}
async request(method, endpoint, data = null) {
const response = await fetch(`${this.baseUrl}${endpoint}`, {
method,
headers: {
'X-API-Key': this.apiKey,
'Content-Type': 'application/json',
},
body: data ? JSON.stringify(data) : null,
});
return response.json();
}
getQuote(symbol) {
return this.request('GET', `/quote?symbol=${symbol}`);
}
buy(symbol, quantity) {
return this.request('POST', '/trade', {
symbol,
side: 'BUY',
quantity,
type: 'MARKET',
});
}
createBot(config) {
return this.request('POST', '/bots', config);
}
}
// Usage
const api = new LindaAPI('lnd_your_api_key');
const quote = await api.getQuote('AAPL');
console.log(`AAPL: $${quote.data.price}`);- Documentation: https://docs.linda.com
- API Status: https://status.linda.com
- Contact: api-support@linda.com