frontend / api/analytics/priceTrend / getPriceTrend
Function: getPriceTrend()
getPriceTrend(
itemId,p?):Promise<PricePoint[]>
Defined in: src/api/analytics/priceTrend.ts:32
Fetch an item's price trend in a time window. Returns array of {date, price}. Empty array on errors.
Parameters
itemId
string
p?
from?
string = ...
supplierId?
string = ...
to?
string = ...
Returns
Promise<PricePoint[]>
Example
const points = await getPriceTrend('ITEM-123', {
from: '2025-09-01',
to: '2025-11-30',
supplierId: 'SUP-001'
});
return <LineChart data={points} />;