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)}")