Is there an api where I can query if an address contains an erc20 token? I need it returned in JSON format.
1 Answer
Slightly different to what you asked... (in that in the below we're querying an ERC-20 token contract to see if it contains a balance for a specific address).
The following API will allow you to query an ERC-20 token contract (at a given address) for the balance associated with a particular account address.
From https://etherscan.io/apis#tokens:
https://api.etherscan.io/api?module=account&action=tokenbalance&contractaddress=<contract_address>&address=<address_to_query>&tag=latest&apikey=YourApiKeyToken
(It works without specifying an API key, but might be rate limited.)