API Live

Build with
FolioForecast

Programmatic portfolio optimization for AI agents, robo-advisors, and fintech apps. One API call to optimize, search, or stress-test any portfolio.

Explore the API View Pricing
No subscription required Usage-based pricing Works with any language
Quick Start

Getting Started — Connect Your AI

FolioForecast is a calculation engine. Your AI does the thinking — we do the math. Pick your path below and you'll be running portfolio optimizations in minutes.

Your AI analyzes. We calculate.

  Get Your Free API Key
One engine. Three tools. Two AI platforms.

The FolioForecast API powers Portfolio, Budget, and Retirement tools. Pick your integration path — the math is the same, only the wiring differs.

ChatGPT — via Custom GPT

Uses OpenAI Actions (OpenAPI). No install, no config — open a pre-built GPT or import our spec into your own. See the ChatGPT tab below.

claude.ai — Custom Connector new

No install. Paste our connector URL into claude.ai or the Claude mobile app, sign in with Clerk, and Claude can call our tools directly. See the Claude tab below.

Claude Desktop / Cursor / Windsurf — local MCP

For power users who prefer a local install. Uses the Model Context Protocol over stdio — same tools, same math, faster round-trip. See the Claude tab below.

Try our pre-built GPTs

Each GPT comes pre-configured with the right API schema and instructions. You'll need your own API key for full access — the GPT will ask for it or help you create one.

Without a key you get 10 demo calls/day. With a key: pay-as-you-go at $0.10/unit, or subscribe for $0.05/unit + 10 free units/month.

Portfolio Optimizer Budget Planner Retirement Planner

Want to build your own? Follow the steps below to create a custom GPT with your own API key.

1

Get your API key

Click the button above to go to your FolioForecast dashboard. Under Settings → API Keys, click Create Key. Copy the key that starts with ff_live_ — you'll need it in a moment.

2

Open ChatGPT and create a Custom GPT

In ChatGPT, click your profile picture → My GPTsCreate a GPT. This creates a version of ChatGPT that knows how to talk to FolioForecast.

3

Add the FolioForecast action

In the GPT editor, go to the Configure tab → scroll to Actions → click Create new action. Under Import from URL, paste this OpenAPI spec URL:

https://www.folioforecast.com/api/v1/openapi.json

Then click Authentication → choose API Key → set the header name to X-API-Key → paste your key.

4

Add these instructions

In the Instructions field of your Custom GPT, paste this (or write your own):

You are a portfolio analyst powered by FolioForecast.

When a user asks about investing or portfolios:
1. Use /api/v1/search to find the right ticker symbols.
2. Use /api/v1/optimize to calculate optimal portfolio weights.
3. Explain the results in plain English — what to buy,
   how much, and why.

FolioForecast is a calculator, not an advisor.
Always remind users the results are math, not advice.
5

Try it out

Save your GPT and ask it something like: "Optimize a portfolio of AAPL, MSFT, GOOGL, and AMZN for maximum risk-adjusted return." ChatGPT will call FolioForecast, get the math, and explain the results to you.

There are two ways to connect Claude to FolioForecast — both use the same tool surface (optimize_portfolio, search_tickers, stress_test, and 16 more). Pick whichever matches your workflow.

Path A — claude.ai web & mobile (no install) recommended

Uses our hosted Custom Connector. Sign in with your FolioForecast account and Claude can call your portfolio, budget, and retirement tools from any claude.ai chat. Works on desktop browsers, the Claude mobile app, and claude.com.

1

Copy the connector URL

This is the only thing Claude needs to find us:

https://www.folioforecast.com/mcp
2

Add it to claude.ai

In claude.ai → Settings → Connectors, click Add custom connector and paste the URL above. Claude will redirect you to FolioForecast to sign in — your Clerk login works as-is, no new password.

First connect? We create a dedicated API key for you behind the scenes (tier: starter — same free credits as any new account) and link Claude to it. You can revoke the connection any time from the FolioForecast dashboard.

3

Try it out

Open a new chat in claude.ai and ask:

Using FolioForecast, optimize a portfolio of AAPL.US, MSFT.US, GOOGL.US, AMZN.US
against SPY.US for maximum Sharpe ratio. Show the weights and metrics.

Claude will prompt you to approve FolioForecast the first time a tool is called, then run optimize_portfolio and explain the results.

How your data is handled. Claude connects via OAuth 2.1 with PKCE — no password is shared and no raw API key leaves our servers. Every call is logged against your FolioForecast usage meter; hard ceilings still apply. Revoke at any time from Settings → Connected apps.

Path B — Claude Desktop / Cursor / Windsurf (local install)

For power users who want the tools running on their own machine (faster, runs offline for everything except market data). Works with Claude Desktop, Claude Code, Cursor, and Windsurf.

1

Get your API key

Click Get Your Free API Key above to open your FolioForecast dashboard. Under Settings → API Keys, click Create Key. Copy the key that starts with ff_live_.

2

Install the MCP server

Two runtimes, same tools. Pick whichever ecosystem you already have.

Node — works today npm live

Requires Node 18 or newer. Installs globally as folioforecast-mcp.

npm install -g @folioforecast/mcp-server
Python — coming with v0.1 PyPI rolling out

Requires Python 3.10 or newer. Same tool surface as the Node server.

pip install "folioforecast[mcp]"

The Python package is in the repo and tagged v0.1.0. PyPI upload is imminent — watch the GitHub release for the green light.

New to the terminal? On Mac, search for “Terminal” in Spotlight. On Windows, search for “Command Prompt” or “PowerShell.” Paste the command and press Enter.

3

Configure Claude Desktop

Open Claude Desktop → Settings (gear icon) → DeveloperEdit Config. Paste one of the snippets below into the JSON file that opens, using the runtime you just installed.

Node runtime

{
  "mcpServers": {
    "folioforecast": {
      "command": "folioforecast-mcp",
      "env": {
        "FOLIOFORECAST_API_KEY": "ff_live_YOUR_KEY_HERE"
      }
    }
  }
}

Python runtime

{
  "mcpServers": {
    "folioforecast": {
      "command": "python",
      "args": ["-m", "folioforecast.mcp"],
      "env": {
        "FOLIOFORECAST_API_KEY": "ff_live_YOUR_KEY_HERE"
      }
    }
  }
}

Save the file and restart Claude Desktop. You should see the FolioForecast tools appear in the attachment menu (the paperclip icon).

4

Try it out

Open a new chat in Claude Desktop (not claude.ai in your browser — that doesn’t load MCP servers) and ask:

Optimize a portfolio of AAPL.US, MSFT.US, GOOGL.US, and AMZN.US for maximum Sharpe ratio.
Use SPY.US as the benchmark and show me the weights and metrics.

Claude will call optimize_portfolio, get the math back from our engine, and explain the results in plain English. Tip: tickers work best in SYMBOL.EXCHANGE format (e.g. AAPL.US, VOD.LSE).

Not seeing the tools in Claude? Quit Claude Desktop completely (Cmd+Q on Mac / right-click tray icon on Windows) and relaunch — just closing the window doesn’t reload MCP servers. Still stuck? Check Settings → Developer → Open MCP Logs for the folioforecast server’s output.

The folioforecast Python SDK wraps the same HTTP API in a clean synchronous client. Zero heavy dependencies — just httpx. Python 3.10 or newer. Ideal for scripts, notebooks, cron jobs, and backtests.

1

Get your API key

Open your FolioForecast dashboard. Under Settings → API Keys, click Create Key. Copy the key that starts with ff_live_.

2

Install the SDK

Open your terminal and run:

pip install folioforecast

  v0.1.0 is in the repo; PyPI publish is imminent. Until then you can install directly from source:

# Interim — install from the repo
git clone https://github.com/shadow6-actual/V6_EODHD_POpt.git
cd V6_EODHD_POpt/python-sdk
pip install -e .

New to Python? Grab it free from python.org, then open Terminal (Mac) or PowerShell (Windows) to run the command above.

3

Run your first optimization

Create a new file (e.g. my_portfolio.py) and paste this:

import folioforecast as ff

client = ff.Client(api_key="ff_live_YOUR_KEY_HERE")

# Ask FolioForecast to calculate the optimal mix
result = client.optimize(
    tickers=["AAPL.US", "MSFT.US", "GOOGL.US", "AMZN.US"],
    goal="max_sharpe",
)

print(result.weights)    # {'AAPL.US': 0.30, 'MSFT.US': 0.25, ...}
print(result.metrics)    # {'sharpe': 1.42, 'volatility': 0.18, ...}

Ticker format: use SYMBOL.EXCHANGE (e.g. AAPL.US, VOD.LSE, SAP.XETRA). The SDK also exposes search_tickers(), stress_test(), asset_metadata(), and usage().

4

Run it

In your terminal:

python my_portfolio.py

That’s it. FolioForecast does the heavy math — your code just sends tickers and gets back optimal weights and metrics.

No package install? No problem. The SDK is a convenience wrapper, not a requirement. You can call the API directly with httpx, requests, or curl against https://www.folioforecast.com/api/v1. See the OpenAPI spec for the full request/response shapes.
Use Cases

What You Can Build

The FolioForecast API gives you the same professional-grade optimization engine that powers our web app — accessible via simple REST calls.

AI Portfolio Agents

Let LLM-powered agents optimize portfolios on behalf of users. Provide tickers and constraints, get back optimal weights and metrics.

Robo-Advisor Backends

Power automated portfolio management with Mean-Variance, CVaR, Risk Parity, and robust optimization methods — no quant team required.

Custom Dashboards

Embed optimization results, stress tests, and efficient frontier data into your own app or internal tools.

Endpoints

Core API Surface

Four endpoints cover the full optimization workflow. All return JSON.

