> 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.md).

# API

How to use the HertzFlow Oracle Price API.

The HertzFlow Oracle Price API is a public REST service for reading the latest oracle prices of all supported tokens on **BNB Smart Chain (BSC)**.

## Base URLs

| Network     | Base URL                                       |
| ----------- | ---------------------------------------------- |
| BSC Mainnet | `https://oracle-aggregator.hertzflow.xyz`      |
| BSC Testnet | `https://oracle-aggregator.testnet.htzfl.link` |

All routes below are appended to the base URL. The two networks serve the same endpoint over their own symbol set.

## Authentication

No authentication, API key, or authorization header is required. All endpoints are public `GET` requests.

## Response format

Responses are plain JSON with a top-level `data` object — there is no `code`/`msg` envelope:

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

Prices are human-readable decimal strings in USD, so no scaling is needed before display. Timestamps are Unix seconds.

## Errors

| Case                                | Response                                                                                                     |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Missing or invalid query parameters | `400` with `{"code":"INVALID_PARAMS_ERROR","error":"..."}` — note that `code` is a string enum, not a number |
| Unknown path                        | `404` with the plain-text body `404 page not found`                                                          |

## Quick start

Fetch the latest prices for every supported token on mainnet:

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

Example response (truncated):

```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
      }
    ]
  }
}
```

For the full endpoint reference, see [API Reference](/hertzflow-docs/tech-docs/api/api-reference.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.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.
