DEV Community

scru
scru

Posted on

I built a stock market data API with FastAPI, here's what I learned

What I built

A REST API that gives developers access to real-time stock
quotes, historical data, technical indicators, and crypto
prices. Built with FastAPI and deployed on Railway.

Endpoints

  • GET /stocks/quote/{symbol} — live price, volume, change
  • GET /stocks/history/{symbol} — OHLCV going back years
  • GET /stocks/indicators/{symbol} — RSI, MACD, SMA, EMA
  • GET /stocks/info/{symbol} — market cap, P/E, sector
  • GET /crypto/quote/{symbol} — crypto prices
  • GET /market/movers — top gainers and losers
  • POST /stocks/batch — multiple symbols at once

Tech stack

  • FastAPI (Python)
  • yfinance for data
  • PostgreSQL on Railway
  • Stripe for billing
  • slowapi for rate limiting

Try it free

100 requests/day, no credit card required.

👉 https://thisapi-production-d755.up.railway.app

Top comments (0)