POST /api/v1/optimize
Run portfolio optimization. Supports Max Sharpe, Min Volatility, CVaR, Risk Parity, Kelly, and all robust methods. Returns optimal weights, metrics, and efficient frontier data.
1–3 compute units
GET /api/v1/search?q=
Search 100,000+ tickers across US, UK, and global exchanges. Returns symbol, name, exchange, and asset type.
Free (0 units)
POST /api/v1/crisis-scenarios
Stress-test a portfolio against historical crises (2008 GFC, COVID crash, dot-com, etc.). Returns drawdowns, recovery times, and relative performance.
3 compute units
POST /api/v1/asset-metadata
Look up sector, industry, asset class, and market cap classification for any list of tickers.
0.1 units per ticker
Try it now — this endpoint is live
# Health check — no authentication required
curl https://www.folioforecast.com/api/v1/health

# Response
{
  "status": "ok",
  "version": "v1",
  "api": "FolioForecast Agent API",
  "auth": "API key (X-API-Key header)",
  "billing": "Usage-based per compute unit ($0.05 subscriber / $0.10 pay-as-you-go)",
  "rate_limiting": "Per API key, tier-based RPM limits. See X-RateLimit-* headers.",
  "docs": "https://www.folioforecast.com/developers",
  "openapi_spec": "https://www.folioforecast.com/api/v1/openapi.yaml",
  "key_format": "ff_live_<32-char-hex>",
  "optimization_goals": ["equal_weight", "max_sharpe", "min_volatility", ...],
  "endpoints": { ... }
}

  Building an AI agent? Import our OpenAPI spec directly:

  OpenAPI Spec (YAML)   OpenAPI Spec (JSON)
Authentication

API Keys

Each API key is scoped to a single environment and tied to a billing account.

Key Format

Production keys start with ff_live_ followed by 32 hex characters. Sandbox keys use ff_test_ — same format, no billing.

How to Authenticate

Pass your key via the X-API-Key header on every request. Alternatively, use Authorization: Bearer ff_live_....

Rate Limits

Limits are per API key, not per IP. Responses include X-RateLimit-Remaining and Retry-After headers.

Security

Keys are SHA-256 hashed at rest — we never store your raw key. Rotate keys anytime from your dashboard. HTTPS required on all calls.

Usage-Based Pricing

Pay for What You Use

Every API call costs compute units. Subscribers get 10 free units/month and half-price rates. No subscription? No problem — just sign up and add a payment method.

Pay-as-You-Go
$0.10 /unit
No free units — pay from unit 1
API access only
  • All endpoints
  • 10 req/min
  • Sandbox + production
  • Email support
Enterprise
Custom
Volume pricing
Dedicated infrastructure
  • All endpoints
  • Custom rate limits
  • SLA guarantee
  • Dedicated support

Subscribe to Individual ($8/mo) or Advisor (waitlist) to unlock half-price API rates + 10 free units + full web app. Need volume? Contact us for enterprise pricing.

Get Started

Set Up API Access

Create a free account, add a payment method, and generate your API key — all in under 2 minutes.

1

Sign Up

Create a free FolioForecast account (takes 30 seconds)

2

Add Payment

Add a payment method via Stripe (only charged for usage)

3

Get Your Key

Generate an API key and start making calls

Get API Access

Developer FAQ

When will the API endpoints go live?
All API endpoints are live. Sign up for a free account, add a payment method, and generate your API key — then start calling /optimize, /search, /crisis-scenarios, and /asset-metadata right away. Subscribers get even better rates. See the OpenAPI spec for full details.
Do I need a paid subscription to use the API?
No! Any FolioForecast account can use the API. Just create a free account, add a payment method, and you're ready to go at $0.10/unit pay-as-you-go. Subscribers (Individual $8/mo) get half-price rates ($0.05/unit) plus 10 free compute units per month.
What counts as a compute unit?
Each endpoint has a fixed cost. Ticker search is free (0 units). A basic optimization is 1 unit. Robust optimization is 3 units (more compute-intensive). Crisis scenario analysis is 3 units. Asset metadata is 0.1 units per ticker. These costs are shown on each endpoint card above.
What programming languages are supported?
The API is a standard REST API that returns JSON — any language that can make HTTP requests works. Official first-party clients:
  • Node / TypeScriptnpm install -g @folioforecast/mcp-server ships an MCP server for Claude Desktop, Cursor, and Windsurf.
  • Pythonpip install folioforecast ships a synchronous SDK and a Python MCP server (python -m folioforecast.mcp). v0.1 rolling out to PyPI.
For anything else — Go, Rust, Ruby, Java, Elixir, plain curl — import our OpenAPI spec into your code generator of choice.
Is there a sandbox environment?
Yes. Sandbox API keys (ff_test_*) hit the same endpoints but don't incur billing. Use them for development and testing. Switch to production keys (ff_live_*) when you're ready to go live.

Ready to Integrate?

The API is live. Create a free account, add a payment method, and start building in minutes — no subscription required.

Get API Access See Subscription Plans