# 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**](/en-docs/rest-api/get-basic-info/get-symbol-list.md) 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*](/en-docs/getting-started/api-limitation.md) 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*](/en-docs/rest-api/market-data/post-candlestick-real-historical.md)
* **WebSocket Subscription:** see [*WebSocket /candlestick*](/en-docs/websocket/websocket-subscribe-method/candlestick-subscription.md) 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*](/en-docs/rest-api/market-data/get-latest-trade.md)
* **WebSocket:** [*Subscribe to /trades*](/en-docs/websocket/websocket-subscribe-method/latest-trade-subscription.md)

**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*](/en-docs/rest-api/market-data/get-market-depth.md)
* **WebSocket:** [*Subscribe to /Depth*](/en-docs/websocket/websocket-subscribe-method/depth-subscription.md)

**Example Response**

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infoway.io/en-docs/readme/forex-market-data-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
