Investing

How to Retrieve Historical Gold (XAUUSD) Prices With an API

How to Get Historical XAUUSD Gold Prices With an API

A live gold quote gives a recent price per troy ounce. Studying how gold moved through a past week requires a dated series. A historical-data API can provide that series for a chart or spreadsheet.

This walkthrough builds a daily gold-price series in USD using SiftingIO's documented historical commodities endpoint.

It draws on the provider's reference pages as read on October 26, 2026, rather than independent testing.

The example request was adapted from the documentation and wasn't executed.

Key Takeaways

  • Choose the correct price series. Spot or reference gold, the LBMA auction benchmark, gold futures, and a fund's share price measure different things.

  • Request dated bars rather than a live quote. Historical bars give open, high, low, and close values for each interval.

  • Inspect timestamps and field meanings. Check the bar time, the volume-like field, and any gaps before analyzing the data.

Choose a Gold Price Series That Fits Your Research

SiftingIO defines XAUUSD as the price of one troy ounce of gold expressed in US dollars. Other published gold prices can share that unit while measuring different things.

Match the series to your question. SiftingIO's XAUUSD series provides aggregated reference prices from multiple sources.

The LBMA Gold Price is an auction benchmark set twice daily, at 10:30 and 15:00 London UK time, in USD per troy ounce. It isn't a continuous feed and isn't published on weekends or UK bank holidays.

Gold futures have contract-specific terms. CME's 1-Ounce Gold futures contract, for example, is cash settled to the exchange's 100 troy ounce Gold futures contract. A gold fund's share price also reflects the fund's structure and costs.

These series shouldn't be substituted for one another without explanation.

For readers who want gold history alongside other markets, SiftingIO offers REST retrieval for data requests and WebSocket access for streaming updates.

Its symbol page states that every plan includes the full available gold history.

That wording doesn't establish the same earliest date for every symbol, so check the available XAUUSD dates against your research needs.

Check the plan. The published Commodities free tier provides a way to evaluate the data before paying. It lists 10,000 REST calls per month, a 60-requests-per-minute rate limit, one WebSocket connection, and five symbol subscriptions.

A September 29, 2026 release note expanded free-tier access to full available historical depth while leaving monthly call allowances and rate limits unchanged.

As of October 26, 2026, the Commodities product page lists monthly-billed starting prices of $99 for Builder and $299 for Pro. Pro's commercial use and customer-facing display rights remain subject to plan terms.

Retrieve Historical XAUUSD Prices Step by Step

The documented route is GET /v1/hist/commodities/:symbol/bars. It returns OHLCV bars, split into pages, at intervals from one minute through monthly.

OHLCV stands for open, high, low, close, and volume, though the volume field here counts price updates. The steps below use daily bars for a week in September 2026.

1. Create an account and obtain commodities access. Confirm that commodities are enabled for your API key, and keep the key private.

2. Store the key as an environment variable. Export it as SIFTING_API_KEY in your shell rather than pasting it into a script or shared spreadsheet. The request below references that variable instead of exposing the credential.

3. Select the symbol, date range, and interval. Use XAUUSD as the symbol, choose start and end dates in UTC, and set the interval to 1d for daily bars. The documented date bounds are inclusive, and a date-only input represents midnight UTC. An end date of 2026-09-07 therefore refers to the start of that day, rather than its end.

4. Submit the request. The example below requests daily bars within those bounds.

curl --compressed \

-H "X-API-Key: $SIFTING_API_KEY" \

-H "Accept-Encoding: gzip" \

"https://api.sifting.io/v1/hist/commodities/XAUUSD/bars?start=2026-09-01&end=2026-09-07&interval=1d&limit=2000"

The limit parameter sets the page size. It defaults to 1,000 bars and permits a maximum of 2,000, so a week of daily bars fits on a single page. The gzip header is required on this endpoint; requests without it return a 406 error.

5. Inspect and save the returned data. Each bar carries six fields. The t value is the bar's opening time in Unix milliseconds, distinct from the time the response was generated. The o, h, l, and c values are the open, high, low, and close prices in USD per troy ounce.

The v value counts price updates within the bar, not ounces traded on an exchange. Convert t to a readable date, then write the rows to CSV.

Laptop displaying a financial trading chart with candlestick price movements and technical pattern indicators.

If the response supplies a continuation value in meta.next_cursor, more bars remain. Pass that value back through the documented cursor flow and continue until no further page is indicated.

