MarketIntell

Portfolio API

Create, manage, and analyze crypto portfolios

Portfolio API

Track crypto holdings, manage portfolios, and run AI-powered analysis across your positions.


POST /v1/portfolio

Create a new portfolio with holdings.

Request Body

FieldTypeRequiredDescription
namestringYesPortfolio name (1–100 chars)
holdingsobject[]YesArray of holding objects (1–50 items)
holdings[].tokenstringYesToken symbol (e.g., BTC, ETH)
holdings[].amountnumberYesAmount held (must be positive)
holdings[].entry_pricenumberNoAverage entry price in USD
holdings[].notesstringNoNotes for this holding (max 500 chars)

Request

curl -X POST https://api.marketintell.ai/v1/portfolio \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "name": "Main Portfolio",
    "holdings": [
      { "token": "BTC", "amount": 1.5, "entry_price": 42000 },
      { "token": "ETH", "amount": 20, "entry_price": 2800 },
      { "token": "SOL", "amount": 200, "entry_price": 95, "notes": "Bought on dip" }
    ]
  }'

Response

{
  "success": true,
  "data": {
    "id": "pf_abc123",
    "name": "Main Portfolio",
    "holdings": [
      { "token": "BTC", "amount": 1.5, "entry_price": 42000 },
      { "token": "ETH", "amount": 20, "entry_price": 2800 },
      { "token": "SOL", "amount": 200, "entry_price": 95, "notes": "Bought on dip" }
    ],
    "created_at": "2025-01-15T10:00:00.000Z"
  }
}

GET /v1/portfolio

List all portfolios for the authenticated user.

Request

curl https://api.marketintell.ai/v1/portfolio \
  -H "X-API-Key: YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "count": 1,
    "portfolios": [
      {
        "id": "pf_abc123",
        "name": "Main Portfolio",
        "holdings_count": 3,
        "created_at": "2025-01-15T10:00:00.000Z",
        "updated_at": "2025-01-15T10:00:00.000Z"
      }
    ]
  }
}

GET /v1/portfolio/:id

Get a specific portfolio with current market values for all holdings.

Path Parameters

ParameterTypeDescription
idstringThe portfolio ID

Request

curl https://api.marketintell.ai/v1/portfolio/pf_abc123 \
  -H "X-API-Key: YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "portfolio": {
      "id": "pf_abc123",
      "name": "Main Portfolio",
      "owner_id": "key_xyz",
      "created_at": "2025-01-15T10:00:00.000Z",
      "updated_at": "2025-01-15T10:00:00.000Z"
    },
    "holdings": [
      { "token": "BTC", "amount": 1.5, "entry_price": 42000 },
      { "token": "ETH", "amount": 20, "entry_price": 2800 },
      { "token": "SOL", "amount": 200, "entry_price": 95, "notes": "Bought on dip" }
    ]
  }
}

The GET /:id endpoint returns the result of getPortfolioWithValues, which includes a portfolio object and enriched holdings.


PUT /v1/portfolio/:id

Update a portfolio's holdings. Replaces all existing holdings.

Path Parameters

ParameterTypeDescription
idstringThe portfolio ID

Request Body

FieldTypeRequiredDescription
holdingsobject[]YesUpdated holdings array (replaces all existing holdings)

The PUT endpoint only accepts holdings — you cannot rename a portfolio via this endpoint.

Request

curl -X PUT https://api.marketintell.ai/v1/portfolio/pf_abc123 \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "holdings": [
      { "token": "BTC", "amount": 2.0, "entry_price": 43000 },
      { "token": "ETH", "amount": 25, "entry_price": 2900 },
      { "token": "SOL", "amount": 200, "entry_price": 95 },
      { "token": "LINK", "amount": 500, "entry_price": 14.5, "notes": "New position" }
    ]
  }'

Response

{
  "success": true,
  "data": {
    "id": "pf_abc123",
    "name": "Main Portfolio",
    "holdings": [
      { "token": "BTC", "amount": 2.0, "entry_price": 43000 },
      { "token": "ETH", "amount": 25, "entry_price": 2900 },
      { "token": "SOL", "amount": 200, "entry_price": 95 },
      { "token": "LINK", "amount": 500, "entry_price": 14.5, "notes": "New position" }
    ],
    "updated_at": "2025-01-15T12:00:00.000Z"
  }
}

DELETE /v1/portfolio/:id

Delete a portfolio and all its holdings.

Path Parameters

ParameterTypeDescription
idstringThe portfolio ID

Request

curl -X DELETE https://api.marketintell.ai/v1/portfolio/pf_abc123 \
  -H "X-API-Key: YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "deleted": true
  }
}

POST /v1/portfolio/:id/analyze

Run a comprehensive AI analysis on a portfolio. This passes all holdings through the MarketIntell reasoning pipeline.

Path Parameters

ParameterTypeDescription
idstringThe portfolio ID

Request

curl -X POST https://api.marketintell.ai/v1/portfolio/pf_abc123/analyze \
  -H "X-API-Key: YOUR_API_KEY"

Response

{
  "success": true,
  "data": {
    "portfolio_id": "pf_abc123",
    "analysis": "## Portfolio Analysis: Main Portfolio\n\n### Overall Assessment\nYour portfolio is **heavily weighted toward large-cap L1s** (78% BTC + ETH)...\n\n### Risk Assessment\n- **Concentration risk:** High BTC allocation\n- **Correlation risk:** ETH and SOL tend to move together\n- **Sector exposure:** 100% crypto-native, no DeFi tokens\n\n### Recommendations\n1. Consider adding DeFi exposure (AAVE, UNI)\n2. Reduce SOL position if risk-averse\n3. BTC entry looks favorable vs. current price...",
    "holdings_analysis": [
      {
        "token": "BTC",
        "pnl_percent": 12.5,
        "outlook": "bullish",
        "notes": "Trading above entry. Strong accumulation zone."
      },
      {
        "token": "ETH",
        "pnl_percent": 8.2,
        "outlook": "bullish",
        "notes": "Approaching resistance at $3,200. Consider scaling."
      },
      {
        "token": "SOL",
        "pnl_percent": -3.1,
        "outlook": "neutral",
        "notes": "Underperforming relative to BTC. Watch $90 support."
      }
    ],
    "timestamp": "2025-01-15T14:00:00.000Z"
  }
}

Portfolio analysis counts as one query against your rate limit, regardless of the number of holdings.

On this page