UNIT's API

UNIT's API uses GraphQL

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

Last updated