NAV
curl

Introduction

Welcome to the Token24 API! You can use our API to access tokex24 API endpoints, which can get information in our database.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
-H "Authorization: tokenhere"

Make sure to replace tokenhere with your APITOKEN key.

Token24 uses API keys to allow access to the API. You can register a new Token24 API to get api token .

Token24 expects for the APIToken key to be included in all API requests to the server in a header that looks like the following:

Authorization: tokenhere

Market Data

Currencies

curl "http://tokex24.com/api/v1/currencies"

The above command returns JSON structured like this:

{
"data": [
{
"name": "ETH",
"displayname": "Ethereum",
"token": "ETH",
"type": "Crypto"
},
{
"name": "SUN",
"displayname": "SUN",
"token": "SUN",
"type": "Token"
},
{
"name": "BTC",
"displayname": "Bitcoin",
"token": "BTC",
"type": "Crypto"
}
]
}

This endpoint retrieves all currencies.

Returns the list of available currencies (including coins, tokens, etc.) with detailed information.

Response

Returns an array of Currency objects, each with the following structure:

Field Description
name Name of currency which is used for query parameter
displayname Currency display name, e.g. “BTC as Bitcoin”
token Unique identifier of the currency, e.g. “BTC”
type Represents Currency type Ex.Fiat,crypto

Trade Pairs

curl "http://tokex24.com/api/v1/tradepairs"

The above command returns JSON structured like this:

{
"data": [
{
"currencypair": "SUN-ETH",
"status": "active",
"fromcurrencyname": "SUN",
"tocurrencyname": "ETH"
},
{
"currencypair": "SUN-BTC",
"status": "active",
"fromcurrencyname": "SUN",
"tocurrencyname": "BTC"
}
]
}

This endpoint retrieves tradepairs.

Response

Returns an array of Trade Pair objects, each with the following structure:

Field Description
currencypair Unique identifier of the trade, e.g. “BTC-ETH” for trading in BTC/ETH pair
status Status of pair
fromcurrencyname Name of the from currency
tocurrencyname Name of the to currency

Order Book

curl "http://tokex24.com/api/v1/orderbook?pair_id=7&limit=2"

The above command returns JSON structured like this:

{
"data": {
"buyorders": [
{
"id": 2000,
"amount": 37,
"quantity": 3
},
{
"id": 2007,
"amount": 41,
"quantity": 1
}
],
"sellorders": [
{
"id": 747,
"amount": 12,
"quantity": 64
},
{
"id": 683,
"amount": 13,
"quantity": 88
}
]
}
}

This endpoint retrieves order book.
Parameter

The parameters should be passed in the query component of the URL of GET request.

Field Type Description
pair_id int Unique Identifier Id
limit int Optional. Maximum number of returned records (both buying and selling) per call. If the parameter is not specified, the number of levels is limited to 25

Response

Returns an array of Order objects, each with the following structure:

Field Description
id Order Id
amount Amount of an order
quantity Quantity of an order

Tickers

curl "http://tokex24.com/api/v1/tickers"

The above command returns JSON structured like this:

{
"data": [
{
"pair_id": 1,
"currencypair": "SUN-BTC",
"ask": 41,
"bid": 18
},
{
"pair_id": 2,
"currencypair": "BTC-ETH",
"ask": 0,
"bid": 0
}
]
}

This endpoint retrieves tickers.

Response

Returns an array of Ticker objects, each with the following structure:

Field Description
pair_id Unique Identifier Id
currencypair Unique identifier of the trade, e.g. “BTC-ETH” for trading in BTC/ETH pair
ask Best ask price.If there are no active selling orders, the field contains the value 0
bid Best bid price.If there are no active buying orders at the moment, the field contains the value 0

Recent Orders

This endpoint retrieves recent orders.

curl "http://tokex24.com/api/v1/recenttrades?pair_id=7&limit=3"

The above command returns JSON structured like this:

{
"data": [
{
"amount": 41,
"quantity": 1,
"type": "buy",
"timestamp": "06-06-2019 12:00:00"
},
{
"amount": 0.5,
"quantity": 1,
"type": "buy",
"timestamp": "06-06-2019 12:00:00"
},
{
"amount": 0.5,
"quantity": 1,
"type": "sell",
"timestamp": "06-06-2019 12:00:00"
}
]
}

Parameter

The parameters should be passed in the query component of the URL of GET request.

Field Type Description
pair_id int Unique Identifier Id
limit int Optional. Maximum number of returned records (both buying and selling) per call. If the parameter is not specified, the number of levels is limited to 25

Response

Returns an array of Ticker objects, each with the following structure:

Field Description
amount Price for which the base currency was bought or sold
quantity Trade volume (the amount of base currency that was bought or sold)
type Trade direction, can have either of the two values: “buy” or “sell”
timestamp Date and time when the trade took execute

Trading

Active Orders

This endpoint retrieves trade active orders.

curl "http://tokex24.com/api/v1/trading/activeorders?pair_id=7&limit=10"

The above command returns JSON structured like this:

{
"data": [
{
"currencypair": "SUN-BTC",
"status": "pending",
"amount": 41,
"quantity": 1,
"type": "buy",
"timestamp": "06-06-2019 12:00:00"
},
{
"currencypair": "SUN-BTC",
"status": "partialcomplete",
"amount": 37,
"quantity": 6,
"type": "buy",
"timestamp": "01-06-2019 08:55:37"
},
{
"currencypair": "SUN-BTC",
"status": "pending",
"amount": 18,
"quantity": 1,
"type": "sell",
"timestamp": "01-06-2019 08:55:22"
}
]
}

