Mal.io Open API Docs (CoinGecko)

All the following endpoints are public and no authentication is required to fetch data from them.


Host

https://openapi.malresource.com

Endpoints (CoinGecko)

Tickers

GET /api/v1/cg/tickers

Description

This endpoint provides the last 24-hour pricing and volume information on each market pair available on Mal.io.

Request Parameters

None

Request Example

curl -X GET https://${host}/api/v1/cg/tickers

Response Data Example

[
  {
    "ask": "59123.89",
    "base_currency": "BTC",
    "base_volume": "53.60800",
    "bid": "59123.88",
    "high": "59817.75",
    "last_price": "59123.88",
    "low": "57526.31",
    "target_currency": "USDT",
    "target_volume": "3140989.30",
    "ticker_id": "BTC_USDT"
  },
  {
    "ask": "2597.99",
    "base_currency": "ETH",
    "base_volume": "637.0985",
    "bid": "2597.98",
    "high": "2630.88",
    "last_price": "2597.98",
    "low": "2550.44",
    "target_currency": "USDT",
    "target_volume": "1656152.93",
    "ticker_id": "ETH_USDT"
  }
]

Order Book

GET /api/v1/cg/orderbook/${pair_symbol}

Description

This endpoint provides order book information with a minimum depth of 100 (50 each side).

Request Parameters

NameTypeMandatoryMeta

depth

INT

No

Min: 100, Default: 100

Request Example

curl -X GET https://${host}/api/v1/cg/orderbook/btc_usdt?depth=500

Response Data Example

{
  "asks": [
    [
      "59020.0",
      "0.08129799"
    ],
    [
      "59020.01",
      "0.01871799"
    ]
  ],
  "bids": [
    [
      "59019.99",
      "3.61231499"
    ],
    [
      "59019.76",
      "0.01420299"
    ]
  ],
  "ticker_id": "BTC_USDT",
  "timestamp": "1723866167"
}

Historical Trades

GET api/v1/cg/trades/history/${pair_symbol}?side=sell

Description

This endpoint provides historical completed trades for a given market pair.

Request Parameters

NameTypeMandatoryMeta

side

STRING

YES

The nature of trade - buy/sell

limit

INT

NO

Default: 100; max 1000

start_time

STRING

NO

Start time from which to query historical trades from. Must be in the format of: YYYY-MM-DDDD; e.g.: 2019-08-07

end_time

STRING

NO

End time from which to query historical trades from. Must be in the format of: YYYY-MM-DDDD; e.g.: 2019-08-07

Request Example

curl -X GET https://${host}/api/v1/cg/trades/history/btc_usdt?side=sell&limit=2&start_time=2022-05-02

Response Data Example

{
  "buy": [],
  "sell": [
    {
      "base_volume": "0.0000",
      "price": "59216.7400",
      "target_volume": "0.5922",
      "trade_id": 293655137,
      "trade_timestamp": "1723870785",
      "type": "sell"
    },
    {
      "base_volume": "0.0001",
      "price": "59216.7400",
      "target_volume": "2.9608",
      "trade_id": 293655136,
      "trade_timestamp": "1723870785",
      "type": "sell"
    }
  ]
}


Errors

If error occurs, each endpoint will return one of the following general HTTP response errors. Depending on the error, there might be a message indicating the reason of the error

Error CodeError TextNote

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

405

Method Not Allowed

415

Unsupported Media Type

429

Too Many Requests

500

Internal Server Error

503

Service Unavailable

504

Gateway Timeout

Error Response Example

{
  "status_code": 500,
  "status_text": "Internal Server Error",
  "message": "Please contact the administrator for further assistance."
}