← Developer Hub
Investment Analytics

Quant Portfolio Construction

Run deterministic long-only portfolio construction across minimum variance, risk parity and mean-variance candidates.

Version: v2
Stability: stable
Sandbox: Available
Production: Entitlement required
Target latency: ≤ 1,200 ms
POST/api/v2/investment/portfolios/{portfolio}/construct

Uses provider-backed return history, FinanceGPT portfolio algorithms and the MathPHP-backed Quant Kernel. No orders are transmitted.

Required scope: investment:run
Try it in the FinanceGPT sandbox

The playground uses deterministic isolated sandbox fixtures. It never queries production workspace data and does not require you to paste an API secret into the browser.

Sign in to run
Example response
{
    "data": {
        "status": "completed",
        "selected_candidate": {
            "method": "risk_parity"
        },
        "financial_action_executed": false
    }
}
Code examples

curl

curl -X POST \
  https://equitygpt.app/api/v2/investment/portfolios/1/construct \
  -H "Authorization: Bearer $FINANCEGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbols":["AAPL","MSFT","SPY"],"objective":"balanced","max_position_pct":50}'

python

import os, requests

url = "https://equitygpt.app/api/v2/investment/portfolios/1/construct"
headers = {"Authorization": f"Bearer {os.environ['FINANCEGPT_API_KEY']}"}
payload = {
    "symbols": [
        "AAPL",
        "MSFT",
        "SPY"
    ],
    "objective": "balanced",
    "max_position_pct": 50
}
response = requests.request("POST", url, headers=headers, json=payload)
response.raise_for_status()
print(response.json())

javascript

const response = await fetch('https://equitygpt.app/api/v2/investment/portfolios/1/construct', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.FINANCEGPT_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({"symbols":["AAPL","MSFT","SPY"],"objective":"balanced","max_position_pct":50})
});
if (!response.ok) throw new Error(`FinanceGPT ${response.status}`);
console.log(await response.json());

php

<?php
$ch = curl_init('https://equitygpt.app/api/v2/investment/portfolios/1/construct');
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => ['Authorization: Bearer '.getenv('FINANCEGPT_API_KEY'), 'Content-Type: application/json'], CURLOPT_POSTFIELDS => '{\"symbols\":[\"AAPL\",\"MSFT\",\"SPY\"],\"objective\":\"balanced\",\"max_position_pct\":50}']);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException($response);
echo $response;
Versions & changelog
v2 published
M27 publication of this governed FinanceGPT API operation.

Ready to build?

Explorer gives immediate isolated sandbox access. Production plans require a commercial entitlement.

Create account