Retrieve live gold and silver buy and sell rates, including purchase GST amounts, with the Live Rates API.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Retrieve live buy and sell rates for gold and silver, along with the goods and services tax (GST) amounts for purchases.
Request
Send a POST request to /digitalgold/rates with your unique client_referenceId. Include your client-id and client-secret headers, and set Content-Type to application/json.
Request example
{
"client_referenceId": "{{Client Reference ID}}"
}Response
A successful response returns status: "SUCCESS" and a data object containing six rate and GST fields. The values below are sample values, not current market rates.
Response example
{
"status": "SUCCESS",
"statusCode": "200",
"message": "Rates retrieved successfully.",
"data": {
"gold_buy_rate": "8874.56",
"gold_sell_rate": "8580.40",
"silver_buy_rate": "99.58",
"silver_sell_rate": "96.15",
"gold_buy_gst": "266.24",
"silver_buy_gst": "2.99"
},
"acknowledged": "1"
}Rate and GST fields
All fields below belong to the data object and return numeric values as strings.
| Field | Type | Description |
|---|---|---|
gold_buy_rate | string | Gold buy rate. |
gold_sell_rate | string | Gold sell rate. |
silver_buy_rate | string | Silver buy rate. |
silver_sell_rate | string | Silver sell rate. |
gold_buy_gst | string | GST amount for gold purchases. |
silver_buy_gst | string | GST amount for silver purchases. |
Convert rate and GST strings to a numeric representation before using them in calculations. Use decimal-safe arithmetic to avoid floating-point rounding errors.