Tokens

Get ERC20-Token Account Balance for TokenContractAddress

Returns the current balance of an ERC-20 token of an address.

Sample request

https://api.thespectre.io/api
   ?module=token
   &action=tokenbalance
   &contractaddress=0x57d90b64a1a57749b0f932f1a3395792e12e7055
   &address=0xe04f27eb70e025b78871a2ad7eabe85e61212761
   &tag=0xde6cf2
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

contractaddress*

the contract address of the ERC-20 token

address*

the string representing the address to check for token balance

tag

the string pre-defined block parameter, either earliest, latest or block number in hex format, default value is latest

Sample response

{
    "status": "1",
    "message": "OK",
    "result": "135499"
}

Get Historical ERC20-Token TotalSupply by ContractAddress & BlockNo PRO

Returns the amount of an ERC-20 token in circulation at a certain block height.

Sample request

https://api.thespectre.io/api
   ?module=token
   &action=tokensupplyhistory
   &contractaddress=0x57d90b64a1a57749b0f932f1a3395792e12e7055
   &blockno=8000000
   &apikey=YourApiKeyToken 

Request query parameters

ParameterDescription

contractaddress*

the contract address of the ERC-20 token

blockno*

the integer block number to check total supply

Sample response

{
    "status": "1",
    "message": "OK",
    "result": "21265524714464"
}

Get Historical ERC20-Token Account Balance for TokenContractAddress by BlockNo PRO

Returns the balance of an ERC-20 token of an address at a certain block height.

Sample request

https://api.thespectre.io/api
   ?module=token
   &action=tokenbalancehistory
   &contractaddress=0x57d90b64a1a57749b0f932f1a3395792e12e7055
   &address=0xe04f27eb70e025b78871a2ad7eabe85e61212761
   &blockno=8000000
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

contractaddress*

the contract address of the ERC-20 token

address*

the string representing the address to check for balance

blockno*

the integer block number to check total supply

Sample response

{
    "status": "1",
    "message": "OK",
    "result": "135499"
}

Get Token Holder List by Contract Address PRO

Return the current ERC20 token holders and number of tokens held.

Sample request

https://api.thespectre.io/api
   ?module=token
   &action=tokenholderlist
   &contractaddress=0xaaaebe6fe48e54f431b0c390cfaf0b017d09d42d
   &offset=0
   &limit=10
   &sort=asc
   &apikey=YourApiKeyToken 

Request query parameters

ParameterDescription

contractaddress*

the contract address of the ERC-20 token

offset

skips the offset records before beginning to return the records, default value is 0

limit

the number of records displayed per page, default value is 10000

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending, default value is asc

Sample response

{
    "status": "1",
    "message": "OK",
    "result": [
        {
            "TokenHolderAddress": "0x0000000000000d9054f605ca65a2647c2b521422",
            "TokenHolderQuantity": "10000000"
        },
        {
            "TokenHolderAddress": "0x0000000000000000000000000000000000000000",
            "TokenHolderQuantity": "34956"
        },
        {
            "TokenHolderAddress": "0x000000000000084e91743124a982076c59f10084",
            "TokenHolderQuantity": "1"
        }
    ]
}

Get Token Info by ContractAddress PRO

Returns project information and social media links of an ERC20/ERC721/ERC1155 token.

Sample request

https://api.thespectre.io/api
   ?module=token
   &action=tokeninfo
   &contractaddress=0xdac17f958d2ee523a2206206994597c13d831ec7
   &apikey=YourApiKeyToken 

Request query parameters

ParameterDescription

contractaddress*

the contract address of the ERC-20/ERC-721 token to retrieve token info

Sample response

{
    "status":"1",
    "message":"OK",
    "result":[
        {
            "circulatingMarketCapUSD": "83535944312.996231",
            "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "divisor": "6",
            "holders": "4543145",
            "holdersChangePercent": "0.036765",
            "priceChangePercent": "-0.010285",
            "symbol": "USDT",
            "tokenName": "Tether USD",
            "tokenPriceUSD": "1.000193",
            "tokenType": "ERC20",
            "totalSupply": "39024700485595726",
            "transfers": "208569273",
            "volumeUSD": "18641246057.291306"
        }
    ]
}

Get Token List PRO

Returns a list of tokens (ERC-20, ERC-721).

Sample request

https://api.thespectre.io/api
   ?module=token
   &action=tokenlist
   &marketonly=true
   &type=erc20
   &sortby=circulating_market_cap
   &offset=0
   &limit=10
   &sort=asc
   &apikey=YourApiKeyToken 

Request query parameters

ParameterDescription

marketonly

the boolean flag, false to include all tokens, true to include only those tokens that have market data, default value is true

type

the string representing the token type, either erc20, erc721 or erc1155

sortby

the sorting preference, either holders, price, change, circulating_market_cap or volume

offset

skips the offset records before beginning to return the records, default value is 0

limit

the number of records displayed per page, default value is 10000

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending, default value is asc

Sample response

{
    "status": "1",
    "message": "OK",
    "result": [
        {
            "circulatingMarketCapUSD": "83535944312.996231",
            "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
            "divisor": "6",
            "holders": "4543145",
            "holdersChangePercent": "0.036765",
            "priceChangePercent": "-0.010285",
            "symbol": "USDT",
            "tokenName": "Tether USD",
            "tokenPriceUSD": "1.000193",
            "tokenType": "ERC20",
            "totalSupply": "39024700485595726",
            "transfers": "208569273",
            "volumeUSD": "18641246057.291306"
        }
    ]
}

