Query
The Portfolio Query API returns portfolio analytics (values, returns, allocations) grouped and filtered by any combination of Addepar attributes. Unlike the Portfolio Views endpoint (which executes a saved view), Portfolio Query lets you define columns, groupings, and filters dynamically in each request. This makes it the primary endpoint for integrations that need flexible, programmatic access to portfolio data.
The response is a hierarchical tree: a total node containing children grouped by your specified attributes, with column values computed at each level.
Overview
| Base route | /v1/portfolio/query |
| Method | POST |
| Produces | JSON |
| Pagination | No |
| OAuth scopes | portfolio_query |
Access requirements
Portfolio query access must be enabled for your API user or application.
Required parameters
| Parameter | Type | Description |
|---|---|---|
columns | Array of objects | Attribute keys to compute. Each entry has a key and optional arguments. Example: [{"key": "value"}, {"key": "time_weighted_return"}] |
groupings | Array of objects or strings | Attributes to group rows by. Determines the tree structure of the response. Example: [{"key": "asset_class"}, {"key": "holding_account"}] |
start_date | String | Period start. Format: YYYY-MM-DD. |
end_date | String | Period end. Format: YYYY-MM-DD. |
portfolio_type | String | Scope. Values: ENTITY, ENTITY_FUNDS, GROUP, GROUP_FUNDS, FIRM, FIRM_ACCOUNTS, FIRM_CLIENTS, FIRM_HOUSEHOLDS, FIRM_UNVERIFIED_ACCOUNTS. |
portfolio_id | Number or [Number] | Entity ID, group ID, or 1 (for firm). Accepts a single value or array. |
Alternative to portfolio_id: Pass external_ids to scope by external identifier. Format: [{"external_type_key": "salesforce", "external_id": "sf_123"}]. See External Identifiers.
Optional parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
filters | Array | None | Filter rows by attribute values. See filter object below. |
hide_previous_holdings | Boolean | false | Exclude holdings not held at end of current period. |
group_by_historical_values | Boolean | false | Include previous values when grouping on a time-varying attribute. |
group_by_multiple_attribute_values | Boolean | false | Break out groupings by each value for multi-value attributes. |
look_through_composite_securities | Boolean | false | Look through components of composite securities (funds). |
look_through_constituent_holdings | Object | None | Control constituent lookthrough. {"type": "top", "threshold": 10}. Types: none, top, all, weighted. |
display_account_fees | Boolean | false | Show account fees in results. |
Query portfolio data
POST /v1/portfolio/query
curl -X POST "https://{firm}.addepar.com/api/v1/portfolio/query" \
-H "Authorization: Basic {credentials}" \
-H "Addepar-Firm: 1" \
-H "Content-Type: application/vnd.api+json" \
-H "Accept: application/vnd.api+json" \
-d '{
"data": {
"type": "portfolio_query",
"attributes": {
"columns": [
{"key": "value"},
{"key": "time_weighted_return"}
],
"groupings": [
{"key": "asset_class"}
],
"portfolio_type": "ENTITY",
"portfolio_id": [329263],
"start_date": "2024-01-01",
"end_date": "2024-06-30"
}
}
}'
{
"meta": {
"columns": [
{ "key": "value", "display_name": "Value (USD)", "output_type": "Number", "currency": "USD" },
{ "key": "time_weighted_return", "display_name": "TWR (USD)", "output_type": "Percent", "currency": "USD" }
],
"groupings": [
{ "key": "asset_class", "display_name": "Asset Class" }
]
},
"data": {
"type": "portfolio_views",
"attributes": {
"total": {
"name": "Total",
"columns": { "value": 4.371024413999725E8, "time_weighted_return": 0.023992155163590434 },
"children": [
{
"name": "Equity",
"grouping": "asset_class",
"columns": { "value": 2.5993525600627503E8, "time_weighted_return": 0.09047133778274707 },
"children": []
},
{
"name": "Fixed Income",
"grouping": "asset_class",
"columns": { "value": 4.555629874790781E7, "time_weighted_return": 5.433985661802421E-4 },
"children": []
}
]
}
}
},
"included": []
}
Response structure:
meta.columnsconfirms which columns were computed, with display names and output types.meta.groupingsconfirms the grouping hierarchy.data.attributes.totalis the root node with portfolio-level totals.childrenarrays contain grouped breakdowns. Each child hasname,grouping(which attribute it groups by),columns(computed values), and its ownchildren(for nested groupings).- Entity-backed groupings (like
holding_account) include anentity_idfield. nullcolumn values indicate the calculation is not applicable for that row.
Response codes:
200 OK-- Success400 Bad Request-- Invalid query, unsupported attribute, or missing permissions for market data attributes403 Forbidden-- Insufficient permissions or scope
Filter object
Filters narrow results by attribute value before computation.
| Field | Description |
|---|---|
attribute | Attribute key to filter on. String or object with key. Example: "asset_class" or {"key": "investment_type"} |
type | Filter data type. Values: discrete, number. |
operator | Operation. Discrete: include, exclude. Number: range, rank. |
Discrete filter fields:
| Field | Description |
|---|---|
values | Array of strings to match. Case-sensitive. Example: ["Equity", "Fixed Income"] |
unassigned_account_fees | Include/exclude fees not associated with a filtered asset. Default: true for inclusion, false for exclusion. |
Number filter fields (range):
| Field | Description |
|---|---|
ranges | Array of {"from": number, "to": number} pairs. |
grouping_attribute | Narrow by aggregated position values. Optional. |
Number filter fields (rank):
| Field | Description |
|---|---|
rank_order | top or bottom. |
rank_value | Number of results to return. |
grouping_attribute | Optional. |
Filter example:
"filters": [
{
"attribute": "asset_class",
"type": "discrete",
"operator": "include",
"values": ["Equity", "Fixed Income"]
},
{
"attribute": {"key": "value"},
"type": "number",
"operator": "rank",
"rank_order": "top",
"rank_value": 10
}
]
Date filters are not supported on Portfolio Query.
Column arguments
Columns accept optional arguments that modify the calculation. The most common argument is adjusted (for adjusted value) and time-based arguments that control the observation window.
"columns": [
{ "key": "value", "arguments": { "adjusted": true } },
{ "key": "time_weighted_return", "arguments": { "period": "trailing P5Y" } }
]
See Attributes to discover available attribute keys and their supported arguments.
Time arguments
Time arguments control when or over what period a calculation is observed. There are two categories: time points (a single moment) and time periods (a span).
Time point arguments
Used with point-in-time attributes like value.
| Format | Description | Example |
|---|---|---|
current | End of the query period (default). | "time_point": "current" |
starting | Start of the query period. | "time_point": "starting" |
inception | Position inception date. | "time_point": "inception" |
YYYY-MM-DD | Specific date. | "time_point": "2024-12-31" |
P{n}{unit} ago ({rounding}) | Relative to end date. | "time_point": "P1Q ago (ceiling)" |
P{n}{unit} later ({rounding}) | Future from end date. | "time_point": "P2M later (exact)" |
P{n}{unit} inception ({rounding}) | Relative to inception. | "time_point": "P3Y inception (floor)" |
Time period arguments
Used with period attributes like time_weighted_return.
| Format | Description | Example |
|---|---|---|
current | The full query period (default). | "period": "current" |
since inception | From position inception to end date. | "period": "since inception" |
inception to start | From inception to query start date. | "period": "inception to start" |
trailing P{n}{unit} | Window trailing backward from end date. | "period": "trailing P5Y" |
relative P{n}{unit} | Relative to today. | "period": "relative P5Y" |
YYYY-MM-DD to YYYY-MM-DD | Fixed date range. | "period": "2023-01-01 to 2023-12-31" |
{time_point} to {time_point} | Custom endpoints. | "period": "P2M ago (exact) to 2024-06-30" |
Interval and rounding values
Intervals: D (days), K (weekdays), W (weeks), M (months), Q (quarters), Y (years).
Rounding: floor (start of period), exact (precise date), ceiling (end of period).
Unsupported attributes
The following attributes cannot be used in Portfolio Query requests:
- Allocation Deviation
- Allocation Deviation (%)
- Benchmark
- Benchmark (Rollup)
- Target Allocation
- Target Allocation Range
Related
- Portfolio Views -- Execute a saved analysis view (no dynamic columns)
- Portfolio Query Builder -- Convert an analysis view into a query request body
- Addepar Attributes -- Discover column and grouping keys
- External Identifiers -- Use external IDs as portfolio scope
- Positions -- The ownership data that portfolio queries aggregate
- Rate Limiting -- Portfolio queries are computationally expensive; plan rate budget
Updated 4 days ago