Parameter

The parameters should be passed in the query component of the URL of GET request.

Field Type Description
pair_id int Unique Identifier Id
limit int Optional. Maximum number of returned records (both buying and selling) per call. If the parameter is not specified, the number of levels is limited to 25

Response

Returns an array of Order objects, each with the following structure:

Field Description
currencypair Unique identifier of the trade, e.g. “BTC-ETH” for trading in BTC/ETH pair
amount Price for which the base currency was bought or sold
quantity Trade volume (the amount of base currency that was bought or sold)
type Trade direction, can have either of the two values: “buy” or “sell”
timestamp Date and time when the trade took execute
status Status of order

Order History

Returns the list of trader’s orders with detailed information.

curl "http://tokex24.com/api/v1/trading/orderhistory?pair_id=7&limit=10"

The above command returns JSON structured like this:

{
"data": [
{
"currencypair": "SUN-BTC",
"status": "pending",
"amount": 41,
"quantity": 1,
"type": "buy",
"timestamp": "06-06-2019 12:00:00"
},
{
"currencypair": "SUN-BTC",
"status": "cancel",
"amount": 41,
"quantity": 1,
"type": "buy",
"timestamp": "06-06-2019 12:00:00"
},
{
"currencypair": "SUN-BTC",
"status": "pending",
"amount": 18,
"quantity": 1,
"type": "sell",
"timestamp": "01-06-2019 08:55:22"
}
]
}

Parameter

The parameters should be passed in the query component of the URL of GET request.

Field Type Description
pair_id int Unique Identifier Id
limit int Optional. Maximum number of returned records (both buying and selling) per call. If the parameter is not specified, the number of levels is limited to 25

Response

Returns an array of Order objects, each with the following structure:

Field Description
currencypair Unique identifier of the trade, e.g. “BTC-ETH” for trading in BTC/ETH pair
amount Price for which the base currency was bought or sold
quantity Trade volume (the amount of base currency that was bought or sold)
type Trade direction, can have either of the two values: “buy” or “sell”
timestamp Date and time when the trade took execute
status Status of order

Trade History

Returns the list of trades with detailed information.

curl "http://tokex24.com/api/v1/trading/tradehistory?pair_id=7&limit=10"

The above command returns JSON structured like this:

{
"data": [
{
"currencypair": "SUN-BTC",
"status": "complete",
"amount": 41,
"quantity": 1,
"type": "buy",
"timestamp": "06-06-2019 12:00:00",
"fee": 0.0041,
"feecurrency": "BTC"
},

{
"currencypair": "SUN-BTC",
"status": "complete",
"amount": 10,
"quantity": 1,
"type": "sell",
"timestamp": "01-06-2019 08:55:01",
"fee": 0.001,
"feecurrency": "SUN"
}

]
}

Parameter

The parameters should be passed in the query component of the URL of GET request.

Field Type Description
pair_id int Unique Identifier Id
limit int Optional. Maximum number of returned records (both buying and selling) per call. If the parameter is not specified, the number of levels is limited to 25

Response

Returns an array of Order objects, each with the following structure:

Field Description
currencypair Unique identifier of the trade, e.g. “BTC-ETH” for trading in BTC/ETH pair
amount Price for which the base currency was bought or sold
quantity Trade volume (the amount of base currency that was bought or sold)
type Trade direction, can have either of the two values: “buy” or “sell”
timestamp Date and time when the trade took execute
status Status of order
fee The amount of fee charged
feecurrency Fee currency

Trade Fee

Returns the trade fee.

curl "http://tokex24.com/api/v1/trading/tradefee?pair_id=7"

The above command returns JSON structured like this:

{
"data": [
{
"makerfee": 0.01,
"takerfee": 0.1,
"rebate": 0.01
}
]
}

Parameter

The parameters should be passed in the query component of the URL of GET request.

Field Type Description
pair_id int Unique Identifier Id

Response

Returns an array of Order objects, each with the following structure:

Field Description
makerfee Market-maker fee (%)
takerfee Market-taker fee (%)
rebate Rebate (%)

Accounts

Balances

curl "http://tokex24.com/api/v1/balance"

The above command returns JSON structured like this:

{
"data": [
{
"currency": "ETH",
"type": "crypto",
"address": "0x065c93903e5184d152a22b0020d167b181187dd9",
"balance": "0.00000000"
},
{
"currency": "BTC",
"type": "crypto",
"address": "2NDkqgK4WCoTp6S3uqYuqQFyShDHYznGoy2",
"balance": "0.00000000"
},
{
"currency": "SUN",
"type": "token",
"address": "0x065c93903e5184d152a22b0020d167b181187dd9",
"balance": "0.00000000"
}
]
}

Response

Returns an array of Wallet objects, each with the following structure:

Field Description
currency Wallet Currency
type Type of Currency
address Address of wallet
balance Available Balance of wallet

Errors

Successfully executed API calls return the HTTP status-code 200 OK.

Failed API calls return one of the following status-codes:

Error Code Meaning
400 Bad Request – Your request sucks
401 Unauthorized – Your API key is wrong
403 Forbidden – The kitten requested is hidden for administrators only
404 Not Found – The specified request could not be found
405 Method Not Allowed – You tried to access a request with an invalid method
429 Too Many Requests – You’re requesting too many requests! Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarily offline for maintenance. Please try again later.