Tokens

Retrieve information about tokens supported by Totle.

get
/tokens

https://api.totle.com/tokens
This endpoint returns a map of token names to contract addresses.
Request
Response
Request
Response
200: OK
Token information was successfully retrieved.
{
"tokens": [{
"name": "Name of Coin",
"symbol": "COINSYMBOL",
"address": "0x...372",
"decimals": 18,
"tradable": true
}]
}

Response Parameter

Description

tokens

The list of known ERC-20 tokens

name

The long name of the token

symbol

The ticker symbol of the token

address

The contract address that should be used to identify the token in API calls

decimals

The number of decimal places implemented by the tokens

tradeable

Whether the token can be traded on Totle

cURL
Node
Ruby
JavaScript
Python
cURL
curl --request GET \
--url https://api.totle.com/tokens
Node
var request = require("request");
var options = {method: 'GET', url: 'https://api.totle.com/tokens'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Ruby
require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://api.totle.com/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
JavaScript
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.totle.com/tokens");
xhr.send(data);
Python
import requests
url = "https://api.totle.com/tokens"
response = requests.request("GET", url)
print(response.text)