A no-code alternative. Sifting IO also offers a browser-based CSV and Excel exporter. Its account-free preview covers completed bars from the latest 24 hours; older history requires an API key. For scripted work, official Python, JavaScript, and Go SDK guides are available.

Validate the Gold History Before Using It

Check the series definition, timestamps, comparison data, and source record before calculating returns or drawing conclusions.

Verify units and series identity. Confirm that the figures are USD per troy ounce and that the symbol represents the spot or reference series you intended to retrieve.

SiftingIO documents its output as aggregated, derived, and calculated data from multiple third-party sources. That definition helps you assess its fit for research: the values may differ from a broker or venue and aren't official exchange-of-record prices.

Inspect timestamps and missing observations. Because v counts price updates, a low value means fewer recorded updates within that bar. It doesn't establish how much gold traded or how liquid the market was.

Check apparent gaps against the source's publication calendar. For example, the LBMA benchmark has no weekend or UK bank holiday observations.

Don't replace a missing price with zero or assume that every symbol reaches back equally far. Test the date range you need.

A sharp move in a single daily bar isn’t automatically an error either, since shifts in trade and geopolitical sentiment can move XAUUSD noticeably within one session, so check the date against market news before treating it as bad data.

Gold bar beside a printed financial chart showing a strong upward price trend over time.

Compare matching dates and price definitions. Align timestamps and definitions before comparing your series with a published benchmark. The World Gold Council reported an average LBMA PM price of US$4,506.29 per ounce for Q2 2026.

That figure is a quarterly average of an auction benchmark, so comparing it directly with one daily close from a reference feed would be misleading.

It is also a historical observation, not a current quote. Reference values don't establish the price at which a broker would fill an order.

Record the source and retrieval date. Save the provider, symbol, endpoint, interval, requested date bounds, and retrieval date alongside the CSV.

Keep the series definition with that record so a later reader can distinguish reference prices from auction benchmarks or futures prices.

FINRA cautions that back-testing cannot predict future performance or perfectly reproduce past results, and advises skepticism toward extraordinary past-performance claims. A spreadsheet showing gold rising over a selected period doesn't establish that a strategy will be profitable.

About The Author

About Investors Hangout

Investors Hangout is a leading online stock forum for financial discussion and learning, offering a wide range of free tools and resources. It draws in traders of all levels, who exchange market knowledge, investigate trading tactics, and keep an eye on industry developments in real time. Featuring financial articles, stock message boards, quotes, charts, company profiles, and live news updates. Through cooperative learning and a wealth of informational resources, it helps users from novices creating their first portfolios to experts honing their techniques. Join Investors Hangout today: https://investorshangout.com/

Top 10 Most Recent News Articles

JumpCloud Tackles Compliance in the AI Era

Updated Category News Views 0

Compliance in a Changing Tech Landscape JumpCloud's stepping up in this brave new world riddled with tech and AI agents. They've got fresh platform features in their arsenal that'll keep organizations audit-ready day in and day out. Now, if you think compliance is just for the accountants to fret over, think again. In the agentic era, these advanced marvels—AI agents...

Continue Reading
Doximity Lawsuit: What Investors Need to Know Now

Updated Category News Views 96

Lawsuit Clouds Hang Over Doximity The courtroom isn't typically where you find stocks making headlines, but Doximity's recent plunge isn't just a market hiccup. After a rough patch, an alleged misstep lands them squarely under the legal microscope, and investors have questions. Tracing Doximity's Rocky Financial Reports First, let's rewind to November last year. Doximity...

Continue Reading
Clip Expands Horizons with Pulpos Acquisition, New Board Member

Updated Category News Views 70

Clip's Strategic Move with Pulpos Clip just laid down a serious marker in the digital payment world by snagging Pulpos, a firm that’s got its claws deep into AI-driven business management software. This move isn't just some fancy headline. It's a real, grounded step in expanding Clip's ecosystem to bolster the backbone of Mexico's economy: small and medium-sized...

Continue Reading
Grupo Simec 2026 Nine-Month Financial Surge Spells Change

Updated Category News Views 0

Sharp Climb in Net Income Sparks Interest Buckle up, folks. Grupo Simec's nine-month results for 2026 are a mixed bag of surprises and steady flows. Let’s break it down: the net income skyrocketed by a whopping 428% compared to the same period last year—jumping from Ps. 763 million to Ps. 4,028 million. That's a solid leap, and it’s largely due to turning a hefty...

