- Goto pricehistory.app and enter the url of item you want the price history of.
- Open the browser console and run the following function.
function downloadPriceDataIntoCSV() {
price_series = chart.data.datasets.filter(item => item.label == "Prices")[0].data
// Create CSV header
const headers = ['price,datetime\n'];
// Convert data to CSV rows
const csvRows = price_series.map(item =>
`${item.y},${item.x}`
);
// Combine headers and rows
const csvContent = headers.concat(csvRows).join('\n');
// Create blob and download link
const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
const link = document.createElement('a');
// Create download URL
const url = window.URL.createObjectURL(blob);
link.setAttribute('href', url);
link.setAttribute('download', 'data.csv');
// Append link, trigger download, and remove link
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
// Usage
downloadPriceDataIntoCSV();