# UNIT's API

Playground Url: <https://graph.unitindex.org>

## Schemas

#### UnitData

| Field       | Type   | Description                                                  |
| ----------- | ------ | ------------------------------------------------------------ |
| time        | String | The timestamp when UNIT's value got recorded                 |
| value       | Float  | The value of UNIT                                            |
| market\_cap | Float  | Daily/hourly total market cap of all the coins creating UNIT |
| volume      | Float  | Daily/hourly total volume of all the coins creating UNIT     |

#### CoinUnitData

| Field                          | Type   | Description                                              |
| ------------------------------ | ------ | -------------------------------------------------------- |
| time                           | String | The timestamp when the coin's price in UNIT got recorded |
| price                          | Float  | UNIT's price of the coin                                 |
| market\_cap                    | Float  | Daily/hourly total market cap of the coin                |
| volume                         | Float  | Daily/hourly total volume of the coin                    |
| coin\_id                       | String | the coin id                                              |
| price\_change\_24h             | Float  | 24h change of the coin's price in UNIT                   |
| price\_change\_percentage\_24h | Float  | 24h change in percentage of the coin's price in UNIT     |

## Queries

**coinUnitPrice: String**

*Get the price of a coin in UNIT*

* (Required Param) coin\_id: String - the id of the coin
* (Return value) if the coin passed as param is in our supported list, this query will return the corresponding price in UNIT; if not in the list, it will return error message.

\*\*supportedCoinList: \[String] \*\*

*Get the list of coins supported to get the price in UNIT*

* (Return Value) List of coin ids supported in coinUnitPrice query

\*\*coinUnitPriceWithCurrency: Float \*\*

*If the coin is not in supported list, get the unit price with a stable-coin currency and amount*

* (Required Param) currency: String - The currency to be converted into the unit price. Currently four currencies are supported: "usdt", "usdc", "dai", "busd".
* (Required Param) amount: Float - The amount of currencies that needs to be converted.

#### unitDailyData: \[UnitData]

*Get the daily data of UNIT*

* (Optional Param) limit: Int - How many records will be returned in the response

#### coinUnitDailyData: \[CoinUnitData]

*Get the daily data of a specific coin in UNIT*

* (Required Param) coin\_id: String - the id of the coin to be queried
* (Optional Param) limit: Int - How many records will be returned in the response

#### unitHourlyData: \[UnitData]

*Get the hourly data of UNIT*

* (Optional Param) limit: Int - How many records will be returned in the response

#### coinUnitHourlyData: \[CoinUnitData]

*Get the hourly data of a specific coin in UNIT*

* (Required Param) coin\_id: String - the id of the coin to be queried
* (Optional Param) limit: Int - How many records will be returned in the response

More queries coming soon


---

# 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.unitindex.org/theunit/the-unit/the-unit-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.
