How was this site built and where do they get the gold prices from?

May 19, 2025 3 answers
Asked by !CheckTheSpelling
I'm curious about the construction of this site: [goldpricecanada.ca](https://www.goldpricecanada.ca/). I'm interested in creating something similar and would like to know how they are getting the gold prices. Are they using an API? It's not clear if this site was built using WordPress, custom code, or another method. Any insights would be appreciated!

Answers

matte varnish
So, they're using a WebSocket that pushes updated prices every 5 seconds from the server. The server probably fetches that data from an unseen API. Even though theyโ€™re using socket.io for their updates, I wouldn't advise using websockets if you're starting freshโ€”it can be less efficient. If the data wonโ€™t be huge, polling might be a better option instead. Also, thereโ€™s been this websocket bug in Chrome that's worth knowing about if you go this route.

oven-mitt: Whatโ€™s this websocket bug you mentioned? Iโ€™ve been dabbling with websockets too. Would love to hear more!

Reply to this answer
~72dpi preview
It seems like they have their own API and possibly leverage an external paid API for getting gold prices. The styling looks like it's done with Tailwind CSS. My two cents? This website appears to be custom-coded because if it were built on WordPress, the design would probably look better.
Reply to this answer
pan+depth5cm
This site looks fully custom. If you check the network tab in your browser, you'll see WebSocket connections to a subdomain, which explains how they can update the prices in real-time without needing to refresh the page. Most likely, itโ€™s built with Node.js and Socket.io for handling those live updates. They probably fetch gold price data from a real-time API service. By the way, what kind of site are you planning to create? Are you also going for real-time financial data?
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions