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

Quick start

AI agents: this API is open (no auth). Start with the OpenAPI spec for this API: https://qrep-api.tigzig.com/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.
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
Live tool no sign-up
Compare securities and generate the report from a form.

Documentation

For people
qrep-api.tigzig.com/redoc

The full reference. Every endpoint, every field, and every enforced limit with the message you get when you cross it. Rendered from the running service, so it is never a copy that can fall behind.

For AI agents
qrep-api.tigzig.com/openapi.json

The machine contract for this API. The site-wide directory of every TigZig API is the RFC 9727 catalog at api.tigzig.com/.well-known/api-catalog.

What you can call

1 endpoint. Request bodies, every field and every enforced limit are in the full reference.

GET/v1/compareMcp Compare

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.

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.

Try it

No key, no signup.

Mcp Compare
Paste into a browser address bar.
https://qrep-api.tigzig.com/v1/compare?symbols=AAPL%2CMSFT&start_date=2023-01-01&end_date=2023-12-31
Response first lines of 7 KB
{
 "success": true,
 "benchmark": "SPY",
 "start_date": "2023-01-01",
 "end_date": "2023-12-31",
 "risk_free_rate": 0,
 "symbols": [
  {
   "symbol": "AAPL",
   "success": true,
   "trading_days": 249,
   "error": null,
   "all_metrics": {
    "Start Period": "2023-01-04",
    "End Period": "2023-12-29",
    "Risk-Free Rate": 0,
    "Time in Market": 1,
    "Cumulative Return": 0.55,
    "CAGR﹪": 0.56,
    "Sharpe": 2.32,
    "Prob. Sharpe Ratio": 0.99,
    "Smart Sharpe": 2.2,
    "Sortino": 3.71,
    "Smart Sortino": 3.51,
    "Sortino/√2": 2.62,
    "Smart Sortino/√2": 2.49,
    "Omega": 1.46,
    "Max Drawdown": -0.14932,
    "Max DD Date": "2023-10-26",
    "Max DD Period Start": "2023-07-31",
    "Max DD Period End": "2023-12-12",
    "Longest DD Days": 94,
    "Volatility (ann.)": 0.2,
    "R^2": 0.52,
    "Information Ratio": 0.1,
    "Calmar": 3.72,
    "Skew": 0.01,
...

Open-source edition

There is an open-source edition of this comparison backend - an earlier release you can run as your own service or borrow components from. Treat it as a reference implementation rather than a mirror of what is running here: the hosted service has moved on since.

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