Skip to content

Instantly share code, notes, and snippets.

@TrevorJTClarke
Created April 2, 2019 20:28
Show Gist options
  • Select an option

  • Save TrevorJTClarke/28d13052ef3b4e39c309b3758863c179 to your computer and use it in GitHub Desktop.

Select an option

Save TrevorJTClarke/28d13052ef3b4e39c309b3758863c179 to your computer and use it in GitHub Desktop.

Revisions

  1. TrevorJTClarke created this gist Apr 2, 2019.
    25 changes: 25 additions & 0 deletions address-tokens.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    axios({
    method:'get',
    url: 'https://web3api.io/api/v1/addresses/ETHEREUM_ADDRESS_HERE/tokens',
    headers: { 'x-api-key': 'YOUR_API_KEY_HERE' }
    }).then(res => {
    // res data example:
    // {
    // "totalRecords": "738",
    // "records": [
    // {
    // "address": "0xa15c7ebe1f07caf6bff097d8a589fb8ac49ae5b3",
    // "holder": "0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be",
    // "amount": "6157812419233621583467281207",
    // "decimals": "18",
    // "name": "Pundi X Token",
    // "symbol": "NPXS",
    // "isERC20": true,
    // "isERC721": false,
    // "isERC777": false,
    // "isERC884": false,
    // "isERC998": false
    // }
    // ]
    // }
    })