Free Gold Price API (REST, JSON, PHP)



Note: As of 27 August 2023, we've transitioned to HTTPS to bolster our security measures. Existing users may encounter issues when retrieving gold rates. Please ensure you replace 'http' with 'https' in your API calls to resolve any discrepancies.

Live Gold and Silver Price API - Free for Websites

Looking to showcase real-time gold and silver rates on your website or blog? We offer a reliable and free solution for your needs.

  • - Access our services without any charges.
  • - Send up to 30-60 API requests per hour, totaling 44640 requests per month.
  • - Stay tuned for future services, including rates for commodities like copper, oil, and various currencies.

If these offerings align with your requirements, you've come to the right place.

Why Choose Our API?

In today's digital landscape, finding a free and dependable gold API can be challenging. We pride ourselves on offering a high-availability service complemented by robust support. Here's what you can expect:

  • - Sample PHP source-code tailored for easy integration and customization (refer to section #4).
  • - Flexibility to use any programming language for fetching real-time gold and silver rates.
  • - Convert current gold rates across various karats, from 24k to 10k, with our comprehensive conversion guide available in the provided WinZip file.
  • - Seamlessly convert USD to your preferred currency.
  • - Retrieve spot gold and silver rates in global currencies, catering to regions such as the USA, UK, Australia, Canada, Europe, Middle East, Asia, and more.



This document has divided into the following sections

1. Registeration of the Gold API
2. Method of pulling the real time quotes
  Suggestion with PHP Source code
  2.1. Pulling the gold rates only
   2.1.1. Example, cURL command
   2.1.2. Output
   2.1.3. Description of the output

  2.2. Pulling both the gold and silver rates
   2.2.1. Example, cURL command
   2.2.2. Output
   2.2.3. Description of the output

3. Terms and conditions of using our API



Registeration of the Gold API

1. Create a new key by visting this link.
Register Gold Price Key
key generated successfully


2. Now, request for registration by sending that key, URL of your website and requirements to goldpricekg@gmail.com, then we will inform you about the registration.
Note: the Gold API is free but the registration is a mandatory requirement

You can check the verification status (or end-date of the trial period) by visiting this link
On that interface, you will know about the end-date of the trial period.
Remember! On continues violation, we will block the IP access. API key status


Method of pulling the real time quotes

Sample of PHP source code for pulling the gold rates [WinZip File]
As mentioned above that per hour more than 60 API requests are not allowed. Therefore, to avoid any inconvenience (e.g., blocking your access), we advise to follow these steps: How to use the Gold API
Using the Gold API, do not directly display the gold rates on your website, instead

  • I). Create a database table on your website with name "goldrate" (SQL Script in the above WinZip file)

  • II). Create a new page/program with name "pull_gold_rates.php" that will pull the gold price from our website using REST or JSON format, and it will insert into the mentioned table (e.g., "goldrate"). The complete source can be found in the above WinZip file

  • III). Create a cron job that run with 1 minute (or 2 minutes) interval. The command of the cronjob will be like the following
      wget -q -O - your_website/pull_gold_rates.php >/dev/null 2>&1

  • IV). Then display the gold rates from "goldrate" table on your website.

3. After registering a key, you can pull the live gold and silver rates using our REST API. For testing the key, you can use any tool or programming language. You can also use CURL, its syntax is following

A. Pulling the gold rates only

curl -X GET -H "X-API-KEY: f6412fdf260d55b6cb460cb4e5bad69cf6412fdf" https://goldpricez.com/api/rates/currency/usd/measure/all

You can change USD to currency of your choice e.g., SAR, AUD, GBP, EUR, CAD, INR, PKR, AED etc.

For example,
curl -X GET -H "X-API-KEY: f6412fdf260d55b6cb460cb4e5bad69cf6412fdf" https://goldpricez.com/api/rates/currency/sar/measure/all

Note: Goldpricez.com support almost all currencies of the world (mentioned at the home page).

You can change all to unit of your choice e.g., gram, kg, ounce, grain, baht, tola-india, tola-pakistan, masha etc.
For example,

curl -X GET -H "X-API-KEY: f6412fdf260d55b6cb460cb4e5bad69cf6412fdf" https://goldpricez.com/api/rates/currency/gbp/measure/gram

curl -X GET -H "X-API-KEY: f6412fdf260d55b6cb460cb4e5bad69cf6412fdf" https://goldpricez.com/api/rates/currency/usd/measure/ounce

Example, cURL command:
curl -X GET -H "X-API-KEY: f6412fdf260d55b6cb460cb4e5bad69cf6412fdf" https://goldpricez.com/api/rates/currency/gbp/measure/all



Output: "{\ "ounce_price_usd\ ":\ "1251.1\ ",\
"gmt_ounce_price_usd_updated\ ":\ "19-12-2018 01:16:01 pm\ ",\
"ounce_price_ask\ ":\ "1251.1\ ",\
"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} "


