← Back to API Ninjas
Get the current gold spot price
Returns the gold spot price (XAU/USD) with bid and ask, blended from multiple live market quotes and refreshed about once a minute on this listing.
API Ninjas·$0.001 per call
Example code
// Using @orth/sdk - The simplest way to call APIs
// Install: npm install @orth/sdk
import Orthogonal from "@orth/sdk";
const orthogonal = new Orthogonal({
apiKey: process.env.ORTHOGONAL_API_KEY,
});
const output = await orthogonal.run({
api: "api-ninjas",
path: "/v1/goldspot"
});
console.log(output);Query parameters
currency
string
ISO 4217 currency code to convert the price into (e.g., EUR, GBP, INR). Defaults to USD.
unit
string
Target unit to convert the price into. Defaults to troy_ounce. (Allowed: troy_ounce, g, kg, oz, lb, metric_ton, short_ton, hundredweight) (Default: troy_ounce)