Aller au contenu
GET /v1/stats

Per-asset return/vol + correlation & covariance

Essayez-le en direct

10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.

En-têtes personnalisés (facultatif)
api.oanor.com/portfoliooptimizer-api

Ça marche. Récupérez une clé API et utilisez-la dans votre projet.

Obtenez une clé API

Extraits de code

curl "https://api.oanor.com/portfoliooptimizer-api/v1/stats" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/portfoliooptimizer-api/v1/stats", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/portfoliooptimizer-api/v1/stats");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/portfoliooptimizer-api/v1/stats",
    headers={"x-oanor-key": "oanor_test_..."}
)

Exemple de réponse

Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.

{
    "data": {
        "note": "Returns and (co)variances annualised by periods_per_year. Matrices are ordered as the assets array.",
        "assets": [
            "stocks",
            "bonds"
        ],
        "source": "PORTFOLIO",
        "per_asset": [
            {
                "asset": "stocks",
                "return_annualised": 4.500542,
                "volatility_annualised": 0.491874
            },
            {
                "asset": "bonds",
                "return_annualised": -0.072027,
                "volatility_annualised": 0.240675
            }
        ],
        "observations": 5,
        "periods_per_year": 252,
        "covariance_matrix": [
            [
                0.24193994,
                -0.11698605
            ],
            [
                -0.11698605,
                0.05792426
            ]
        ],
        "correlation_matrix": [
            [
                1,
                -0.988212
            ],
            [
                -0.988212,
                1
            ]
        ]
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:23.826Z",
        "request_id": "c7eadb58-30a1-4778-82a1-07a86cfdaac1"
    },
    "status": "ok",
    "message": "Portfolio stats computed",
    "success": true
}