GET /api
[id(string)] *id or contract required    The id of the asset on tokenlicious
[contract(string)] *contract or id required    The contract of the asset issued by its parent blockchain
[widget(bool)]     Endpoint for token(id) embed.
The 2 methods below return an array of data for the asset specified with [id/contract]
curl https://tokenlicious.com/api.php?id=[ENTER TOKENLICIOUS TOKEN ID]
curl https://tokenlicious.com/api.php?contract=[ENTER TOKEN CONTRACT]
<?php $url = "https://tokenlicious.com/api.php?id=36&widget=false"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); //for debug only! curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $resp = curl_exec($curl); curl_close($curl); var_dump($resp); ?>
var url = "https://tokenlicious.com/api.php?id=36&widget=false"; var xhr = new XMLHttpRequest(); xhr.open("GET", url); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { console.log(xhr.status); console.log(xhr.responseText); }}; xhr.send();
The 2 methods below will retrieve a widget for your website specified with [id/contract]
curl https://tokenlicious.com/api.php?id=[ENTER TOKENLICIOUS TOKEN ID]&widget=true
curl https://tokenlicious.com/api.php?contract=[ENTER TOKEN CONTRACT]&widget=true
The embed is easy just copy the code below, edit the id and contract of your token and place it on your website.
<embed type='text/html' src='https://tokenlicious.com/api.php?id=36&contract=0x7a364484303B38Bce7B0ab60a20DA8F2F4370129&widget=true' style='width:400px;height:300px;'>
The above code will output a widget just like this.
X