get markets

API details

This API returns a paginated list of markets, supporting filters for chains, chain asset types, base asset ID, and quote asset ID.

Get market list

get
Query parameters
ChainIdsstring[]Optional
ChainAssetTypesstring[]Optional
BaseAssetIdstringOptional
QuoteAssetIdstringOptional
Limitinteger Β· int32Optional

maximum number of items to return. maximum value is 500.

Offsetinteger Β· int32Optional

number of items to skip before starting to collect the result set.

OrderBystringOptional

the sorting parameters for the list.

see https://learn.microsoft.com/en-us/azure/search/search-query-odata-orderby#examples for the format of the OrderBy string.

supported sorting parameters are: "MarketId".

default sorting is by " MarketId desc".

Responses
200

OK

get
GET /v1/markets HTTP/1.1
Host: testnetopenapi.hibit.app
Accept: */*
{
  "code": 1,
  "message": "text",
  "data": {
    "items": [
      {
        "marketId": "text",
        "marketSymbol": "text",
        "baseAssetId": "text",
        "quoteAssetId": "text",
        "depthLevels": [
          1
        ]
      }
    ],
    "totalCount": 1
  }
}

Code example

import { hibitClient } from '@delandlabs/hibit-sdk';

const options = {
  network: HibitNetwork.Testnet
};
hibitClient.setOptions(options);

const markets = await hibitClient.getMarkets({
  limit: 10,
  offset: 0
});

SDK

Source code https://github.com/Deland-Labs/hibit-sdk

Example

https://hibit-sdk-example.hibit.app/

Last updated