⚠ MVP PreviewReport a Bug

Getting Started

API and MCP Setup

Step-by-step guide: get your key, make your first REST call, and connect via MCP.

Get from zero to a working FinanceDataAPI connection in four steps. Every code block is copy-paste ready: store your key in FDA_KEY, make your first REST call, then connect the same credential to an MCP client.


Step 1 - Create an account and load your API key

  1. Go to app.financedata.com/signup and create a free account.
  2. In the dashboard, open API Keys and click Create key.
  3. Store the key in your shell before you run any examples:
# macOS / Linux
export FDA_KEY="your_api_key_here"
 
# Windows PowerShell
$env:FDA_KEY = "your_api_key_here"

Then verify that Python can read it:

import os
 
api_key = os.environ["FDA_KEY"]
print(f"Loaded FinanceDataAPI key starting with: {api_key[:6]}...")

Keep your key secret and never hard-code it into production code or shared screenshots.


Step 2 - Make your first REST request

The quickest end-to-end check is a 20-day SMA request for AAPL:

import os
import requests
 
response = requests.get(
    "https://api.financedata.com/v1/signals/SMA/AAPL",
    params={
        "start_date": "2025-01-01",
        "end_date": "2025-04-30",
        "period": 20,
    },
    headers={"X-API-Key": os.environ["FDA_KEY"]},
    timeout=30,
)
response.raise_for_status()
data = response.json()
print(data)

Expected response shape:

{
  "symbol": "AAPL",
  "signal_name": "SMA",
  "parameters": {
    "period": 20
  },
  "data": [
    { "timestamp": "2026-04-16", "value": 185.42 },
    { "timestamp": "2026-04-15", "value": 184.89 }
  ]
}

Step 3 - Try a different signal

Once the first call works, swap in another supported signal and adjust the parameters:

import os
import requests
 
signal = "RSI"
 
response = requests.get(
    f"https://api.financedata.com/v1/signals/{signal}/AAPL",
    params={
        "start_date": "2025-01-01",
        "end_date": "2025-04-30",
        "period": 14,
    },
    headers={"X-API-Key": os.environ["FDA_KEY"]},
    timeout=30,
)
response.raise_for_status()
print(response.json())

Try SMA, EMA, RSI, MACD, BollingerBands, ATR, VWAP, or ADX, then browse the Signals section for endpoint-specific examples.


Step 4 - Connect FinanceDataAPI via MCP

Add FinanceDataAPI as an MCP server in your client config so your AI tool can call the same signal endpoints directly.

MCP client config

{
  "name": "financedataapi",
  "url": "https://api.financedata.com/v1/mcp",
  "headers": {
    "X-API-Key": "YOUR_API_KEY"
  }
}

If you want to generate that block from the same environment variable you used for REST, this Python snippet prints a ready-to-paste config object:

import json
import os
 
config = {
    "name": "financedataapi",
    "url": "https://api.financedata.com/v1/mcp",
    "headers": {
        "X-API-Key": os.environ["FDA_KEY"],
    },
}
 
print(json.dumps(config, indent=2))

Then:

  1. Open your MCP client's config file (for example, claude_desktop_config.json).
  2. Add the config block above to your mcpServers entry.
  3. Save the file and fully restart the client.
  4. Send a test prompt such as:
prompt = "Fetch the RSI for TSLA over the last 60 days and tell me if it looks overbought."
print(prompt)

If the client is configured correctly, it should discover FinanceDataAPI tools and begin issuing requests through the MCP endpoint. For more detailed client-specific instructions, see the MCP docs.