# Forex Market Data API

### Overview

The [**Infoway Forex Real-Time Market Data API**](https://infoway.io/en/forex-api) provides comprehensive access to live and historical data for more than **40 major currency pairs**.\
It supports both HTTP and WebSocket access for real-time and historical candlestick data, order book depth, and latest trade.

### 1. Retrieving the Currency Pair List

Infoway maintains an updated list of **40 major currency pairs**, including commonly traded pairs such as EUR/USD, GBP/USD, USD/JPY, and AUD/USD.

You can obtain this list in two ways:

**Option 1 — Download from the Web Portal**

Log in to your Infoway account and download the latest stock excel list file from the **Downloads** section at the right side of the dashboard.

**Option 2 — Query via API**

You can also retrieve the list programmatically through the **HTTP Symbol List API**.\
Refer to the [**GET /symbol-list**](https://docs.infoway.io/en-docs/rest-api/get-basic-info/get-symbol-list) documentation for usage details.

### 2. Query Methods

Infoway Forex API offers **two primary data-access methods**, optimized for different use cases:

| Method                  | Ideal Use Case                  | Description                                                                                                                                                            |
| ----------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **HTTP API**            | Scheduled or batch queries      | Suitable for regular polling or historical data retrieval. Supports requests for fundamentals, historical candlestick data, real-time snapshots, and order book depth. |
| **WebSocket Streaming** | Low-latency, continuous updates | Best for low-latency updates and live data feeds. Allows continuous streaming of FX quotes, trades, and depth updates.                                                 |

{% hint style="info" %}
Both HTTP and WebSocket interfaces are subject to rate limits. See the [*Rate Limit Policy*](https://docs.infoway.io/en-docs/getting-started/api-limitation) section for detailed constraints.
{% endhint %}

### 3. Market Data Schemas

The Infoway Forex Real-Time Market Data API supports several categories of live and historical market data.

#### 3.1 Real-Time Candlestick (OHLCV) Data

Provides real-time candlestick data for Forex pairs, including open, high, low, and close prices, as well as trade volume and value.

You can access this data via:

* **HTTP Request:** see [*GET /candlestick*](https://docs.infoway.io/en-docs/rest-api/market-data/post-candlestick-real-historical)
* **WebSocket Subscription:** see [*WebSocket /candlestick*](https://docs.infoway.io/en-docs/websocket/websocket-subscribe-method/candlestick-subscription) topic

**Example Response (USDGBP)**

```json
{
  "s": "USDGBP",
  "respList": [
    {
      "t": "1752872400",
      "h": "0.74578",
      "o": "0.74527",
      "l": "0.74503",
      "c": "0.74503",
      "v": "45.0",
      "vw": "33.530460",
      "pc": "-0.09%",
      "pca": "-0.00065"
    }
  ]
}
```

#### 3.2 Latest Trade

Retrieve the most recent executed trades for a given currency pair, including price, volume, and transaction direction.

Access methods:

* **HTTP API:** [*GET /trades*](https://docs.infoway.io/en-docs/rest-api/market-data/get-latest-trade)
* **WebSocket:** [*Subscribe to /trades*](https://docs.infoway.io/en-docs/websocket/websocket-subscribe-method/latest-trade-subscription)

**Example Response**

```json
{
  "s": "USDGBP",
  "t": 1752875078529,
  "p": "0.74503",
  "v": "1.0",
  "vw": "0.745030",
  "td": 0
}
```

#### 3.3 Real-Time Order Book Depth

Provides current best bid and ask quotes for each currency pair, along with available volumes.

Access methods:

* **HTTP API:** [*GET /market-depth*](https://docs.infoway.io/en-docs/rest-api/market-data/get-market-depth)
* **WebSocket:** [*Subscribe to /Depth*](https://docs.infoway.io/en-docs/websocket/websocket-subscribe-method/depth-subscription)

**Example Response**

```json
{
  "s": "USDGBP",
  "t": 1752932303508,
  "a": [
    [
      "0.74507"
    ],
    [
      "1"
    ]
  ],
  "b": [
    [
      "0.74503"
    ],
    [
      "1"
    ]
  ]
}
```
