We provide both rpc and restful APIs.
Endpoint
RPC:
https://tokenlon-core-market.tokenlon.im/rpc
Restful:
https://tokenlon-core-market.tokenlon.im/rest
RPC APIs
getMarket
Request mode
POST
example call
curl -X POST \
https://tokenlon-core-market.tokenlon.im/rpc \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"jsonrpc": "2.0",
"method": "market.getMarket",
"params": {},
"id": 1
}'
Request Parameter
none
example result
{
"jsonrpc": "2.0",
"result": [
{
"timestamp": 0,
"pairs": "ATOM_ETH",
"baseSymbol": "ATOM",
"baseAddress": "0xc5637328da2e0a3400274a4088cea2e25fb91446",
"baseDecimals": 6,
"quoteSymbol": "ETH",
"quoteAddress": "0x0000000000000000000000000000000000000000",
"quoteDecimals": 18,
"last": 0,
"high24h": 0,
"low24h": 0,
"ask": 0.0208170000,
"mid": 0.0208170000,
"bid": 0,
"vol24h": 0,
"txs24h": 0,
"wallet24h": 0,
"change24h": 0
},
// ...
}
Request return
market[]
, array, market summary
Name | Type | Description |
---|---|---|
timestamp | Number | data generate timestamp |
pairs | String | request pair |
baseSymbol | String | this pair base token symbol |
baseAddress | String | this pair base token address |
baseDecimals | String | this pair base token decimals |
quoteSymbol | String | this pair quote token symbol |
quoteAddress | String | this pair quote token address |
quoteDecimals | String | this pair quote token decimals |
last | Number | last trade price |
high24h | Number | highest price within 24H |
low24 | Number | lowest price within 24H |
ask | Number | current ask price |
mid | Number | (ask + mid) / 2 |
bid | Number | current bid price |
vol24h | Number | total base trade vol within 24H |
txs24h | Number | total transactions within 24H |
wallet24h | Number | total wallets trade within 24H |
change24h | Number | price changed compared with yesterday |
getTokens
Request mode
POST
example call
curl -X POST \
https://tokenlon-core-market.tokenlon.im/rpc \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"jsonrpc": "2.0",
"method": "market.getTokens",
"params": {},
"id": 1
}'
Request Parameter
none
example result
{
"jsonrpc": "2.0",
"result": [
{
"symbol": "ATOM",
"contractAddress": "0xc5637328da2e0a3400274a4088cea2e25fb91446",
"decimals": 6
},
// ...
}
Request return
token[]
, array, every token info
Name | Type | Description |
---|---|---|
symbol | String | token symbol |
contractAddress | String | token contract address |
decimals | Number | token decimals |
getPairs
Request mode
POST
example call
curl -X POST \
https://tokenlon-core-market.tokenlon.im/rpc \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"jsonrpc": "2.0",
"method": "market.getPairs",
"params": {},
"id": 1
}'
Request Parameter
none
example result
{
"jsonrpc": "2.0",
"result": [
"ATOM_ETH",
"ATOM_USDT",
"DAI_ETH",
// ...
],
"id": 1
}
Request return
string[]
, array, every item is pair string
getTicker
Get ticker by pairs
and period
Request mode
POST
example call
curl -X POST \
https://tokenlon-core-market.tokenlon.im/rpc \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"jsonrpc": "2.0",
"method": "market.getTicker",
"params": {
"pairs": "USDT_ETH",
"period": "7D"
},
"id":1
}'
Request Parameter
Name | Type | Mandatory | Description |
---|---|---|---|
pairs | String | YES | pairs list on getPairs API response, like DAI_ETH |
period | String | YES | "24H", "7D", "1M" |
example result
{
"jsonrpc": "2.0",
"result": {
"timestamp": 1568779507,
"period": "7D",
"pairs": "USDT_ETH",
"lastTimestamp": 1568778898,
"last": 0.004738890000,
"high": 0.005741520000,
"low": 0.004655610000,
"ask": 0.0047321598,
"mid": 0.0047303299,
"bid": 0.0047285,
"vol": 1803272.382003000000,
"txs": 3146,
"wallet": 2195,
"change": -0.0117
},
"id": 1
}
Request return
Name | Type | Description |
---|---|---|
timestamp | Number | ticker generate timestamp |
period | String | request period |
pairs | String | request pair |
lastTimestamp | Number | this pair last trade timestamp |
last | Number | last trade price |
high | Number | highest price within period |
low | Number | lowest price within period |
ask | Number | current ask price |
mid | Number | (ask + mid) / 2 |
bid | Number | current bid price |
vol | Number | total base trade vol within period |
txs | Number | total transactions within period |
wallet | Number | total wallets trade within period |
change | Number | price changed compared with yesterday |
getTickerHistory
Request mode
POST
example call
curl -X POST \
https://tokenlon-core-market.tokenlon.im/rpc \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"jsonrpc": "2.0",
"method": "market.getTickerHistory",
"params": {
"pairs": "DAI_ETH",
"beginTimestamp": 1569456000,
"endTimestamp": 1569542400
},
"id":1
}'
Request Parameter
Name | Type | Mandatory | Description |
---|---|---|---|
pairs | String | YES | pairs list on getPairs API response, like DAI_ETH |
beginTimestamp | Number | YES | Query begin Unix Timestamp, like 1568937600 |
endTimestamp | Number | YES | Query end Unix Timestamp |
example result
{
"jsonrpc": "2.0",
"result": [
{
"date": "2019-09-27",
"period": "24H",
"pairs": "DAI_ETH",
"last": 0.006011889912,
"high": 0.006159923819,
"low": 0.006011889912,
"vol": 4146.066485000000,
"txs": 14,
"wallet": 11
},
{
"date": "2019-09-26",
"period": "24H",
"pairs": "DAI_ETH",
"last": 0.006074829999,
"high": 0.006406060851,
"low": 0.005915320000,
"vol": 6996.547560420000,
"txs": 11,
"wallet": 9
}
],
"id": 1
}
Request return
ticker[]
, array, order by date desc
Name | Type | Description |
---|---|---|
date | string | ticker date, like 2019-09-27 |
period | String | 24H |
pairs | String | request pair |
last | Number | last trade price |
high | Number | highest price within period |
low | Number | lowest price within period |
vol | Number | total base trade vol within period |
txs | Number | total transactions within period |
wallet | Number | total wallets trade within period |
getTradeCap
Get trade market cap by currency and period
Request mode
POST
example call
curl -X POST \
https://tokenlon-core-market.tokenlon.im/rpc \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"jsonrpc": "2.0",
"method": "market.getTradeCap",
"params": {
"currency": "USD",
"period": "1M"
},
"id":1
}'
Request Parameter
Name | Type | Mandatory | Description |
---|---|---|---|
currency | String | YES | "ETH", "USD", "CNY", "DAI" |
period | String | YES | "24H", "7D", "1M" |
example result
{
"jsonrpc": "2.0",
"result": {
"timestamp": 1568780268,
"period": "24H",
"vol": 466504.0822626114,
"txs": 627,
"wallet": 499,
"currency": "USD"
},
"id": 1
}
Request return
Name | Type | Description |
---|---|---|
timestamp | Number | data generated timestamp |
period | String | request period |
vol | Number | total vol based on currency within 24H |
txs | Number | total txs within 24H |
wallet | Number | total wallets trade within 24H |
currency | String | request currency |
getTradeCapHistory
Request mode
POST
example call
curl -X POST \
https://tokenlon-core-market.tokenlon.im/rpc \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"jsonrpc": "2.0",
"method": "market.getTradeCapHistory",
"params": {
"beginTimestamp": 1569456000,
"endTimestamp": 1569542400,
"currency": "USD"
},
"id":1
}'
Request Parameter
Name | Type | Mandatory | Description |
---|---|---|---|
beginTimestamp | Number | YES | Query begin Unix Timestamp, like 1568937600 |
endTimestamp | Number | YES | Query end Unix Timestamp |
currency | String | YES | "ETH", "USD", "CNY", "DAI" |
example result
{
"jsonrpc": "2.0",
"result": [
{
"date": "2019-09-27",
"period": "24H",
"vol": 706408.8389006486,
"txs": 367,
"wallet": 278,
"currency": "USD"
},
{
"date": "2019-09-26",
"period": "24H",
"vol": 337192.6146473213,
"txs": 345,
"wallet": 286,
"currency": "USD"
}
],
"id": 1
}
Request return
tradeCap[]
, array, order by date desc
Name | Type | Description |
---|---|---|
date | string | ticker date, like 2019-09-27 |
period | String | 24H |
vol | Number | total base trade vol within period |
txs | Number | total transactions within period |
wallet | Number | total wallets trade within period |
currency | String | request currency |
Restful APIs
get_market
Request mode
GET
example call
curl 'https://tokenlon-core-market.tokenlon.im/rest/get_market'
Request Parameter
none
example result
{
"error": false,
"data": [
{
"timestamp": 0,
"pairs": "ATOM_ETH",
"baseSymbol": "ATOM",
"baseAddress": "0xc5637328da2e0a3400274a4088cea2e25fb91446",
"baseDecimals": 6,
"quoteSymbol": "ETH",
"quoteAddress": "0x0000000000000000000000000000000000000000",
"quoteDecimals": 18,
"last": 0,
"high24h": 0,
"low24h": 0,
"ask": 0.0207750000,
"mid": 0.0207750000,
"bid": 0,
"vol24h": 0,
"txs24h": 0,
"wallet24h": 0,
"change24h": 0
},
// ...
}
Request return
market[]
, array, market summary
Name | Type | Description |
---|---|---|
timestamp | Number | data generate timestamp |
pairs | String | request pair |
baseSymbol | String | this pair base token symbol |
baseAddress | String | this pair base token address |
baseDecimals | String | this pair base token decimals |
quoteSymbol | String | this pair quote token symbol |
quoteAddress | String | this pair quote token address |
quoteDecimals | String | this pair quote token decimals |
last | Number | last trade price |
high24h | Number | highest price within 24H |
low24 | Number | lowest price within 24H |
ask | Number | current ask price |
mid | Number | (ask + mid) / 2 |
bid | Number | current bid price |
vol24h | Number | total base trade vol within 24H |
txs24h | Number | total transactions within 24H |
wallet24h | Number | total wallets trade within 24H |
change24h | Number | price changed compared with yesterday |
get_tokens
Request mode
POST
example call
curl 'https://tokenlon-core-market.tokenlon.im/rest/get_tokens'
Request Parameter
none
example result
{
"error": false,
"data": [
{
"symbol": "ATOM",
"contractAddress": "0xc5637328da2e0a3400274a4088cea2e25fb91446",
"decimals": 6
},
// ...
}
Request return
token[]
, array, every token info
Name | Type | Description |
---|---|---|
symbol | String | token symbol |
contractAddress | String | token contract address |
decimals | Number | token decimals |
get_pairs
Request mode
GET
example call
curl 'https://tokenlon-core-market.tokenlon.im/rest/get_pairs'
Request Parameter
none
example result
{
"error": false,
"data": [
"ATOM_ETH",
"ATOM_USDT",
"DAI_ETH",
// ...
]
}
Request return
string[]
, array, every item is pair string
get_ticker
Get ticker by pairs
and period
Request mode
GET
example call
curl 'https://tokenlon-core-market.tokenlon.im/rest/get_ticker?period=24H&pairs=USDT_ETH'
Request Parameter
Name | Type | Mandatory | Description |
---|---|---|---|
pairs | String | YES | pairs list on get_pairs API response, like DAI_ETH |
period | String | YES | "24H", "7D", "1M" |
example result
{
"error": false,
"data": {
"timestamp": 1577258730,
"period": "24H",
"pairs": "USDT_ETH",
"lastTimestamp": 1577257908,
"last": 0.008018935379,
"high": 0.008018935379,
"low": 0.007718990000,
"ask": 0.0080012902,
"mid": 0.0079947301,
"bid": 0.00798817,
"vol": 409760.423996000000,
"txs": 124,
"wallet": 81,
"change": 0.0260
}
}
Request return
Name | Type | Description |
---|---|---|
timestamp | Number | ticker generate timestamp |
period | String | request period |
pairs | String | request pair |
lastTimestamp | Number | this pair last trade timestamp |
last | Number | last trade price |
high | Number | highest price within period |
low | Number | lowest price within period |
ask | Number | current ask price |
mid | Number | (ask + mid) / 2 |
bid | Number | current bid price |
vol | Number | total base trade vol within period |
txs | Number | total transactions within period |
wallet | Number | total wallets trade within period |
change | Number | price changed compared with yesterday |
get_ticker_history
Request mode
GET
example call
curl 'https://tokenlon-core-market.tokenlon.im/rest/get_ticker_history?pairs=DAI_ETH&beginTimestamp=1569456000&endTimestamp=1569542400'
Request Parameter
Name | Type | Mandatory | Description |
---|---|---|---|
pairs | String | YES | pairs list on get_pairs API response, like DAI_ETH |
beginTimestamp | Number | YES | Query begin Unix Timestamp, like 1568937600 |
endTimestamp | Number | YES | Query end Unix Timestamp |
example result
{
"error": false,
"data": [
{
"date": "2019-09-27",
"period": "24H",
"pairs": "DAI_ETH",
"last": 0.006011889912,
"high": 0.006159923819,
"low": 0.006011889912,
"vol": 4146.066485000000,
"txs": 14,
"wallet": 11
},
{
"date": "2019-09-26",
"period": "24H",
"pairs": "DAI_ETH",
"last": 0.006074829999,
"high": 0.006406060851,
"low": 0.005915320000,
"vol": 6996.547560420000,
"txs": 11,
"wallet": 9
}
]
}
Request return
ticker[]
, array, order by date desc
Name | Type | Description |
---|---|---|
date | string | ticker date, like 2019-09-27 |
period | String | 24H |
pairs | String | request pair |
last | Number | last trade price |
high | Number | highest price within period |
low | Number | lowest price within period |
vol | Number | total base trade vol within period |
txs | Number | total transactions within period |
wallet | Number | total wallets trade within period |
get_trade_cap
Get trade market cap by currency and period
Request mode
GET
example call
curl 'https://tokenlon-core-market.tokenlon.im/rest/get_trade_cap?currency=USD&period=1M'
Request Parameter
Name | Type | Mandatory | Description |
---|---|---|---|
currency | String | YES | "ETH", "USD", "CNY", "DAI" |
period | String | YES | "24H", "7D", "1M" |
example result
{
"error": false,
"data": {
"timestamp": 1577259148,
"period": "1M",
"vol": 17208235.4124141616,
"txs": 8910,
"wallet": 3063,
"currency": "USD"
}
}
Request return
Name | Type | Description |
---|---|---|
timestamp | Number | data generated timestamp |
period | String | request period |
vol | Number | total vol based on currency within 24H |
txs | Number | total txs within 24H |
wallet | Number | total wallets trade within 24H |
currency | String | request currency |
get_trade_cap_history
Request mode
GET
example call
curl 'https://tokenlon-core-market.tokenlon.im/rest/get_trade_cap_history?currency=USD&beginTimestamp=1569456000&endTimestamp=1569542400'
Request Parameter
Name | Type | Mandatory | Description |
---|---|---|---|
beginTimestamp | Number | YES | Query begin Unix Timestamp, like 1568937600 |
endTimestamp | Number | YES | Query end Unix Timestamp |
currency | String | YES | "ETH", "USD", "CNY", "DAI" |
example result
{
"error": false,
"data": [
{
"date": "2019-09-27",
"period": "24H",
"vol": 706408.8389006486,
"txs": 367,
"wallet": 278,
"currency": "USD"
},
{
"date": "2019-09-26",
"period": "24H",
"vol": 337192.6146473213,
"txs": 345,
"wallet": 286,
"currency": "USD"
}
]
}
Request return
tradeCap[]
, array, order by date desc
Name | Type | Description |
---|---|---|
date | string | ticker date, like 2019-09-27 |
period | String | 24H |
vol | Number | total base trade vol within period |
txs | Number | total transactions within period |
wallet | Number | total wallets trade within period |
currency | String | request currency |
Supported tokens info
You should notice that EOS and ATOM are just virtual erc20 Token, we only support some other token to exchange EOS and ATOM, then we will transfer the true EOS / ATOM from EOS / COSMOS network to user's EOS account name / COSMOS address based on the amount trade on ethereum.
supported tokens
[{
"symbol": "ETH",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/eth%403x-2.png",
"contractAddress": "0x0000000000000000000000000000000000000000",
"info": "https://token-profile.token.im/token/ethereum?locale=en-US",
},
{
"symbol": "ZRX",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/exchange-pairs/ZRX.png",
"contractAddress": "0xe41d2489571d322189246dafa5ebde1f4699f498",
"info": "https://token-profile.token.im/token/0xe41d2489571d322189246dafa5ebde1f4699f498?locale=en-US",
},
{
"symbol": "DAI",
"logo": "https://v2-cdn.token.im/app-mainnet-production/exchange-pairs/DAI.png",
"contractAddress": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
"info": "https://token-profile.token.im/token/0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359?locale=en-US",
},
{
"symbol": "KNC",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/exchange-pairs/kyber.png",
"contractAddress": "0xdd974d5c2e2928dea5f71b9825b8b646686bd200",
"info": "https://token-profile.token.im/token/0xdd974d5c2e2928dea5f71b9825b8b646686bd200?locale=en-US",
},
{
"symbol": "OMG",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/omg.png",
"contractAddress": "0xd26114cd6ee289accf82350c8d8487fedb8a0c07",
"info": "https://token-profile.token.im/token/0xd26114cd6ee289accf82350c8d8487fedb8a0c07?locale=en-US",
},
{
"symbol": "SNT",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/snt.png",
"contractAddress": "0x744d70fdbe2ba4cf95131626614a1763df805b9e",
"info": "https://token-profile.token.im/token/0x744d70fdbe2ba4cf95131626614a1763df805b9e?locale=en-US",
},
{
"symbol": "MANA",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/mana%403x.png",
"contractAddress": "0x0f5d2fb29fb7d3cfee444a200298f468908cc942",
"info": "https://token-profile.token.im/token/0x0f5d2fb29fb7d3cfee444a200298f468908cc942?locale=en-US",
},
{
"symbol": "USDC",
"logo": "https://v2-cdn.token.im/app-mainnet-production/tokens/icons/a0b86991c621_1545531580.png",
"contractAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"info": "https://token-profile.token.im/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48?locale=en-US",
},
{
"symbol": "ELF",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/aelf%403x.png",
"contractAddress": "0xbf2179859fc6d5bee9bf9158632dc51678a4100e",
"info": "https://token-profile.token.im/token/0xbf2179859fc6d5bee9bf9158632dc51678a4100e?locale=en-US",
},
{
"symbol": "TUSD",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/tusd3x.png",
"contractAddress": "0x0000000000085d4780b73119b644ae5ecd22b376",
"info": "https://token-profile.token.im/token/0x0000000000085d4780b73119b644ae5ecd22b376?locale=en-US",
},
{
"symbol": "USDT",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/USDT.png",
"contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"info": "https://token-profile.token.im/token/0xdac17f958d2ee523a2206206994597c13d831ec7?locale=en-US",
},
{
"symbol": "PAX",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/pax.png",
"contractAddress": "0x8e870d67f660d95d5be530380d0ec0bd388289e1",
"info": "https://token-profile.token.im/token/0x8e870d67f660d95d5be530380d0ec0bd388289e1?locale=en-US",
},
{
"symbol": "USDX",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/USDX3.png",
"contractAddress": "0xeb269732ab75a6fd61ea60b06fe994cd32a83549",
"info": "https://token-profile.token.im/token/0xeb269732ab75a6fd61ea60b06fe994cd32a83549?locale=en-US",
},
{
"symbol": "LOOM",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/LOOM.png",
"contractAddress": "0xa4e8c3ec456107ea67d3075bf9e3df3a75823db0",
"info": "https://token-profile.token.im/token/0xa4e8c3ec456107ea67d3075bf9e3df3a75823db0?locale=en-US",
},
{
"symbol": "ENJ",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/ENJ.png",
"contractAddress": "0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c",
"info": "https://token-profile.token.im/token/0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c?locale=en-US",
},
{
"symbol": "MIX",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/MIX1.png",
"contractAddress": "0x5d285f735998f36631f678ff41fb56a10a4d0429",
"info": "https://token-profile.token.im/token/0x5d285f735998f36631f678ff41fb56a10a4d0429?locale=en-US",
},
{
"symbol": "HT",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/HT.png",
"contractAddress": "0x6f259637dcd74c767781e37bc6133cd6a68aa161",
"info": "https://token-profile.token.im/token/0x6f259637dcd74c767781e37bc6133cd6a68aa161?locale=en-US",
},
// warning, pls flow notice above
{
"symbol": "ATOM",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/icons/ATOM.png",
"info": "https://token-profile.token.im/token/cosmos?locale=en-US",
},
{
"symbol": "EOS",
"logo": "https://aws-v2-cdn.token.im/app-mainnet-production/tokens/upload/eosLogo%403x.png",
"info": "https://token-profile.token.im/token/eos?locale=en-US",
}]