Built and run by one person.

QREP API - Compare Securities (QuantStats)

TigZig API & MCP Hub
REST / HTTP APIMCP Server (AI agents)Analytics API

Open MCP + REST API that compares up to 6 securities against a benchmark and returns 81 QuantStats metrics per symbol - CAGR, Sharpe, Sortino, Max Drawdown, volatility and more. Powered by the original QuantStats library by Ran Aroussi (also the creator of yfinance). Built for AI agents first: the compare / MCP endpoint needs no key, and every page here has a Copy-as-Markdown button so you can hand it straight to your agent.

6securities per call
81QuantStats metrics
MCP + RESTtwo interfaces
OpenMCP, no auth
yfinancedata source
AI agents: this API is open (no auth). Start with the OpenAPI spec for this API: https://qrep-api.tigzig.com/v1/openapi.json. The RFC 9727 catalog at api.tigzig.com/.well-known/api-catalog is a site-level directory of all TigZig APIs - go there only if you want a different API, not for more detail on this one.
Quick start
MCP server for AI agents
https://qrep-api.tigzig.com/mcp
Streamable HTTP. Add as a custom connector in Claude.ai, ChatGPT, Cursor, n8n.
REST API base URL
https://qrep-api.tigzig.com/v1

Overview

The compare endpoint is a plain GET, no key: https://qrep-api.tigzig.com/v1/compare?symbols=AAPL,MSFT&start_date=2024-01-01&end_date=2024-12-31&benchmark=SPY (symbols, start_date, end_date are required; benchmark defaults to SPY). Also available via the MCP server below.

QREP compares up to 6 securities against a benchmark (default SPY) and returns 81 QuantStats metrics per symbol - CAGR, Sharpe, Sortino, Max Drawdown, volatility and more. Powered by the original QuantStats library by Ran Aroussi. Same engine behind the QREP app.

Two access shapes over the same backend:

  • REST - the open GET /v1/compare endpoint, no API key. For any HTTP client.
  • MCP - the mcp_compare_securities tool over the /mcp transport below, also no key. Built for AI agent clients; it calls the same compare endpoint.

The open-source backend also has /qpulse/* report endpoints (single-symbol analysis, multi-symbol compare, portfolio, HTML report + CSV export) that power the QREP frontend. Those are API-key gated and meant for self-hosting - they are not part of this hosted public surface. To build your own frontend, self-host and set your own QPULSE_API_KEY (see Build your own below).

MCP Server (for AI agents)

Connect an AI agent (Claude.ai, Cursor, n8n, custom clients) and let it compare securities directly. No auth. One endpoint:

  • https://qrep-api.tigzig.com/mcp - Streamable HTTP, the recommended transport (MCP spec 2025-03-26).

Tool: mcp_compare_securities - compare up to 6 symbols against a benchmark, 81 QuantStats metrics each. It is the only tool the server exposes, and it calls the same open GET /v1/compare endpoint. Parameters:

symbols:         "AAPL,MSFT,GOOG"   (comma-separated, max 6)
benchmark:       "SPY"               (default)
start_date:      "2020-01-01"        (YYYY-MM-DD)
end_date:        "2025-12-31"        (YYYY-MM-DD)
risk_free_rate:  0.045               (decimal, optional)

Example prompt: "Compare AAPL, MSFT and GOOG against SPY from 2020-01-01 to 2025-12-31."

Add to Claude.ai: Settings -> Connectors -> Add custom connector -> paste the Streamable HTTP URL -> approve. The same URL works for Cursor, n8n, and any MCP client.

How it works

  • FastAPI backend + the fastapi-mcp package, which exposes FastAPI endpoints as MCP tools.
  • The public compare endpoint is a GET at /v1/compare - no API key needed; the MCP tool wraps it.
  • Metrics computed with the original ranaroussi/quantstats library; prices from Yahoo Finance via yfinance (stocks, ETFs, metals, crypto).
  • Rate limited per IP with per-IP concurrency controls; deployed on Coolify (Hetzner) behind Cloudflare.

Build your own (open source)

The source is open - the repo runs the full QuantStats comparison backend, REST and MCP over the same code.

github.com/amararun/qrep-backend-fastapi

Built on FastAPI, fastapi-mcp, QuantStats, yfinance.

Self-hosting a public MCP server is your responsibility for security. A public endpoint needs edge rate limiting, abuse detection and secret hygiene. Full checklist: tigzig.com/security

Guides

This page is the reference - what the endpoints are and how to call them. The guides below are the long-form versions, with worked examples and the edges you only meet in real use:

Each is a plain page with a Markdown twin, so you can hand a URL straight to an agent. Come back to this page when you want parameter-level detail.

Rate limits

Published so a well-behaved client can plan around them. These are per-IP limits:

  • Per IP: 60 requests / minute.
  • Up to 6 symbols per request.

You get a 429 with Retry-After and a body telling you to batch to the cap and run batches sequentially.

Avoiding 429s: Batch symbols up to the cap in one call and run batches sequentially. Report-generating endpoints are serialised, so parallel calls queue rather than finish faster. The self-host-only /qpulse/* report endpoints have their own limits and require an API key.

Every successful response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (Unix epoch seconds), read straight from the running limiter, and Retry-After is set on 429. The current numbers are also published as machine-readable JSON at https://qrep-api.tigzig.com/, derived from live config. Read those at runtime rather than hard-coding the figures above - limits change, and these channels change with them.

API Endpoints (REST / HTTP)

Base URLhttps://qrep-api.tigzig.comPrepend this to every path listed below (e.g. /series becomes https://qrep-api.tigzig.com/series). The curl example on each card shows the full URL.
What is public here? The one open REST endpoint is GET /v1/compare - no key needed, and it is exactly what the MCP mcp_compare_securities tool calls under the hood. The backend also ships /qpulse/* report endpoints, but those are for self-hosters (API-key gated, used by the QREP frontend) and are intentionally not part of this hosted public surface.

Generated from the live OpenAPI spec - always in sync with the API. Try them interactively in Swagger.

GET /v1/compare

Mcp Compare

QREP security comparison. Returns 81 portfolio metrics per symbol, computed using the

ParamInTypeDescription
symbolsquerystringrequiredComma-separated Yahoo Finance ticker symbols, max 6 (e.g. AAPL,MSFT,GOOG)
benchmarkquerystringoptionalBenchmark symbol. Can be any valid Yahoo Finance ticker.
start_datequerystringrequiredStart date YYYY-MM-DD. Should be at least 6 months before end_date for meaningful analysis.
end_datequerystringrequiredEnd date YYYY-MM-DD. Must not be in the future.
risk_free_ratequerynumberoptionalRisk-free rate as decimal (e.g. 0.045 for 4.5%). Used in Sharpe, Sortino, Treynor, and other risk-adjusted calculations.
curl "https://qrep-api.tigzig.com/v1/compare?symbols=AAPL,MSFT&start_date=2020-01-01&end_date=2024-12-31"