WebSocket Endpoints
# Websocket Forex API Top-of-Book Endpoint
wss://api.tiingo.com/fx

Just remember, you will need your token in order to connect. Keep it safe.

.

3.2 Websockets (Firehose) - Forex

3.2.1 Overview

Tiingo provides updates via websocket every time the Top-of-book (best bid/offer price) change.

We obtain our data through raw binary feeds we receive via feeds that cannot to tier-1 banks and FX dark pools. We then send the data straight to you after minor processing (even before we update our databases).

To further minimize latency, we use bare metal machines for our cloud infrastructure which are located about 15 miles from the NY5 data center.

With Tiingo Free, Power, Commercial, and Redistribution plans all come with access to the firehose. Please note the firehose exposes a very high amount of data, in some cases to the microsecond resolution. Please build your systems cautiously and to scale, otherwise you may use our REST API which leverages Tiingo's infrastructure for this purpose.

You can find out about the full product offering on the Product - Forex page.

3.2 Websockets (Firehose) - Forex

3.2.2 Top-of-Book

With Tiingo's Websocket/Firehose Forex API, you can gain access to all data we receive via our feeds.

To control how much data you would like to receive, read about the "thresholdLevel" request parameter below. A higher "thresholdLevel" means you will get less updates, which could potentially be more relevant.

For the Forex Websocket API:

  • A "thresholdLevel" of 5 means you will get ALL Top-of-Book updates.
To request top-of-book and last trade data, use the following Websocket endpoint.
# Websocket Top-of-Book Endpoint
wss://api.tiingo.com/fx

The Forex websocket returns meta information about the websocket update message along with the raw data related to that update message.

Check out the table below to see the top-level fields returned from the Websocket FX API.

Field Name
JSON Field
Data Type
Description
Service code
service
string
An identifier telling you this is FX data. The value returned by this will always be "fx".
Message Type
messageType
char
A value telling you what kind of data packet this is from our FX feed. Will always return "A" meaning new price quotes.
FX TOP/Price Data
data
array
An array containing the FX data. See the tables below to see the fields returned in the array depending if the message is a "Trade" or "TOP" Update message.

To see what fields are returned in the "data" field, please see the table below.

Top-of-Book (Quote) Update Messages

Field Name
Array Index
Data Type
Description
Update Message Type
0
char
Communicates what type of price update this is. Will always be "Q" for top-of-book update message.
Ticker
1
string
Ticker related to the asset.
Date
2
datetime
A string representing the datetime this quote or trade came in. This is reported in JSON ISO Format.
Bid Size
3
float
The number shares at the bid price.
Bid Price
4
float
The current highest bid price.
Mid Price
5
float
The mid price of the current timestamp when both "bidPrice" and "askPrice" are not-null. In mathematical terms:
mid = (bidPrice + askPrice)/2.0
Ask Size
7
float
The number of units at the ask price.
Ask Price
6
float
The current lowest ask price.