Free Gold Price API (REST, JSON, PHP)
Important Notice — 27 August 2023:
Our API now runs exclusively over HTTPS for enhanced security.
If your integration still uses http://, update it to https:// to avoid connection issues.
Live Gold & Silver Price API — Free Tier for Websites
Add reliable, real-time gold and silver prices to your website, blog, or application. Our free tier is built for high availability and simple integration.
- Free access — no hidden charges.
- Rate limits: 30–60 requests/hour (≈ 44,640 per month, depending on plan/allocation).
- Roadmap: additional commodities (e.g., copper, oil) and broader currency coverage.
Why Choose Our API
Developer-friendly, HTTPS JSON endpoints with global coverage and a straightforward free tier.
- Free & transparent limits. Up to 30–60 requests per hour (≈ 44,640/month), clearly documented.
- Simple integration. Language-agnostic REST + JSON. Ready-to-use PHP and cURL samples (see Section 4).
- Global coverage. Gold and silver prices with multi-currency support and common units (gram, ounce, kg, tola, baht, masha, etc.).
- Karat conversions built in. 24k down to 10k with formulas/examples in the sample package.
- Caching-first pattern. Cron + DB examples to keep pages fast and stay within rate limits.
- Security baseline. HTTPS-only endpoints; keep keys server-side (never expose in client code).
- Clear activation flow. One proof email (key + site URL) records compliance; no auto-disables, fair grace periods.
Contents
1) API Registration
- Create your API key at goldpricez.com/key/registration.
- Activation: Please read the API Terms and complete the required steps. Then send one email to goldpricekg@gmail.com with your API key and website URL so we can record compliance. If you’ve completed this step, you may skip manual activation. Otherwise, activation may remain pending until we verify and update our records. For manual checks, see goldpricez.com/key/info.
2) How to Pull Real-Time Quotes
Download the sample PHP code: pull_gold_rates.zip (WinZip).
Authentication: send your key via header X-API-KEY: YOUR_API_KEY.
Responses are JSON. Use https:// endpoints only.
2.1) Pulling Gold Rates Only
curl -X GET \
-H "X-API-KEY: YOUR_API_KEY" \
https://goldpricez.com/api/rates/currency/usd/measure/all
Change the currency (e.g., SAR, AUD, GBP, EUR, CAD, INR, PKR, AED) and the unit (e.g., gram, kg, ounce, grain, baht, tola-india, tola-pakistan, masha, etc.).
Examples:
# Specific currency
curl -X GET -H "X-API-KEY: YOUR_API_KEY" \
https://goldpricez.com/api/rates/currency/gbp/measure/all
# Specific unit
curl -X GET -H "X-API-KEY: YOUR_API_KEY" \
https://goldpricez.com/api/rates/currency/gbp/measure/gram
curl -X GET -H "X-API-KEY: YOUR_API_KEY" \
https://goldpricez.com/api/rates/currency/usd/measure/ounce
2.2) Pulling Both Gold & Silver
curl -X GET \
-H "X-API-KEY: YOUR_API_KEY" \
https://goldpricez.com/api/rates/currency/gbp/measure/gram/metal/all
3) Best Practices (Cache + Cron)
To stay within rate limits and improve page speed, don’t call the API on every page view. Use a simple cache:
- Create a database table (e.g.,
goldrate). A sample SQL is included in the zip file. - Create a script (e.g.,
pull_gold_rates.php) to fetch from the API and upsert intogoldrate. - Run a cron job every 1–2 minutes:
wget -q -O - https://your-website/pull_gold_rates.php >/dev/null 2>&1 - Render prices to users from your database, not directly from the API.
Tip: Implement backoff on errors and respect 429 Too Many Requests responses.
4) Integration Examples (PHP + cURL)
4.1) Minimal PHP (cURL)
<?php
$endpoint = 'https://goldpricez.com/api/rates/currency/usd/measure/all';
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['X-API-KEY: ' . getenv('GOLDPRICEZ_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
]);
$raw = curl_exec($ch);
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($http === 200 && $raw) {
$data = json_decode($raw, true);
// TODO: persist $data to DB, then render from DB in your pages
echo number_format($data['ounce_in_gbp'] ?? 0, 2);
} else {
// TODO: log and fallback to last cached value
http_response_code(503);
echo 'Service temporarily unavailable';
}
More complete samples (including SQL and helper functions) are in pull_gold_rates.zip.
5) Response Format & Field Reference
5.1) Example (Gold, GBP, all measures)
{
"ounce_price_usd": "1251.10",
"gmt_ounce_price_usd_updated": "19-12-2018 01:16:01 pm",
"ounce_price_ask": "1251.10",
"ounce_price_bid": "1250.74",
"ounce_price_usd_today_low": "1248.41",
"ounce_price_usd_today_high": "1251.63",
"usd_to_gbp": "0.790239",
"gmt_gbp_updated": "19-12-2018 09:05:00 am",
"ounce_in_gbp": 988.6680129,
"gram_to_ounce_formula": 0.0321,
"gram_in_usd": 40.16031,
"gram_in_gbp": 31.73624321409,
"kg_to_ounce_formula": 32.1507,
"kg_in_usd": 40223.74077,
"kg_in_gbp": 31786.368682344,
"grain_to_ounce_formula": 0.002,
"grain_in_usd": 2.5022,
"grain_in_gbp": 1.9773360258,
"tael-hongkong_to_ounce_formula": 1.21528,
"tael-hongkong_in_usd": 1520.436808,
"tael-hongkong_in_gbp": 1201.5084627171,
"tael-japan_to_ounce_formula": 1.2056,
"tael-japan_in_usd": 1508.32616,
"tael-japan_in_gbp": 1191.9381563522,
"tola-india_to_ounce_formula": 0.375,
"tola-india_in_usd": 469.1625,
"tola-india_in_gbp": 370.7505048375,
"tola-pakistan_to_ounce_formula": 0.40125,
"tola-pakistan_in_usd": 502.003875,
"tola-pakistan_in_gbp": 396.70304017612,
"masha_to_ounce_formula": 0.03119,
"masha_in_usd": 39.021809,
"masha_in_gbp": 30.836555322351,
"ratti_to_ounce_formula": 0.00585,
"ratti_in_usd": 7.318935,
"ratti_in_gbp": 5.783707875465
}
5.2) Example (Gold + Silver, GBP, gram)
{
"ounce_price_usd": "1674.47",
"gmt_ounce_price_usd_updated": "08-03-2020 04:52:01 am",
"ounce_price_ask": "1674.47",
"ounce_price_bid": "1673.90",
"ounce_price_usd_today_low": "1642.13",
"ounce_price_usd_today_high": "1692.46",
"usd_to_gbp": "0.766342",
"gmt_gbp_updated": "08-03-2020 12:05:16 am",
"ounce_in_gbp": 1283.21668874,
"gram_to_ounce_formula": 0.0321,
"gram_in_usd": 53.750487,
"gram_in_gbp": 41.191255708554,
"silver_gram_in_usd": 0.5569029,
"silver_gram_in_gbp": 0.4267780821918,
"silver_ounce_in_gbp": 13.295267358,
"silver_ounce_price_ask_gbp": 13.314425908,
"silver_ounce_price_bid_gbp": 13.276108808,
"silver_ounce_price_gbp_today_low": 13.047738892,
"silver_ounce_price_gbp_today_high": 13.486086516
}
5.3) Field Descriptions (Gold)
| # | JSON Field | Example | Description |
| 1 | ounce_price_usd | 1295.56 | Spot ounce price in USD |
| 2 | gmt_ounce_price_usd_updated | 18-08-2017 12:28:11 pm | Timestamp of USD ounce update (GMT) |
| 3 | ounce_price_ask | 1295.56 | Ask price (USD) |
| 4 | ounce_price_bid | 1295.10 | Bid price (USD) |
| 5 | ounce_price_usd_today_low | 1288.41 | Day low (USD/oz) |
| 6 | ounce_price_usd_today_high | 1301.63 | Day high (USD/oz) |
| 7 | usd_to_gbp | 0.790239 | FX: USD→GBP |
| 8 | gmt_gbp_updated | 19-12-2018 09:05:00 am | Timestamp of GBP update (GMT) |
| 9 | ounce_in_gbp | 988.6680129 | Ounce price in GBP |
| 10 | gram_to_ounce_formula | 0.0321 | 1 gram = 0.0321 troy oz |
| 11 | gram_in_usd | 41.587476 | Gram price in USD |
| 12 | gram_in_gbp | 32.271881376 | Gram price in GBP |
| 13 | kg_to_ounce_formula | 32.1507 | 1 kg = 32.1507 troy oz |
| 14 | kg_in_usd | 41653.160892 | Kilogram price in USD |
| 15 | kg_in_gbp | 32322.852852192 | Kilogram price in GBP |
| 16 | grain_to_ounce_formula | 0.002 | 1 grain = 0.002 troy oz |
| 17 | grain_in_usd | 2.59112 | Grain price in USD |
| 18 | grain_in_gbp | 2.01070912 | Grain price in GBP |
| 19 | tael-hongkong_to_ounce_formula | 1.21528 | 1 HK tael = 1.21528 troy oz |
| 20 | tael-hongkong_in_usd | 1574.4681568 | HK tael price in USD |
| 21 | tael-hongkong_in_gbp | 1221.7872896768 | HK tael price in GBP |
| 22 | tael-japan_to_ounce_formula | 1.2056 | 1 JP tael = 1.2056 troy oz |
| 23 | tael-japan_in_usd | 1561.927136 | JP tael price in USD |
| 24 | tael-japan_in_gbp | 1212.055457536 | JP tael price in GBP |
| 25 | tola-india_to_ounce_formula | 0.375 | 1 Indian tola = 0.375 troy oz |
| 26 | tola-india_in_usd | 485.835 | Indian tola price in USD |
| 27 | tola-india_in_gbp | 377.00796 | Indian tola price in GBP |
| 28 | tola-pakistan_to_ounce_formula | 0.40125 | 1 Pakistan tola = 0.40125 troy oz |
| 29 | tola-pakistan_in_usd | 519.84345 | Pakistan tola price in USD |
| 30 | tola-pakistan_in_gbp | 403.3985172 | Pakistan tola price in GBP |
| 31 | masha_to_ounce_formula | 0.03119 | 1 masha = 0.03119 troy oz |
| 32 | masha_in_usd | 40.4085164 | Masha price in USD |
| 33 | masha_in_gbp | 31.3570087264 | Masha price in GBP |
| 34 | ratti_to_ounce_formula | 0.00585 | 1 ratti = 0.00585 troy oz |
| 35 | ratti_in_usd | 7.579026 | Ratti price in USD |
| 36 | ratti_in_gbp | 5.881324176 | Ratti price in GBP |
5.4) Additional Silver Fields (when metal=all)
- silver_ounce_price_usd — Silver ounce in USD
- silver_gram_in_usd, silver_gram_in_gbp — Silver gram price
- silver_ounce_in_gbp — Silver ounce in GBP
- silver_ounce_price_ask_gbp, silver_ounce_price_bid_gbp
- silver_ounce_price_gbp_today_low / _high
6) Rate Limits & Error Handling
- Free tier: 30–60 requests/hour (plan-dependent). Do not exceed limits.
- On sustained violations, IP access may be blocked.
- Recommended polling interval: 60–120 seconds via cron + DB cache.
Status Codes
- 200 OK — Successful response
- 400 Bad Request — Invalid parameters
- 401 Unauthorized — Missing/invalid
X-API-KEY - 403 Forbidden — Key not active or blocked
- 404 Not Found — Resource or path invalid
- 429 Too Many Requests — Slow down; implement backoff
- 5xx Server errors — Retry with exponential backoff
Error Payload (example)
{
"error": true,
"code": 429,
"message": "Too Many Requests. Please reduce frequency."
}
7) Security & Compliance
- Use HTTPS only. Never expose your key in client-side code.
- Keep keys in server env variables; rotate if compromised.
- Cache results; avoid exposing raw endpoints directly to browsers.
8) Support & Key Status
- Email: goldpricekg@gmail.com
- Key status & trial end-date: goldpricez.com/key/info
Version: Nov 15, 2025 • Effective: Dec 06, 2025
We may update these Terms from time to time. For material changes, we’ll make reasonable efforts to provide notice (on this page, the API docs, the key status page, and/or by email to registered users). Your continued use of the API on or after the Effective Date constitutes acceptance of the updated Terms.
9) API Terms & Conditions
- Free Access. Our API is provided free of charge for use on websites only.
- Data Nature. API data is for informational purposes only and does not constitute financial advice. See our Disclaimer.
- Future Plans. We have not charged fees to date. We may introduce additional plans or features (including paid tiers) in the future; updates will appear on this page.
- Attribution (Free Tier).
If you publicly display API data, include a visible attribution to our site as source credit. Example:
<a href="https://goldpricez.com" target="_blank" rel="noopener">GoldPriceZ.com</a>- Acceptable locations: footer, “About,” “Data Sources,” or other publicly visible, relevant pages.
- Exactly one attribution per website (domain) is sufficient; site-wide links are not required.
- The link must be visible to users and not hidden, cloaked, or placed on doorway/empty pages.
- Anchor text should be brand-oriented (e.g., “GoldPriceZ.com” or “Gold Price API by GoldPriceZ”). Avoid keyword-stuffing.
- Rel attributes:
rel="nofollow",rel="sponsored", orrel="ugc"are acceptable. We do not require followed links. - Indexability by search engines is not required; the page must be publicly reachable by users.
- We may request reasonable adjustments to placement/format to ensure clear attribution and avoid user confusion.
- Registration & Records.
After adding attribution, email us once at goldpricekg@gmail.com with:
- Your API key
- The URL where attribution appears
- Restrictions. You may not:
- Resell, sublicense, or redistribute raw API data to third parties;
- Remove, hide, misrepresent, or alter required attribution;
- Use the API for unlawful, abusive, or disruptive purposes, or on illegal content;
- Expose API keys in client-side code or perform abusive scraping.
- Rate Limits. Unless otherwise agreed, each IP or API key is limited to up to 60 requests per hour (or 30–60/hour depending on allocation), measured over a rolling window. We may throttle or temporarily suspend access if limits are exceeded or abuse is detected.
- Security. Use HTTPS. Keep API keys confidential and server-side (do not embed in client-side code). Rotate keys if you suspect compromise.
- Enforcement & Grace Periods. We do not automatically disable keys. If attribution is missing, we will send a reminder and provide a reasonable grace period (e.g., 7–14 days). If unresolved, API access may be temporarily blocked until fixed. Access may be revoked immediately for abuse, misuse, or security reasons.
- Changes & Termination. We may modify, suspend, or discontinue the API at any time, with or without notice. For material changes, we will make reasonable efforts to post notice on this page. Your continued use after changes constitutes acceptance.
- Liability. The API is provided “as is,” without warranties. We accept no liability for losses or damages arising from its use. See our Disclaimer.
- Governing Terms. By using the API, you also agree to our Website Terms of Service, Privacy Policy, and Disclaimer.
- Amendments. Changes take effect upon posting on this page and apply to new and existing users.
- Service Scope. The API service and requirements apply equally to all free-tier users. If we introduce paid tiers or additional services, details will be published here. Email or informal correspondence does not override these Terms.
- Contact. goldpricekg@gmail.com
Last updated: 15 November 2025
Silver Purity/types:
Unlike gold, silver is typically not classified by karats. Instead, silver purity is usually expressed as a percentage or parts per thousand. The most common purities are:
- Fine Silver (99.9%): Used in investment-grade bullion, coins, and bars.
- Sterling Silver (92.5%): Common in jewelry, silverware, and decorative items.
- Coin Silver (90%): Previously used in coins, now less common.
- Other Alloys: Lower purity silver used in budget or industrial applications.
Silver purity is often marked with stamps like "999," "925," or "900" to indicate the purity level.
- About Silver Types (in Detail),- Methodologies, and References
Description of Weight Units:
| Weight Unit | Equivalent in Grams |
|---|---|
| Troy Ounce | 31.1035 |
| Kilogram | 1000 |
| Baht | 15.244 |
| Tola | 11.664 |
| Vori (Bori) | 11.664 |
| Pennyweight | 1.555 |
| Pound | 453.592 |
| Grain | 0.065 |
| Ratti | 0.121 |
| Carat | 0.2 |
| Masha | 3.885 |
| Tael (Hong Kong) | 37.429 |
Description for currency:
Select your preferred currency to view silver prices. Prices are available in major global currencies like USD, EUR, GBP, and more. Choosing the correct currency ensures you see accurate and up-to-date pricing based on the exchange rate for your location or preference.
Live Silver Price Chart:
Use the duration options to view silver price trends over different time periods. 'Today' shows the current day's price movements, while '7 Days,' 'Month,' and '30 Days' provide recent trends. 'YTD' (Year-to-Date) and '1 Year' offer a longer-term view. Select 'More' for additional timeframes and detailed analysis.
This performance section provides an overview of silver price trends. The Summary tab offers an at-a-glance view with color-coded trend indicators showing percentage changes across key time horizons.
The Amount tab displays absolute value changes in both USD (global benchmark) and local currency, along with exchange rate movements, enabling precise profit/loss calculations.
The Percent tab reveals relative growth rates, essential for comparing silver's performance against other assets and inflation.
The History tab provides anchor price points on specific dates, supporting technical analysis and investment strategy backtesting.
Together, these tabs offer investors, jewelers, and economists multidimensional insights into silver's behavior across timeframes and currency perspectives.
Live Silver Price Calculator:
This tool estimates silver values using live market rates. Enter your silver weight, select a measurement unit (grams, tolas, ounces, etc.), and choose any currency. Click "Calculate" for instant valuation based on current prices. You can also switch tabs to value gold or convert currencies. All calculations reflect real-time market data for accurate precious metal valuation.
About this timestamp
The time shown here indicates when the price data was last fetched from our server. It is not the exact moment of a retail sale or trade, and may differ slightly from jewellery shops or live trading platforms because of data provider timing and currency conversion.
For transparency, full details of how prices are calculated and updated are available in the Reference section. There you can see the data sources, update frequency, and notes on what is included or excluded.
Silver Price Comparison by Purity:
This tool compares live silver prices across different purity levels and weight units. Switch between tabs to see values per ounce, gram, tola, or select "More" for units like baht, tael, etc. Each table shows today's current, lowest, and highest prices for every purity type in your chosen currency. Use the dropdown filters to focus on specific purities, switch weight measurements, or convert values to any global currency.
Silver Market Price Tool
This section shows live silver pricing with bid/ask spreads and customization options. View real-time market rates for different purity levels using the top tabs. The table displays three key prices per gram:
1. Current Price: Latest market rate
2. Bid Price: What buyers offer
3. Ask Price: What sellers request
Adjust the spread percentage to see how dealer margins affect prices, or add labor costs for jewelry valuation. Use the dropdowns to switch between purity levels, weight units, or currencies for international comparisons.
Silver Quantity Calculator Guide
This tool calculates silver prices for specific quantities in Pakistani Rupees. Select a weight unit (grams, tolas, ounces) using the tabs, or choose other units like "baht", "tael", etc. from the "More" dropdown. The table instantly shows spot, buy, and sell prices for common quantities (1, 5, 10 units) and allows custom quantity entry.
Key features:
1. Custom Quantity: Enter any amount for instant valuation
2. Spread Adjustment: Modify dealer margin spreads
3. Labor Costs: Add manufacturing fees for jewelry valuation
4. Live Rates: All prices update in real-time based on market data
Use the dropdowns to change silver purity, weight units, or convert prices to other currencies.
Silver Price History
This section tracks silver's value over time. The table shows daily prices with percentage changes, highlighting market activity and closures.
Reference Information
The following information is about the primary data used in the above sections for transparency and trustworthiness. This section details the weight unit, purity, and currency. It also provides update times and data sources to ensure all information is fresh and accurate for decision-making.