Description of the output

JSON Field Example Value Description
ounce_price_usd 1295.56 Ounce Rate in USD
gmt_ounce_price_usd_updated 18-08-2017 12:28:11 pm Gold Rate Updated according to GMT time
usd_to_gbp 0.776 USD to GBP
gmt_gbp_updated 17-08-2017 05:00:00 am GBP price updated according to GMT Time
ounce_in_gbp 1005.35456 Ounce Price in GBP
gram_to_ounce_formula 0.0321 1 Gram = 0.0321 Troy Ounce
gram_in_usd 41.587476 Gram Price in USD
gram_in_gbp 32.271881376 Gram Price in GBP
kg_to_ounce_formula 32.1507 1 KG = 32.1507 Troy Ounce
kg_in_usd 41653.160892 KG Price in USD
kg_in_gbp 32322.852852192 KG Price in GBP
grain_to_ounce_formula 0.002 1 Grain = 0.002 Troy Ounce
grain_in_usd 2.59112 Grain Price in USD
grain_in_gbp 2.01070912 Grain Price in GBP
tael-hongkong_to_ounce_formula 1.21528 1 Tael (of Hongkong) = 1.21528 Troy Ounce
tael-hongkong_in_usd 1574.4681568 Tael (of Hongkong) Price in USD
tael-hongkong_in_gbp 1221.7872896768 Tael (of Hongkong) Price in GBP
tael-japan_to_ounce_formula 1.2056 1 Tael (of Japan) = 1.2056 Troy Ounce
tael-japan_in_usd 1561.927136 Tael (of Japan) Price in USD
tael-japan_in_gbp 1212.055457536 Tael (of Japan) Price in GBP
tola-india_to_ounce_formula 0.375 1 Indian Tola = 0.375 Troy Ounce
tola-india_in_usd 485.835 Indian Tola Price in USD
tola-india_in_gbp 377.00796 Indian Tola Price in GBP
tola-pakistan_to_ounce_formula 0.40125 1 Pakistan Tola = 0.40125 Troy Ounce
tola-pakistan_in_usd 519.84345 Pakistan Tola Price in USD
tola-pakistan_in_gbp 403.3985172 Pakistan Tola Price in GBP
masha_to_ounce_formula 0.03119 1 Masha = 0.03119 Troy Ounce
masha_in_usd 40.4085164 Masha Price in USD
masha_in_gbp 31.3570087264 Masha Price in GBP
ratti_to_ounce_formula 0.00585 1 Ratti = 0.00585 Troy Ounce
ratti_in_usd 7.579026 Ratti Price in USD
ratti_in_gbp 5.881324176 Ratti Price in GBP




B. Pulling both the gold and silver rates

cURL command:
curl -X GET -H "X-API-KEY: f6412fdf260d55b6cb460cb4e5bad69cf6412fdf" https://goldpricez.com/api/rates/currency/gbp/measure/gram/metal/all

Output: "{\"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.9\",\"
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,\"
silver_ounce_in_gbp\":13.295267358,\"
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_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}"


Description of the output

You will see the output in the following format (note: the output will also include the gold price information as mentioned in the above table)

JSON Field Example Value Description
silver_ounce_price_usd 13 Silver, Ounce Rate in USD
silver_gram_price_usd 10 Silver, Gram Rate in USD
silver_gram_price_gbp 0.4 Silver, Gram Rate in GBP
silver_ounce_price_ask_gbp 9.9 Silver, Ounce Ask Price in GBP
silver_ounce_price_bid_gbp 10.1 Silver, Ounce Bid Price in GBP
silver_ounce_price_gbp_today_high 13 Today low price of silver per ounce in GBP
silver_ounce_price_gbp_today_low 7 Today high price of silver per ounce in GBP

Terms and Conditions of Using Our API

  • -Users are required to pull gold and silver rates in either JSON or REST format.
  • -Each IP address is restricted to a maximum of 60 API requests per hour. Exceeding this limit may result in temporary or permanent suspension of access.
  • -To register for API access, send an email to goldpricekg@gmail.com detailing your requirements. We will review your request and notify you of our decision, whether it's acceptance or rejection.
  • -The trial period for our API is 14 days. Extensions can be negotiated through email communication between both parties.
  • -Continuous violations of our terms will result in the blocking of API access for the offending IP address.
  • -By using our API, you agree to adhere to our general terms and conditions, privacy policy, and any other policies.
  • -GoldPriceZ.com reserves the right to modify, suspend, or discontinue the API service at any time without prior notice.
  • -Users are prohibited from using the API for any illegal or unauthorized purpose. Any misuse will result in immediate termination of access.
  • -GoldPriceZ.com is not responsible for any damages or losses incurred as a result of using our API. Users are advised to use the service at their own discretion and risk.

For queries, suggestions, improvements, or assistance, kindly email to: goldpricekg@gmail.com