I'm trying to get SHIB balance with ethplorer API how can I get it?
This is what I've done but I have an error 104 address format error
fetch("https://api.ethplorer.io/getAddressInfo/0x27cbc493b894e35f3f34ab273d0d634550af025d?apiKey=api_key&token=SHIB").then((response)=>{
console.log(response.json());
}).catch( e => console.log(e));
The Ethplorer API getAddressInfo
endpoint (docs) doesn't support the token
query param.
And yes, the error message is a bit unfortunate. It seems the error message is not really related to the input address format - rather than to the incorrect query param.
But! If you pass the un-checksumed address (as you did in the question), it only returns the ETH info and doesn't return the tokens
array. So you need to pass the checksumed address (see below) to get the token info as well. You can then filter out the tokens that you're looking for in your JS script.
https://api.ethplorer.io/getAddressInfo/0x4C0fBE1BB46612915E7967d2C3213cd4d87257AD?apiKey=<your_api_key>