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

# API Reference

Oracle Price API reference: latest oracle prices for all supported tokens on BNB Smart Chain.

## Overview

The HertzFlow Oracle Price API returns the latest oracle price for every supported token on **BNB Smart Chain (BSC)**. It is a public, read-only `GET` service that requires no authentication, intended for price display and for reading prices ahead of trading integrations. Trading operations such as order placement and liquidity management are performed through the contracts — see the [Smart Contract](/hertzflow-docs/tech-docs/smart-contract.md) documentation.

### On this page

* [Getting a single price](#getting-a-single-price)
* [Getting all prices](#getting-all-prices)
* [Notes](#notes)

## Getting a single price

### `GET /api/v1/latestPrice?symbols[]=SYMBOL`

Retrieves the latest oracle price for the requested symbol.

**Parameters**

| Parameter   | In    | Type      | Required | Description                                                                                               |
| ----------- | ----- | --------- | -------- | --------------------------------------------------------------------------------------------------------- |
| `symbols[]` | query | string\[] | yes      | Price feed symbol(s). Repeat the parameter to request several, e.g. `symbols[]=BTC/USD&symbols[]=ETH/USD` |

**Example request**

```bash
curl "https://oracle-aggregator.hertzflow.xyz/api/v1/latestPrice?symbols[]=BTC/USD"
```

**Example response — 200 OK**

```json
{
  "data": {
    "prices": [
      {
        "symbol": "BTC/USD",
        "bsc_token_addr": "0x2d8f28f05113c2dc0a17ebbba60d8f72318bdb1f",
        "price": "77545.8870947191304",
        "timestamp": 1787992637
      }
    ]
  }
}
```

The `symbol` must match a supported feed exactly (for example `BTC/USD`). Calling the endpoint without `symbols[]` (and without `get_all=true`, see below) returns an error:

```json
{"code":"INVALID_PARAMS_ERROR","error":"invalid symbols: []"}
```

## Getting all prices

### `GET /api/v1/latestPrice?get_all=true`

Retrieves the latest oracle price for every supported token.

**Example request**

```bash
curl "https://oracle-aggregator.hertzflow.xyz/api/v1/latestPrice?get_all=true"
```

**Example response — 200 OK**

```json
{
  "data": {
    "prices": [
      {
        "symbol": "MRVL/USD",
        "bsc_token_addr": "0x663de62a4be589533b30b08a55009ce27c75c003",
        "price": "221.83497",
        "timestamp": 1787904899
      },
      {
        "symbol": "ETH/USD",
        "bsc_token_addr": "0x2c08e4b0442381bb2f6e70943c94f991345be236",
        "price": "2497.327261755814",
        "timestamp": 1787904899
      },
      {
        "symbol": "GOOG/USD",
        "bsc_token_addr": "0xb5e48b6db7cdb2b35483b1301d0a1e7ed534c4e8",
        "price": "339.03",
        "timestamp": 1787904899
      }
    ]
  }
}
```

The list is truncated here for readability; the live response contains one entry per supported token.

**Response fields**

| Field                          | Type    | Description                                                                       |
| ------------------------------ | ------- | --------------------------------------------------------------------------------- |
| `data.prices[].symbol`         | string  | Price feed symbol (for example `BTC/USD`).                                        |
| `data.prices[].bsc_token_addr` | string  | BSC address of the token the price refers to.                                     |
| `data.prices[].price`          | string  | Latest oracle price — human-readable decimal string in USD (no scaling required). |
| `data.prices[].timestamp`      | integer | Price timestamp (Unix seconds).                                                   |

## Notes

* The service is reachable at the public domains listed in the [API guide](/hertzflow-docs/tech-docs/api.md); only those domains are supported.
* Prices are refreshed every few seconds; the `timestamp` field tells you how fresh a given quote is.
* When filling contract parameters (e.g. `acceptablePrice`, `sizeDeltaUsd`), multiply the decimal USD price by 1e30; see [Trade Integration](/hertzflow-docs/tech-docs/smart-contract/trade-integration.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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hertzflow.gitbook.io/hertzflow-docs/tech-docs/api/api-reference.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
