Time-Series Endpoint
Metals-API timeseries
endpoint lets you query the API for daily historical rates between two dates of your choice. (The date limits per API request depends on the acquired plan).
This endpoint has a limitation depending on the acquired plan, and only one symbol per request. If you need to query more than for example 30 days and more than one symbol, you should send another API call.
For LMBA and LME markets, the Information provided in this endpoint corresponds to the last known price of the day before. Ex: 2022-03-20 shows the 19th's closing price.
You can not use the current date on the parameter "end_date". We recommend using a day prior to the current date in order to get a successful response. To get the last price you will have to use the latest endpoint.
API Request:
https://metals-api.com/api/timeseries ? access_key = API_KEY & start_date = 2012-05-01 & end_date = 2012-05-25 & symbols = USD
Request Parameters:
Parameter | Description |
---|---|
access_key |
[required] Your API Key. |
start_date |
[required] The start date of your preferred timeframe. (The date limits per API request depends on the acquired plan). |
end_date |
[required] The end date of your preferred timeframe. (The date limits per API request depends on the acquired plan). |
base |
[optional] Enter the three-letter currency code or metal code of your preferred base currency. |
symbols |
[required] Enter one currency or metal codes to limit the output. |
API Response:
{ "success": true, "timeseries": true, "start_date": "2012-05-01", "end_date": "2012-05-03", "base": "EUR", "rates": { "2012-05-01":{ "USD": 1.322891, "AUD": 1.278047, "CAD": 1.302303 }, "2012-05-02": { "USD": 1.315066, "AUD": 1.274202, "CAD": 1.299083 }, "2012-05-03": { "USD": 1.314491, "AUD": 1.280135, "CAD": 1.296868 }, [...] } }
Response Objects:
Response Object | Description |
---|---|
success |
Returns true or false depending on whether or not your API request has succeeded. |
timeseries |
Returns true if a request to the timeseries endpoint is made. |
start_date |
The start date of your time frame. |
end_date |
The end date of your time frame. |
base |
Returns the three-letter currency code or metal code of the base currency used for this request. |
rates |
Returns exchange rate data for the currencies you have requested. |
Example request in Postman: