API Documentation

Portfolio Dashboard API Reference

Complete technical specification of public and authenticated REST endpoints, Model Context Protocol (MCP) handlers, and content negotiation mechanisms.

Base URL & Protocol

https://portfolio-tracker-kishoreabcs-projects.vercel.app

All API requests must be transmitted over HTTPS. Endpoints return standard UTF-8 encoded JSON payloads unless requested otherwise via content negotiation.

Structured JSON Error Format

Every error returned by Portfolio Dashboard (including 400, 401, 403, 404, 405, 429, and 500) includes structured machine-readable fields: an error code, a descriptive message, and an actionable resolution_hint designed for autonomous AI agent recovery:

{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required to access this resource.",
    "resolution_hint": "Provide a valid session cookie or API key. For public endpoints, visit /developers."
  },
  "code": "UNAUTHORIZED",
  "message": "Authentication required to access this resource.",
  "resolution_hint": "Provide a valid session cookie or API key. For public endpoints, visit /developers."
}

Public Endpoints (No Auth Required)

GET/api/market-data

Returns real-time price change percentages for Indian equity benchmarks (NIFTY 50, NIFTY BANK, NIFTY IT, etc.) and selected equities.

Sample Response (200 OK):

[
  { "symbol": "NIFTY 50", "value": "+0.54%" },
  { "symbol": "NIFTY BANK", "value": "+0.42%" },
  { "symbol": "RELIANCE", "value": "+0.35%" }
]
GET/api/v1/summary

Provides an overview of system capabilities, operational status, supported asset categories, and active index tickers.

Sample Response (200 OK):

{
  "platform": "Portfolio Dashboard",
  "version": "1.0.0",
  "status": "operational",
  "asset_classes": ["Equities (NSE & BSE)", "Corporate Bonds", "Government & Sovereign Bonds", "Daily Cash Flow & Transactions"],
  "indices_supported": ["NIFTY 50", "NIFTY NEXT 50", "NIFTY BANK", "NIFTY IT", "INDIA VIX"]
}
GET/api/v1/health

Verifies API service health and current UTC timestamp.

GET / POST/.well-known/mcp

Model Context Protocol (MCP) server endpoint for AI agents. GET returns server manifest and supports Server-Sent Events (SSE) streamable HTTP transport. POST handles JSON-RPC 2.0 tool execution.

  • get_market_quotes: Live Indian index quotes
  • get_portfolio_summary: Platform capability metrics
  • calculate_asset_allocation: Multi-asset allocation percentage calculator

Markdown Content Negotiation (acceptmarkdown.com)

AI crawlers and agents that require clean, token-efficient Markdown can supply the header:

Accept: text/markdown

The server automatically serves the Markdown representation with a corresponding Vary: Accept, Accept-Encoding header for CDN cache compliance.