> 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/coin/coin-historical-price.md).

# Coin Historical Price

Retrieve historical price data for a specific coin within a given time range and bucket interval.

***

## **Endpoint**

```
GET /api/v1/partner/coin-historical-price
```

## **Request**

### Query Parameters

| Name      | Type   | Required | Description                                                      |
| --------- | ------ | -------- | ---------------------------------------------------------------- |
| `coin_id` | string | Yes      | The unique identifier of the coin (e.g., `0x...::module::COIN`). |
| `bucket`  | int    | Yes      | The interval (in minutes) for each price data point.             |
| `from`    | int    | Yes      | Start of the time range (Unix timestamp in seconds).             |
| `to`      | int    | Yes      | End of the time range (Unix timestamp in seconds).               |

### Headers

| Header            | Required | Description                          |
| ----------------- | -------- | ------------------------------------ |
| `x-api-key`       | Yes      | API key for authorization.           |
| `x-chain`         | Yes      | Blockchain identifier (e.g., `sui`). |
| `Accept-Encoding` | Yes      | Should be set to `application/json`. |

***

## **Example Request**

```bash
curl -X GET "https://api.noodles.fi/api/v1/partner/coin-historical-price?coin_id=0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca::blue::BLUE&bucket=5&from=1748420400&to=1748423100" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "x-chain: sui" \
    -H "Accept-Encoding: application/json"
```

***

## **Response**

### Fields

| Field            | Type       | Nullable | Description                                      |
| ---------------- | ---------- | -------- | ------------------------------------------------ |
| `code`           | `number`   | No       | HTTP status code (200 for success).              |
| `message`        | `string`   | No       | Status message.                                  |
| `data.timestamp` | `number[]` | No       | Array of Unix timestamps (seconds).              |
| `data.price`     | `number[]` | No       | Array of prices corresponding to each timestamp. |

### Success Response

```json
{
    "code": 200,
    "message": "OK",
    "data": {
        "timestamp": [
            1748420400,
            1748420700,
            1748421000,
            1748421300,
            1748421600,
            1748421900,
            1748422200,
            1748422500,
            1748422800,
            1748423100
        ],
        "price": [
            0.1336538764891597,
            0.13381098347999498,
            0.1340244545812692,
            0.13382666114356717,
            0.1345310779845118,
            0.13440790429372404,
            0.13428888030654038,
            0.13455521082990599,
            0.134711571860626,
            0.13450061655428858
        ]
    }
}
```

### Response when no data is available

```json
{
    "code": 200,
    "message": "OK",
    "data": {
        "timestamp": [],
        "price": []
    }
}
```

***

## Notes

* The `bucket` parameter determines the granularity of the returned price data.
* The `coin_id` must follow the format: `address::symbol::SYMBOL`.
* The number of elements in `timestamp` and `price` arrays will match.

***

> **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/coin/coin-historical-price.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.
