Bid And Ask Endpoint
Depending on your subscription plan, the API's Bid and Askendpoint is a powerful API feature that enables you to retrieve real-time Bid and Ask
prices for a selection of precious metals, including Gold, Silver, Palladium, and Platinum.
To obtain the symbols required for the endpoint, you can refer to the symbols list provided at Symbols List.
API Request:
https://metals-api.com/api/latest ? access_key = API_KEY & base = USD & symbols = XAU-BID,XAU-ASK
Request Parameters:
Parameter | Description |
---|---|
access_key |
[required] Your API Key. |
base |
[optional] Enter the three-letter currency code or metal code of your preferred base currency. Default USD. |
symbols |
[required] Enter a list of comma-separated currency codes or metal codes to limit output currencies. (The number of symbols per API request depends on the acquired plan). |
API Response:
{ "success": true, "date": "2013-12-24", "timestamp": 1387929599, "base": "USD", "rates": { "USD": 1, "XAU-ASK": 0.00050474459, "XAU-BID": 0.00050499949, "USDXAU-ASK": 1981.19999999, "USDXAU-BID": 1980.19999999 } }
Response Objects:
Response Object | Description |
---|---|
success |
Returns true or false depending on whether or not your API request has succeeded. |
timestamp |
Returns the exact date and time (UNIX time stamp) the given rates were collected. |
date |
Returns the exact date when the given rates were collected. |
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:
https://metals-api.com/api/latest?access_key=YOUR_API_KEY&base=USD&symbols=XAU-BID
Example request in Postman with multiple symbols (The number of symbols per API request depends on the acquired plan):