
We're excited to announce a new way to query the /hourly endpoint: in addition to the existing start_date / end_date parameters, you can now specify your time range using start and end Unix timestamps. This gives you precise hour-level control over the data you fetch, without the overhead of pulling a full day of rates when you only need a few hours.
Date strings are convenient, but they come with hidden costs: every query returns 24 hourly entries per day, and turning a server-side timestamp into a YYYY-MM-DD string requires timezone handling on the client. Unix timestamps fix both:
To query a specific hour range, make a GET request with start and end set to Unix timestamps (seconds since epoch):
https://api.metalpriceapi.com/v1/hourly?api_key=[API_KEY]&base=USD¤cy=XAU&start=1762128000&end=1762146000
The example above returns 6 hourly entries from 2025-11-03 00:00 UTC through 05:00 UTC.
USD.XAU).Fetch a single hour (start and end set to the same hour):
https://api.metalpriceapi.com/v1/hourly?api_key=[API_KEY]¤cy=XAG&start=1762128000&end=1762128000
Fetch a full UTC day — 24 hourly entries from 00:00 through 23:00:
https://api.metalpriceapi.com/v1/hourly?api_key=[API_KEY]¤cy=XAU&start=1762128000&end=1762210800
start / end and start_date / end_date cannot be combined in the same call. The same applies to date_type (today, yesterday, week).The new parameters are live across all MetalpriceAPI endpoints — no migration or version bump required. Existing date-string queries continue to work exactly as before. For full details, visit the API documentation.
If you have questions or run into issues, our support team is happy to help.
— MetalpriceAPI Team