Portfolio Analysis API Reference.
Integrate PORTIQA's portfolio evaluation engine directly into your applications.
Portfolio Evaluation Endpoint
Send holdings, cash and an optional risk setting to receive a portfolio score, a breakdown of its drivers and data coverage.
Authentication
Authenticate requests using a standard Bearer token in the Authorization header. You can generate your API key in the Dashboard. For shared hosting/FastCGI environments that strip Authorization, PORTIQA also accepts X-Portfolio-Evaluator-Token with the same token.
Request Payload (JSON)
Each request must contain a positions array. The number of unique tickers per evaluation is capped by your plan: 5 (Free/Hobby), 10 (Pro), 20 (Business). Duplicate canonical tickers are combined before this cap and scoring. All plans, including Enterprise, have a safety ceiling of 500 input rows and 256 KiB per request. Requests above these limits return 413.
| Parameter | Type | Required | Description |
|---|---|---|---|
positions |
Array | Yes | An array of portfolio positions with essential inputs only. E.g., [{"ticker": "AAPL", "market_value": 25000, "amount": 10}, ...]. Legacy clients may also send this as holdings. |
risk_level |
String | No | The target risk profile. Valid options: low, medium (default), high. |
cash_balance |
Number | No | Cash balance in the same currency as market values. Used to report current cash/invested percentages. |
Response payload
A successful request returns HTTP 200 with a request ID and an evaluation object. Send Portiqa-Response-Profile: public to receive the response documented here on any API account. New accounts use this profile by default. An existing integration can continue with its current response or adopt the public profile one request at a time.
This shortened example uses illustrative values. The OpenAPI schema describes the public fields and their types.
Displaying an evaluation
- Display
evaluation.scoreon a 0–100 scale. When comparing evaluations, keep the risk setting, model version and source dates alongside each result. - Use
component_assessmentsfor the component breakdown. Each value islower,middle,upperornullwhen evidence is unavailable. The public profile returns an empty object for the compatibility fieldscore_components. Each entry inscore_driverscontains a component name and a short explanation. - Show
analysis_coveragewith the score. It reports how much of the portfolio was analyzed, excluded holdings and any funds without underlying holdings data. Usedata_sourcesfor snapshot dates and availability, anddiagnostics.data_gapsfor missing evidence. - When
weak_holdingsincludes a simulated alternative, itsimpactgives the before, after and change for that substitution. Portfolio score changes are measured in points. An empty alternatives list is a valid result.
The portfolio score methodology includes a dated example and explains how to interpret changes.
The Developer API has its own monthly evaluation allowance. View it under Developer API usage. Only successful evaluations count. Annual subscriptions receive a new allowance each month within the annual paid period. Canceled or delinquent subscriptions retain the Free plan's allowance and ticker cap. For support, include the request_id or X-Request-ID header.
Error Handling
| Status Code | Meaning |
|---|---|
400 Bad Request |
Invalid JSON, negative/nonfinite numbers, overflowing totals, invalid risk level, missing prices, or no evaluable positions. Correct the input before retrying. |
401 Unauthorized |
Use the active API key from your Portiqa dashboard. |
403 Forbidden |
If the code is api_disclaimer_required, review and accept the API and MCP usage disclaimer, then retry with the same key. |
405 Method Not Allowed |
Use POST with a JSON body. |
413 Payload Too Large |
Request exceeds 256 KiB, 500 input rows, or the plan's unique-ticker cap (Free/Hobby: 5, Pro: 10, Business: 20). Combine duplicate rows or choose a plan that covers the complete portfolio. |
429 Too Many Requests |
The monthly Developer API allowance is exhausted. Check reset_at for the next reset in UTC, or follow the link to compare API plans. Wait until the reset to retry at your current limit. |
500 Internal Server Error |
The evaluation engine failed to process the request. |
503 Service Unavailable |
Authentication or usage accounting is temporarily unavailable, or another evaluation holds this account's quota lock. Retry after the Retry-After interval. |
For errors, display the returned title, message, and actions to the user. Use error for branching and retryable to decide if an automatic retry is appropriate.
Interactive Playground
Test the API directly from your browser. Enter your API key and configure the payload to see a live response.