Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

tokenbalance

> 编程语言
Open source

Simple Ethereum API to get your ERC20 Token Balance along with useful information

189 stars0 likes0 views
WebsiteGitHub

About

Simple Ethereum API to get your ERC20 Token Balance along with useful information

TokenBalance API

TokenBalance is an easy to use public API and application that will output your ERC20 Token balance without any troubles. You can run TokenBalance on your local computer or you can use api.tokenbalance.com to easily parse your erc20 token balances. Connects to your local geth IPC and prints out a simple JSON response for ethereum token balances. Runs on port 8080 by default if you wish to run locally.

Server Status and Uptime

You can view the current status of Token Balance along with API latency information on our status page. This status page logs the Ethereum Mainnet, Ropsten testnet, and Rinkeby testnet.

https://status.tokenbalance.com

Installing Token Balance

You don't need to compile Token Balance from source anymore! All you need to do is go to Releases in this repo and download the binary that is built for your OS. Once you've downloaded, rename the file to tokenbalance for ease if use. On Mac or Linux move this file with the command mv tokenbalance /usr/local/bin/tokenbalance, you should be able to run the application from anywhere now.

Token Balance and Token Info (/token)

To fetch information about your balance, token details, and ETH balance use the follow API call in a simple HTTP GET or CURL. The response is in JSON so you can easily parse what you need. Replace TOKEN_ADDRESS with the contract address of the ERC20 token, and replace ETH_ADDRESS with your address.

Ethereum Mainnet
bash
https://api.tokenbalance.com/token/TOKEN_ADDRESS/ETH_ADDRESS
Ethereum Ropsten Testnet
bash
https://test.tokenbalance.com/token/TOKEN_ADDRESS/ETH_ADDRESS
Ethereum Rinkeby Testnet
bash
https://rinkeby.tokenbalance.com/token/TOKEN_ADDRESS/ETH_ADDRESS
  • Response (JSON)
bash
{
    "name": "Kin",
    "wallet": "0x393c82c7Ae55B48775f4eCcd2523450d291f2418",
    "symbol": "KIN",
    "decimals": 18,
    "balance": "15788648",
    "eth_balance": "0.217960852347180212",
    "block": 4274167
}

Only Token Balance (/balance)

This API response will only show you the ERC20 token balance in plain text. Perfect for ultra simple parsing.

bash
https://api.tokenbalance.com/balance/TOKEN_ADDRESS/ETH_ADDRESS
  • Response (PLAIN TEXT)
bash
1022.503000

Examples

  • jsFiddle AJAX Example
  • Fetch Balance and Token Details for Status Coin
  • Fetch Balance and Token Details for Gnosis
  • Fetch Balance and Token Details for Storj
  • Only Token Balance for Augur
  • Only Token Balance for Golem

Run with Docker

You can easily start Token Balance with Docker. Register for a free Infura.io API Key to use Token Balance without downloading the ethereum blockchain.

bash
docker run -p 8080:8080 -e GETH_SERVER=https://mainnet.infura.io/APIKEY -d hunterlong/tokenbalance

Use as Golang Package

You can use Token Balance as a typical Go Language package if you you like to implement ERC20 functionality into your own application.

bash
go get github.com/hunterlong/tokenbalance
First you'll want to connect to your Geth server or IPC
…

Implement in Google Sheets

If your familiar with Google Sheets, you can easily fetch all of your cryptocurrency balances within 1 spreadsheet. All you need to do is make a cell with the value below.

=ImportData("https://api.tokenbalance.com/balance/0xd26114cd6EE289AccF82350c8d8487fedB8A0C07/0xf9578adc61d07671f536d50afc5800232fc9fd86")

Simple as that! Get creative an use Coin Market Cap's API to fetch the price and multiply with your balance to make a portfolio of your cryptocurrencies!

Implement in your App

Feel free to use the TokenBalance API server to fetch ERC20 token balances and details. We do have a header set that will allow you to call the API via AJAX. Access-Control-Allow-Origin "*" The server may limit your requests if you do more than 60 hits per minute.

Run Your Own Server

TokenBalance isn't just an API, it's an opensource HTTP server that you can run on your own computer or server.

Installation

Ubuntu 16.04
bash
git clone https://github.com/hunterlong/tokenbalance
cd tokenbalance
go get && go build ./cmd

Start TokenBalance Server

bash
tokenbalance start --geth="/ethereum/geth.ipc"

This will create a light weight HTTP server will respond balance information about a ethereum contract token.

Optional Config

bash
tokenbalance start --geth="/ethereum/geth.ipc" --port 8080 --ip 127.0.0.1

CURL Request

bash
CONTRACT=0xa74476443119A942dE498590Fe1f2454d7D4aC0d
ETH_ADDRESS=0xda0aed568d9a2dbdcbafc1576fedc633d28eee9a

curl https://api.tokenbalance.com/token/$CONTRACT/$ETH_ADDRESS

Response

bash
{
    "name": "Kin",
    "wallet": "0x393c82c7Ae55B48775f4eCcd2523450d291f2418",
    "symbol": "KIN",
    "decimals": 18,
    "balance": "15788648",
    "eth_balance": "0.217960852347180212",
    "block": 4274167
}

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gocryptocurrencyerc20ethereumethereum-contract

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言