|
|
|
|
@ -310,11 +310,19 @@ async def get_price_data_simple(
|
|
|
|
|
period: Optional[str] = Query(None, description="Period like '1d', '7d', '1m', '3m', '6m', '1y', '2y', '5y', 'max'"),
|
|
|
|
|
start_date: Optional[date] = Query(None, description="Start date for data retrieval (use with end_date, not with period)"),
|
|
|
|
|
end_date: Optional[date] = Query(None, description="End date for data retrieval (use with start_date, not with period)"),
|
|
|
|
|
start: Optional[date] = Query(None, description="Alias for start_date"),
|
|
|
|
|
end: Optional[date] = Query(None, description="Alias for end_date"),
|
|
|
|
|
interval: str = Query("1d", description="Data interval: 1d, 1w, 1m, 5d, 1h, etc."),
|
|
|
|
|
force_refresh: bool = Query(False, description="Force refresh from Yahoo Finance"),
|
|
|
|
|
db: AsyncSession = Depends(get_db)
|
|
|
|
|
):
|
|
|
|
|
"""Simplified GET endpoint for price data"""
|
|
|
|
|
# Resolve aliases: start/end → start_date/end_date
|
|
|
|
|
if start and not start_date:
|
|
|
|
|
start_date = start
|
|
|
|
|
if end and not end_date:
|
|
|
|
|
end_date = end
|
|
|
|
|
|
|
|
|
|
# Validate that either period OR date range is provided, not both
|
|
|
|
|
if period and (start_date or end_date):
|
|
|
|
|
raise HTTPException(
|
|
|
|
|
|