NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server →

Metals Price API

The Metals Price API returns live spot prices for gold (XAU), silver (XAG), platinum (XPT), and palladium (XPD), plus copper and aluminum, with the matching futures price and contract in the same response. Prices can be returned per troy ounce, gram, kilogram, or pound, in any major currency.

Available endpoints:

Spot vs. futures. The spot price is what a metal costs for immediate delivery; futures are agreed today for delivery on a later date and usually trade a little above spot. Gold, silver, platinum, and palladium spot prices are blended from multiple independent live market quotes and cross-checked against futures. Copper and aluminum have no public live spot market, so their spot price is the most actively traded COMEX futures contract, as on most price sites; spot_type tells you which method was used.

For gold alone, see the Gold Price API; for energy, grains, and 25+ other commodities, see the Commodity Price API.

Supported metals (sample prices):

MetalParameterSample spot priceSpot method
Goldgold$4,140.25/oz tLive spot
Silversilver$60.92/oz tLive spot
Platinumplatinum$1,723.64/oz tLive spot
Palladiumpalladium$1,177.28/oz tLive spot
Coppercopper$6.65/lbFutures-based
Aluminumaluminum$3,251.00/tFutures-based
Online
(4.3)

From 2,715 users

2,800+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
247ms266ms293ms532ms1079ms

Didn't find what you were looking for? Suggest an improvement

https://api.api-ninjas.com/v1/metalsprice

Returns the current spot price of a metal, with its futures price and contract. Free accounts receive the last daily closing price for every metal; premium members get live prices. Developer plans get a spot price refreshed every minute, and Business plans and above get the live spot price, updated about every 10 seconds.

Parameters

  • metal optional

    The metal to return: gold (default), silver, platinum, palladium, copper, or aluminum. Currency codes xau, xag, xpt, and xpd are also accepted.

  • currency optional

    ISO 4217 currency code to convert prices into (e.g. EUR, GBP, INR). Defaults to USD.

  • unit optional

    Target weight unit: troy_ounce, g, kg, oz, lb, metric_ton, short_ton, or hundredweight. Defaults to the metal's native unit (troy ounce for precious metals, pound for copper, metric ton for aluminum).

  • metals optional Business tier and above, or any annual plan

    Comma-separated list of metals for a batch request (e.g. gold,silver,platinum). Returns an array.

Headers

  • X-Api-Key required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • metal

    The requested metal (e.g. gold).

  • name

    The display name of the metal.

  • price

    The spot price: live on premium plans, the last daily close on the free plan.

  • bid Premium only

    The spot bid price. Gold, silver, platinum, and palladium only.

  • ask Premium only

    The spot ask price. Gold, silver, platinum, and palladium only.

  • spot_type

    How the spot price is produced: composite (blended live market quotes, for precious metals) or futures_based (the most actively traded futures contract, for copper and aluminum).

  • previous_close

    The previous session's closing spot price.

  • change_24h

    The change versus the previous close.

  • change_24h_percent

    The percent change versus the previous close.

  • high_24h

    The session's high price.

  • low_24h

    The session's low price.

  • futures_price

    The price of the futures contract below.

  • futures_contract

    The futures contract symbol (e.g. GCZ26 is the December 2026 gold contract).

  • futures_contract_month

    The contract's delivery month (YYYY-MM).

  • futures_exchange

    The exchange the contract trades on (COMEX or NYMEX).

  • unit

    The weight unit prices are quoted in.

  • currency_unit

    The price currency (USD by default).

  • market_status

    open or closed. Metals trade from Sunday 6 PM to Friday 5 PM ET, with a daily break from 5 to 6 PM ET.

  • updated

    The Unix timestamp (in seconds) of the spot price.

Live Demo

Live demo · no API key required
Query parameters
metal

Get a free API key to get started — no credit card required.

Headers
X-Api-KeyLog in or sign up to get your API key
GET
https://api.api-ninjas.com/v1/metalsprice?metal=gold
Sample response
{
"metal": "gold",
"name": "Gold",
"price": 4140.25,
"bid": 4140,
"ask": 4140.5,
"spot_type": "composite",
"previous_close": 4118.23,
"change_24h": 22.02,
"change_24h_percent": 0.5347,
"high_24h": 4146.8,
"low_24h": 4121.15,
"updated": 1791263228,
"futures_price": 4174.6,
"futures_contract": "GCZ26",
"futures_contract_month": "2026-12",
"futures_exchange": "COMEX",
"unit": "troy_ounce",
"currency_unit": "USD",
"market_status": "open"
}

Code Examples

curl -X GET "https://api.api-ninjas.com/v1/metalsprice?metal=gold" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Metals Price API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • The Metals Price API returns spot and futures prices for gold (metal=gold or xau), silver (xag), platinum (xpt), palladium (xpd), copper, and aluminum. For energy, grains, and other commodities, see the Commodity Price API.
  • Yes. Create a free account for an instant API key. The free tier returns the last daily closing spot price and futures settlement for every metal, including currency and unit conversion (for example, gold per gram in EUR). Premium plans unlock live prices with bid and ask: the spot price refreshes every minute on Developer plans and about every 10 seconds on Business plans and above, which also unlock the metals batch parameter.
  • For gold, silver, platinum, and palladium, the spot price (spot_type composite) is blended from multiple independent live market quotes and cross-checked against futures prices; outlying quotes are discarded. Copper and aluminum have no public live spot market, so their spot price (spot_type futures_based) is the most actively traded COMEX futures contract, the convention used by most price sites. Every response also returns the futures price, contract symbol, and delivery month, so you can see both.
  • Add the unit parameter (g, kg, troy_ounce, oz, lb, metric_ton) and the currency parameter (an ISO 4217 code like EUR, GBP, or INR), for example /v1/metalsprice?metal=gold&unit=g&currency=EUR. Spot, bid, ask, and futures prices all convert together.
  • Metals trade nearly 24 hours a day, from Sunday 6 PM to Friday 5 PM US Eastern time, with a daily break from 5 to 6 PM. The market_status field reports open or closed; while the market is closed, the API returns the last traded price, and updated shows when it was set.