lucifer7210's picture
Upload 21 files
eb606e1 verified
raw
history blame contribute delete
642 Bytes
from fastapi import APIRouter, Depends, HTTPException
from app.services.data_fetcher import MutualFundDataFetcher
from app.models.fund_models import MarketIndicesResponse
router = APIRouter()
@router.get("/indices", response_model=MarketIndicesResponse)
async def get_market_indices():
"""
Get current market indices data including Nifty 50, Sensex, etc.
"""
try:
fetcher = MutualFundDataFetcher()
indices_data = fetcher.get_market_indices()
return indices_data
except Exception as e:
raise HTTPException(status_code=500, detail=f"Error fetching market indices: {str(e)}")