sifting/io
Forex & Crypto
5 min readSiftingIO Team

How to get real-time forex prices from SiftingIO

A plain guide to getting live forex prices from SiftingIO: a single request for the current rate, or a live feed that updates on its own as the market moves.

How to get real-time forex prices from SiftingIO

What real-time forex data means#

Real-time forex data is the current price of a currency pair, updated the moment it changes. For a pair like EURUSD, that price has two sides: the bid, which is what buyers are offering, and the ask, which is what sellers are asking. The gap between them is the spread, and the middle point of the two is the mid price that most charts display. A real-time feed keeps all of those numbers current as the market moves, second by second.

SiftingIO gives you that data without any special setup. You send your API key, you name the pair you want, and a price comes back. The forex product page covers which pairs are available, from the common ones down to the less traded crosses.

There are two ways to read it, and the right choice depends on how often you need a fresh number.

The quick way: ask for the current price#

If you only need the latest price now and then, one request is enough. This returns the current bid, ask, mid, and spread for a pair:

curl -H "X-API-Key: $SIFTING_KEY" \
     "https://api.sifting.io/v1/last/quote/forex/EURUSD"

The pair is written as EURUSD, six letters with no slash and no space. The response already includes the spread and the mid price, so you do not have to work them out yourself. This is the simplest option for a page that shows a rate and refreshes it every few seconds, or a small script that checks a price on a schedule and moves on.

The live way: a feed that updates itself#

If you need prices that move on their own, like a screen that should tick along with the market, sending the same request over and over is the wrong tool. Instead you open one live connection and let the prices come to you as they change.

const ws = new WebSocket(`wss://stream.sifting.io/ws/v1?key=${process.env.SIFTING_KEY}`);

ws.onopen = () => {
  ws.send(JSON.stringify({
    op: "subscribe",
    product: "fx",
    symbols: ["EURUSD", "GBPUSD", "USDJPY"],
  }));
};

ws.onmessage = (evt) => {
  const update = JSON.parse(evt.data);
  if (update.f === "tick") {
    console.log(update.s, "bid", update.b, "ask", update.a);
  }
};

You list the pairs you care about once, and after that every price change arrives on its own as a small message. The moment you connect, the most recent price is sent first, so your screen shows a number right away instead of sitting blank until the next move. This is the better choice when you are watching several pairs at once, or when a delay of even a second would be noticeable to the person looking at the screen.

One practical note keeps the connection healthy: the server will close a connection that goes completely quiet for 90 seconds, so a long-lived feed should send a short {"op":"ping"} message about once a minute. Most client libraries can do this for you.

A few things worth knowing#

The forex market is closed on weekends. It runs from Sunday evening through Friday evening in UTC, and outside those hours no new prices are produced. A live request over the weekend will tell you the data is not fresh and hand back the time of the last real price, so your app can show a clear "market closed" state instead of looking broken. Plan for that gap rather than treating it as a failure.

All times are given in UTC, not your local clock. If a price looks like it landed on the wrong day, the cause is almost always a timezone difference. Convert to local time only when you show the value to a person, and keep everything in UTC underneath so your records line up.

The free plan is generous enough to build and test with, though it does have limits. The live feed allows up to five pairs at once, and the simple requests are capped per minute. If you ask for a sixth pair on the free plan, the feed tells you plainly that you have reached the limit rather than dropping it without a word. Paid plans raise those numbers when you are ready to grow. The documentation lists the current limit for each plan.

What people build with it#

The two methods cover most needs. A live price ticker on a website or trading view fits the feed: open it once when the page loads, and the numbers update themselves. A currency converter that should always show the current rate fits the single request: ask for the pair when someone types an amount, and show the fresh price. A price alert, such as a message when EURUSD crosses a level you set, can use either one, though the feed reacts faster because it does not wait for the next scheduled check. A report or a daily summary often does not need real-time data at all, and a once-a-day request is plenty.

The useful part is that all of these read the same prices in the same format, so moving from a simple converter to a live ticker later does not mean rewriting how you read the data. You change how often you ask, not what you ask for.

Getting started#

Real-time forex prices from SiftingIO come down to two choices: ask for a price when you happen to need one, or open a live feed and let prices arrive as they change. Both use the same API key, and both take only a few lines of code. The free plan needs no credit card, so you can create a free account and watch live EURUSD prices in your terminal within a few minutes.

Tagsforexreal-time datacurrency pairslive pricesexchange ratesfxquotesbeginner guide
All postsLast updated May 26, 2026
Keep reading

Related posts