Documentation
Introduction
Metals.Dev API provides a simple to use, developer friendly, JSON API for spot prices of precious metals, industrial metals and currency conversion rates. We provide affordable pricing, which makes our API perfect for businesses of any size from startups to enterprises in need of reliable Metals API.
The API provides a live feed of Gold, Silver, Platinum & Palladium with a maximum delay of 60 seconds even for the Free Plan.
Powered by 15+ exchanges & data sources for precious metals, industrial metals & currencies, the Metals.Dev API is capable of delivering real-time precious metals rate data. The API comes with multiple endpoints, each serving a different use case.
In this documentation you will learn about API endpoints, responses, and potential errors. In case any question was left unanswered, please contact us and our team will help you out.
The API provides a live feed of Gold, Silver, Platinum & Palladium with a maximum delay of 60 seconds even for the Free Plan.
Powered by 15+ exchanges & data sources for precious metals, industrial metals & currencies, the Metals.Dev API is capable of delivering real-time precious metals rate data. The API comes with multiple endpoints, each serving a different use case.
In this documentation you will learn about API endpoints, responses, and potential errors. In case any question was left unanswered, please contact us and our team will help you out.
Try Metals.Dev API
Select an endpoint to try the API. Usage will count against your monthly quota.
Copy Code
API Endpoint
The URL for requesting rates for the selected API endpoint.
Definitions
Property | Description |
---|---|
API Key | An unique key to each account to authenticate interactions with the API. |
Currency | When provided, the API will return the prices for the currency. Default is USD. |
Unit | When provided, the API will return the prices converted to the unit. Default is toz (Troy Ounce). |
API Key
Your account's API Key can be found on the Dashboard. It is a unique key that must be passed as a parameter to every request to authenticate with Metals.Dev API.
Your API Key should not be shared with anyone. You can generate a new API key on the Dashboard, if required.
Your API Key should not be shared with anyone. You can generate a new API key on the Dashboard, if required.
Base URL
Usage
Currency
The API returns the rates in USD by default. You can use the
currency
parameter to modify this behaviour.Usage
View all the supported currencies.
Unit
The API returns the rates in their default units. For Precious Metals, the default unit will be 'toz' (Troy Ounce). For Industrial Metals, the default unit will be 'mt' (Metric Tonne). You can use the
unit
parameter to modify this behaviour.Usage
View all the supported units.
API Response
The response to all our API endpoints will return a standard JSON format and can be parsed easily irrespective of progamming languages. Every API response will include the following properties.
Property | Description |
---|---|
status | The status of the request. Values are 'success' or 'failure'. |
currency | The currency used for the request. Default is USD |
unit | The unit used for the request. |
timestamp | An ISO timestamp indicating the date & time the data is collected. This value also includes the timezone information. |
error_code | An error code will be included when the status is 'failure'. |
error_message | An error message containing the description of the failure will be included when the status is 'failure'. |
Error Codes
When an API call fails for any reason, a JSON error is returned. The error response always come with an error code and a message.
Possible Error Codes
Code | Description |
---|---|
1101 | The API Key provided is invalid. |
1201 | The plan is not active due to failed payments. |
1202 | The account is not active or disabled. |
1203 | The quota for the current month including the grace usage is exceeded. |
2101 | Unsupported input parameters like Metal Code, Authority Code or Unit Code. |
2102 | Mandatory input parameters missing from the API request. |
2103 | Unsupported currency code passed as a parameter. |
2104 | The date format is invalid. Valid date format is "YYYY-MM-DD". Eg: "2023-01-25" |
2105 | The start date & end date range passed as parameters are invalid or exceeds the range limit. |
Access Control / CORS
Metals.Dev supports Cross Origin Resource Sharing (CORS) & Access Control headers. This will enable you to use the Metals.Dev API from both front-end & backend environments.
Learn more about CORSAvailable Endpoints
Metals.Dev supports multiple API endpoints, each providing a different functionality. All endpoints are available on all the plans.
Latest Rates
Returns a live feed of exchange rate data for all available metals and currencies.
Spot Metal Rates
Returns a live feed of any one metal including the Spot, Bid, Ask, Low & High Prices. It will also return the Change & Change Percentage compared to previous market day.
Authority Metal Rates
Returns a live feed a metal prices published by leading authorities & exchanges like LBMA, LME, MCX, IBJA, etc.
Currency Rates
Returns a live feed a 170+ currency conversion rates.
Timeseries
Returns daily historical exchange ratess between two specified dates.
Usage
Returns the current usage, selected plan and the remaining quota left for the billing period.
Versioning
API versioning allows Metals.Dev to continuously evolve the services provided while offering a predictable path for improvements and deprecations.
All Metals.Dev API endpoints (except the usage endpoint) are versioned. Minor changes and improvements to Metals.Dev will be carried out without requiring any changes from your end. For breaking changes, a new endpoint version will be released.
When a new version is released, the older version will be marked as deprecated after 1 year and it will be discontinued after 4 years.
All Metals.Dev API endpoints (except the usage endpoint) are versioned. Minor changes and improvements to Metals.Dev will be carried out without requiring any changes from your end. For breaking changes, a new endpoint version will be released.
When a new version is released, the older version will be marked as deprecated after 1 year and it will be discontinued after 4 years.
Latest Endpoint
The latest endpoint will return a live feed of metal prices & currency conversion rates with a maximum delay of 60 seconds.
Spot Metal Endpoint
The spot metal endpoint returns a live feed of any one metal including the Spot Price, Bid, Ask, Low & High Prices with a maximum delay of 60 seconds. It will also return the Change & Change Percentage compared to previous market day.
The below metal codes are supported.
The below metal codes are supported.
gold
silver
platinum
palladium
aluminum
copper
nickel
lead
zinc
Currency Rates Endpoint
The currency rates endpoint returns a live feed of all the supported currencies with a maximum delay of 120 seconds. By providing a
View all the supported currencies.
from
parameter, this endpoint can be used to convert currency rates.View all the supported currencies.
Timeseries Endpoint
The timeseries endpoint returns daily historical exchange rates between two dates of your choice. The maximum allowed date limit is 30 days. If rates for more than 30 days are needed, a separate request must be sent.
Timeseries endpoint provides the metal rates in
Timeseries endpoint provides the metal rates in
USD / toz
.metal price api metals api metals.dev api gold price api silver price api platinum price api palladium price api live gold price live silver price live platinum price live gold price api live silver price api live platinum price api spot gold price api spot silver price api spot platinum price api precious metals api gold rate api silver rate api gold bid - ask price api silver bid - ask price api lbma gold price api london fix gold price api london gold am price london gold pm price mcx gold price api mcx silver price api mcx spot gold price mcx live gold price currency conversion rates currency conversion api usd to eur api currency api exchange rate api currency rates nodejs forex api metals data api api metals metalpriceapi