API Endpoint
Margin Buying Power
Calculate buying power under margin requirements (initial and maintenance).
Endpoint
Also supports GET with query parameters.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
equity | number | — | Account equity ($) |
initialMarginPercent | number | 50 | Initial margin requirement (%) |
maintenanceMarginPercent | number | 25 | Maintenance margin requirement (%) |
existingLoanBalance | number | 0 | Existing margin loan ($) |
Request Examples
POST (JSON body)
curl -X POST https://likeoptions.com/api/v1/calculate/margin \
-H "Content-Type: application/json" \
-d '{"equity": 100000, "initialMarginPercent": 50, "maintenanceMarginPercent": 25}'GET (query parameters)
curl "https://likeoptions.com/api/v1/calculate/margin?equity=100000&initialMarginPercent=50&maintenanceMarginPercent=25"Response
{
"kind": "margin",
"result": {
"primary": 1234.56,
"secondary": [
{ "label": "Example metric", "value": 100, "format": "money" },
{ "label": "Example percent", "value": 5.5, "format": "percent" }
]
}
}When to Use
- Calculate available buying power
- Understand margin requirements
- Plan leverage strategy
Error Handling
- 400 Bad Request — Invalid input parameters or missing required fields
- 404 Not Found — Unknown calculator kind
- 429 Too Many Requests — Rate limit exceeded (120 req/hour per IP)
- 413 Payload Too Large — Request body exceeds 16 KB
Related Endpoints
View request examples in JavaScript, Python, cURL, and more →
Stock positions, grants and margin
- Vesting API endpointAPI
- Stock grant vesting calculatorCalculator
- Cost basis calculatorCalculator
- Stock profit calculatorCalculator
- Margin buying power calculatorCalculator