Continue Reading
Aktia Bank: Steady Ratings, Focused Expansion in Europe

Updated Category News Views 11

Aktia's Ratings Get a Boost In the world of financial minutiae, it was S&P Global Ratings that took the stage, buzzing about Aktia Bank Plc. The bank just had its ratings held steady with an outlook lift from negative to stable. That's like someone throwing you a life jacket when you're treading water; significant if you're trying to stay afloat, not so much if you've got...

Continue Reading
Covalent's Bet on AML Analytics: A Defense Revolution

Updated Category News Views 106

The Big Play: AI Meets Financial Defense You know when a private equity firm swoops in, it's like the cavalry arriving. Covalent Equity Partners just did that for AML Analytics, or AMLA for short. A payday for them, sure, but it's more about amplifying AMLA's already hefty punch against financial crime, using AI to boot. Now, if AI's mentioned, you know someone's getting...

Continue Reading
Ping An Shows Resilient Growth Amid Economic Pressure

Updated Category News Views 65

Unpacking Ping An's Steady Climb Amid Tumult A few eyebrows might have raised when Ping An Insurance unveiled its nine-month report for 2026. Despite economic turbulence in China—courtesy of a gnarly global scene—the numbers were anything but rattled. Operating profit rose 8.3% year over year to a beefy RMB125,905 million. The equity pool swelled by 4.4% as of...

Continue Reading
A.O. Smith Sells 81% of China Arm to CPE: Key Takeaways

Updated Category News Views 116

When a major player like A.O. Smith decides to offload a piece of its business, folks tend to sit up and pay attention. This isn't just some run-of-the-mill shuffling. A.O. Smith has inked a deal with CPE to hand over an 81% stake in its China business. What does this transaction bring to the table and who stands to gain? Broken Down for the Curious Investor The numbers...

Continue Reading
Chemours Faces Class Action over Misleading Guidance

Updated Category News Views 84

Legal Storm Brewing for Chemours Investors Seems like The Chemours Company, trading under NYSE:CC, is in some legal hot water right now. With the calendar quickly flipping towards December 7, investors are fronted with a crucial choice: step up to stake their claim as lead plaintiff in a securities fraud class action lawsuit, or watch from the sidelines. The Allegations...

Continue Reading
North Island Credit Union Eases Student Access to Banking

Updated Category News Views 66

Breaking Down Barriers with Student Banking Services Stumble into any financial setup these days, and you'll hear the same refrain: young people need more access to banking. North Island Credit Union seems to have taken that idea to heart, landing a national Bank On certification for their Student Checking account. It ain't just any badge; it's the mark of reliability,...

Continue Reading

Top 5 Most Recently Viewed Articles

The Future of Soybeans: Market Growth and Opportunities Ahead

Updated Category News Views 162

Understanding the Soybean Market Growth The global soybean market has shown significant potential, currently valued at USD 199.66 billion, with projections suggesting an increase to USD 310.07 billion by 2034. The growth trajectory is largely driven by increasing veganism, a rise in plant-based diets, and the demand for more sustainable food options. This market evolution...

Continue Reading
Innovations in Smart Mobility Take Center Stage at Major Expo

Updated Category News Views 372

Innovations in Smart Mobility at the Canton Fair The 136th Canton Fair has brought significant advancements in green, low-carbon smart mobility products to light. This year's exhibition includes a newly upgraded New Energy Resources section, which integrates a hydrogen energy theme for the first time, capturing the interest of eco-conscious buyers and innovators. Hydrogen...

Continue Reading
Exploring the Booming Photovoltaics Market of Tomorrow

Updated Category News Views 146

The Future of the Photovoltaics Market The photovoltaics market is on the verge of significant expansion, with projections indicating that it will reach a remarkable USD 968.32 billion by 2030. This growth is a considerable leap from USD 613.57 billion in 2025, marking a compound annual growth rate (CAGR) of 9.6% during this period. One of the essential motivators behind...

Continue Reading
Porsche Unveils Special 911 GT3 Livery for ANDIAL's Milestone

Updated Category News Views 302

Celebrating ANDIAL's Legacy with the 911 GT3 Porsche is thrilled to announce a special design wrap for the iconic 911 GT3 in honor of the 50th anniversary of ANDIAL, an esteemed name in the world of motorsports and automotive tuning. This unique offering pays homage to the remarkable history and performance attributes associated with this legendary brand. A Nod to the...

Continue Reading