Get the total number of tokens PRO

Returns the total number of tokens for a given token type.

Sample request

https://api.thespectre.io/api
   ?module=token
   &action=tokencount
   &marketonly=false
   &type=erc20
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

marketonly

the boolean flag, false to include all tokens, true to include only those tokens that have market data, default value is true

type

the string representing the token type, either erc20, erc721 or erc1155

Sample response

{
    "status": "1",
    "message": "OK",
    "result": "826"
}

Get Address ERC20 Token Holding PRO

Returns the ERC-20 tokens and amount held by an address.

Sample request

https://api.thespectre.io/api
   ?module=token
   &action=addresstokenbalance
   &address=0x983e3660c0bE01991785F80f266A84B911ab59b0
   &offset=0
   &limit=10
   &sort=desc
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

address*

the string representing the address to check for balance

offset

skips the offset records before beginning to return the records, default value is 0

limit

the number of records displayed per page, default value is 10000

sort

the sorting preference by amount of tokens in usd, use asc to sort by ascending and desc to sort by descending, default value is asc

Sample response

{
    "status":"1",
    "message":"OK",
    "result":[
        {
            "TokenAddress": "0xffffffff2ba8f66d4e51811c5190992176930278",
            "TokenName": "Furucombo",
            "TokenSymbol": "COMBO",
            "TokenQuantity": "1861606940000000000",
            "TokenDivisor": "18",
            "TokenPriceUSD": "0.002999"
        },
        {
            "TokenAddress": "0xb753428af26e81097e7fd17f40c88aaa3e04902c",
            "TokenName": "Spice",
            "TokenSymbol": "SFI",
            "TokenQuantity": "7",
            "TokenDivisor": "18",
            "TokenPriceUSD": null
        }
    ]
}

Get the number of ERC20 holding tokens PRO

Returns the number of ERC-20 holding tokens by an address.

Sample request

https://api.thespectre.io/api
   ?module=token
   &action=addresstokencount
   &address=0x983e3660c0bE01991785F80f266A84B911ab59b0
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

address*

the string representing the address

Sample response

{
    "status":"1",
    "message":"OK",
    "result": "7"
}

Get a list of 'ERC20 - Token Transfer Events' PRO

Returns the list of ERC-20 token transfers.

Sample request

https://api.thespectre.io/api
   ?module=token
   &action=tokentx
   &startblock=0
   &endblock=1000
   &offset=0
   &limit=10
   &sort=asc
   &apikey=YourApiKeyToken

Request query parameters

ParameterDescription

startblock

the integer block number to start searching for transactions

endblock

the integer block number to stop searching for transactions

offset

skips the offset records before beginning to return the records, default value is 0

limit

the number of records displayed per page, default value is 10000

sort

the sorting preference, use asc to sort by ascending and desc to sort by descending, default value is asc

Sample response

{
    "status":"1",
    "message":"OK",
    "result":[
        {
            "blockNumber":"4730207",
            "index": 0,
            "timeStamp":"1513240363",
            "hash":"0xe8c208398bd5ae8e4c237658580db56a2a94dfa0ca382c99b776fa6e7d31d5b4",
            "nonce":"406",
            "blockHash":"0x022c5e6a3d2487a8ccf8946a2ffb74938bf8e5c8a3f6d91b41c56378a96b5c37",
            "from":"0x642ae78fafbb8032da552d619ad43f1d81e4dd7c",
            "contractAddress":"0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
            "to":"0x4e83362442b8d1bec281594cea3050c8eb01311c",
            "value":"5901522149285533025181",
            "tokenName":"Maker",
            "tokenSymbol":"MKR",
            "tokenDecimal":"18",
            "tokenPriceUSD": "1123.78",
            "transactionIndex":"81",
            "gas":"940000",
            "gasPrice":"32010000000",
            "gasUsed":"77759",
            "cumulativeGasUsed":"2523379",
            "input":"deprecated",
            "confirmations":"7968350"
        },
        {
            "blockNumber":"4764973",
            "index": 0,
            "timeStamp":"1513764636",
            "hash":"0x9c82e89b7f6a4405d11c361adb6d808d27bcd9db3b04b3fb3bc05d182bbc5d6f",
            "nonce":"428",
            "blockHash":"0x87a4d04a6d8fce7a149e9dc528b88dc0c781a87456910c42984bdc15930a2cac",
            "from":"0x4e83362442b8d1bec281594cea3050c8eb01311c",
            "contractAddress":"0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
            "to":"0x69076e44a9c70a67d5b79d95795aba299083c275",
            "value":"132520488141080",
            "tokenName":"Maker",
            "tokenSymbol":"MKR",
            "tokenDecimal":"18",
            "tokenPriceUSD": "1123.78",
            "transactionIndex":"167",
            "gas":"940000",
            "gasPrice":"35828000000",
            "gasUsed":"127593",
            "cumulativeGasUsed":"6315818",
            "input":"deprecated",
            "confirmations":"7933584"
        }
    ]
}

Get the total number of token transactions PRO

Returns the total number of token transactions.

Sample request

https://api.thespectre.io/api
   ?module=token
   &action=tokentxcount
   &apikey=YourApiKeyToken

Sample response

{
    "status": "1",
    "message": "OK",
    "result": "7431297"
}

Last updated