> For the complete documentation index, see [llms.txt](https://noodles-finance.gitbook.io/docs.noodles.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://noodles-finance.gitbook.io/docs.noodles.fi/ohlcv/ohlcv-pair.md).

# OHLCV for a Pair of Coin Addresses

## Overview

The OHLC-Pair API provides OHLCV (Open, High, Low, Close, Volume) data for a given pair of coins over a specified time range and bucket size.

## Endpoint

```
GET /api/v1/partner/ohlcv-pair
```

## Request Parameters

| Parameter | Type   | Required | Description                                                                                                                                                  |
| --------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `coin_a`  | string | Yes      | The first coin in the pair, represented in a specific format. Example: `0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS`    |
| `coin_b`  | string | Yes      | The second coin in the pair, represented in a specific format. Example: `0x2::sui::SUI`                                                                      |
| `bucket`  | int    | Yes      | Time bucket size in minutes (e.g., `60` for 1-hour intervals). Choices are: 1, 5, 15, 60(1 hour), 240(4 hours) , 1440(1 day), 10080(1 week), 43200(1 month). |
| `from`    | int    | No       | Start timestamp (Unix epoch time in seconds).                                                                                                                |
| `to`      | int    | No       | End timestamp (Unix epoch time in seconds). Default value: Now()                                                                                             |
| `limit`   | int    | No       | Maximum number of data points to return. Max value: 500, Default value: 500                                                                                  |

## Headers

| Header      | Required | Description                 |
| ----------- | -------- | --------------------------- |
| `x-api-key` | No       | API key for authentication. |

## Example Request

```sh
curl --location 'https://api.noodles.fi/api/v1/partner/ohlcv-pair?coin_a=0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b%3A%3Acetus%3A%3ACETUS&coin_b=0x2%3A%3Asui%3A%3ASUI&bucket=60&from=1717113600&to=1743120000' \
--header 'Accept-Encoding: application/json' \
--header 'x-api-key: YOUR_API_KEY'
```

## Response

### Success Response

```json
{
    "data": [
        [
            1743048000,
            0.04908233001742937,
            0.04927861311354048,
            0.049008963864295665,
            0.049008963864295665,
            186885.97466471087,
            2247403.952830868
        ],
        [
            1743051600,
            0.04888959850011181,
            0.04909518361324993,
            0.04856462724447137,
            0.04909518361324993,
            400729.021566083,
            2118999.1037942683
        ]
    ]
}
```

### Response Data Format

Each data entry is an array with the following structure:

| Index | Field       | Description                                  |
| ----- | ----------- | -------------------------------------------- |
| 0     | `timestamp` | Unix timestamp for the bucket period.        |
| 1     | `open`      | Open price of `coin_a` in terms of `coin_b`. |
| 2     | `high`      | Highest price during the period.             |
| 3     | `low`       | Lowest price during the period.              |
| 4     | `close`     | Closing price of the period.                 |
| 5     | `volume_a`  | Trading volume of `coin_a` in the period.    |
| 6     | `volume_b`  | Trading volume of `coin_b` in the period.    |

## Notes

* The `from` and `to` timestamps should be within a reasonable range to avoid performance issues. If the `from` and `to` range is too large, the data will automatically be truncated to a maximum of 500 buckets.
* The API response is optimized for speed and may include only the most relevant data points based on the `limit` parameter.

***

> **See also:** [Environment Setup](/docs.noodles.fi/environment-setup/environment.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://noodles-finance.gitbook.io/docs.noodles.fi/ohlcv/ohlcv-pair.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
