Skip to content

JamesEHart/finsight-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FinSight API

Stock Enrichment & Analysis API — real-time quotes, technical indicators, and plain-English stock summaries in one fast, simple API.

Why FinSight?

Most stock APIs dump raw numbers at you. FinSight gives you enriched, analysis-ready data — P/E ratios, RSI signals, moving average crossovers, and plain-English summaries that your users can actually understand. Perfect for:

  • Investment dashboards & portfolio trackers
  • Stock screeners and research tools
  • Financial newsletters and alerts
  • Trading bots and algorithmic strategies
  • Fintech apps for non-technical users

Endpoints

GET /quote/{ticker}

Real-time price + full fundamental profile.

Example: GET /quote/AAPL

{
  "ticker": "AAPL",
  "name": "Apple Inc.",
  "price": 189.50,
  "change": -1.20,
  "change_pct": -0.63,
  "market_cap": 2940000000000,
  "pe_ratio": 29.4,
  "forward_pe": 26.1,
  "eps": 6.45,
  "profit_margins": 0.254,
  "week_52_high": 220.20,
  "week_52_low": 164.08,
  "dividend_yield": 0.0053,
  "beta": 1.24,
  "sector": "Technology",
  "analyst_recommendation": "buy",
  "analyst_target_price": 210.00,
  "timestamp": "2026-03-24T10:30:00Z"
}

GET /technicals/{ticker}

RSI, MACD, Bollinger Bands, moving averages + actionable signals.

Params: period = 1mo | 3mo | 6mo (default) | 1y | 2y

Example: GET /technicals/TSLA?period=3mo

{
  "ticker": "TSLA",
  "price": 245.10,
  "rsi_14": 58.3,
  "rsi_signal": "neutral",
  "ma_20": 240.50,
  "ma_50": 232.10,
  "ma_200": 218.40,
  "macd": 3.21,
  "macd_signal": 2.88,
  "macd_histogram": 0.33,
  "bollinger_upper": 258.40,
  "bollinger_lower": 222.60,
  "signals": [
    {"indicator": "RSI", "signal": "NEUTRAL", "reason": "RSI 58.3 — no extreme"},
    {"indicator": "MA50", "signal": "BUY", "reason": "Price $245.10 above 50-day MA $232.10"},
    {"indicator": "Golden Cross", "signal": "BUY", "reason": "50-day MA above 200-day MA"},
    {"indicator": "MACD", "signal": "BUY", "reason": "MACD histogram positive (0.33)"}
  ],
  "overall_signal": "BULLISH",
  "buy_signals": 3,
  "sell_signals": 0
}

GET /summary/{ticker}

Plain-English analyst-style summary — great for newsletters, dashboards, and user-facing apps.

Example: GET /summary/MSFT

{
  "ticker": "MSFT",
  "name": "Microsoft Corporation",
  "price": 415.20,
  "summary": "Microsoft Corporation is a technology company operating in software infrastructure. It is a mega-cap at $3,090B market cap. With a trailing P/E of 35.2x, the stock appears growth-priced relative to earnings. Forward P/E of 30.1x suggests analysts expect earnings to grow. Profit margins are strong at 35.8%. Technically, the stock is trading above its 50-day moving average (short-term bullish), above its 200-day MA (long-term uptrend), RSI of 62.1 (neutral). The stock is 8.2% below its 52-week high of $452.45 and 31.4% above its 52-week low of $316.02.",
  "rsi": 62.1,
  "ma_50": 408.30,
  "ma_200": 380.10,
  "analyst_recommendation": "buy",
  "analyst_target_price": 460.00
}

GET /compare?tickers=AAPL,MSFT,GOOGL

Side-by-side comparison of up to 5 stocks. Perfect for comparison tables and charts.

Params: tickers = comma-separated list of up to 5 symbols


GET /health

Health check endpoint. Returns {"status": "ok"}.


Quick Start

import requests

headers = {
    "X-RapidAPI-Key": "YOUR_KEY_HERE",
    "X-RapidAPI-Host": "finsight-api.p.rapidapi.com"
}

# Get a quote
r = requests.get("https://finsight-api.p.rapidapi.com/quote/AAPL", headers=headers)
data = r.json()
print(f"{data['name']}: ${data['price']} ({data['change_pct']}%)")

# Get technicals
r = requests.get("https://finsight-api.p.rapidapi.com/technicals/AAPL?period=3mo", headers=headers)
tech = r.json()
print(f"RSI: {tech['rsi_14']} | Signal: {tech['overall_signal']}")

# Get plain-English summary
r = requests.get("https://finsight-api.p.rapidapi.com/summary/AAPL", headers=headers)
print(r.json()["summary"])
// JavaScript
const options = {
  method: 'GET',
  headers: {
    'X-RapidAPI-Key': 'YOUR_KEY_HERE',
    'X-RapidAPI-Host': 'finsight-api.p.rapidapi.com'
  }
};

const res = await fetch('https://finsight-api.p.rapidapi.com/quote/AAPL', options);
const data = await res.json();
console.log(data.price, data.pe_ratio);

Supported Tickers

All US equities and most global stocks available on Yahoo Finance: NYSE, NASDAQ, AMEX, LSE, TSX, and more. Crypto, ETFs, and indices also supported (e.g. BTC-USD, SPY, ^GSPC).


Rate Limits & Plans

Plan Requests/month Rate limit Price
Basic (Free) 500 1 req/sec $0
Pro 10,000 5 req/sec $15/mo
Business 100,000 20 req/sec $49/mo
Enterprise Unlimited Custom $149/mo

Local Development

git clone <your-repo>
cd finance-api
pip install -r requirements.txt
uvicorn main:app --reload
# API live at http://localhost:8000
# Docs at http://localhost:8000/docs

Tech Stack

  • FastAPI — async Python web framework
  • yfinance — Yahoo Finance data (no paid API key needed)
  • uvicorn — ASGI server
  • Deployed on Render/Railway — free tier available

About

Stock enrichment API - real-time quotes, RSI, MACD, moving averages, and plain-English summaries in one call.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages