Accessing Historical Data

Learn how to query historical metal prices and perform time-series analysis.

6 min read Last updated: 2025-06-13

Historical Endpoint

Access historical data for any date:
GET /api/v1/historical/2024-12-25?api_key=YOUR_API_KEY&symbols=XAU,XAG

Date Range Limitations

Historical data availability by plan:
• Free: Last 7 days
• Essential: Last 30 days
• Basic: Last 1 year
• Professional: Last 5 years
• Enterprise: Full historical data

Time Series Data

Get data for a date range:
GET /api/v1/timeseries?api_key=YOUR_API_KEY&start_date=2025-01-01&end_date=2025-01-31&symbols=XAU

Analyzing Price Trends

Example: Calculate moving average
function movingAverage(prices, period) {
  const result = [];
  for (let i = period - 1; i < prices.length; i++) {
    const sum = prices.slice(i - period + 1, i + 1)
      .reduce((a, b) => a + b, 0);
    result.push(sum / period);
  }
  return result;
}

Ready for the next step?

Continue learning with our next guide:

Next: Best Practices