I'm trying to just get the SOL balance, but I get returned a full list of tokens.


I'm using solscan public api's. But should I be using something else to get SOL balance of an address?


2 Answers 2


You can use Solana JSON RPC API by calling getBalance request example

Or @solana/web3.js using connection.getBalance example

  • i want to do it without installing a library. mainly want to just fetch this info from an REST api call using curl. Aug 25, 2022 at 15:57
  • Yeah already told you the way to do it. You can use Solana JSON RPC API by calling getBalance request example :)
    – vicyyn
    Aug 25, 2022 at 19:20
  • curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d ' {"jsonrpc":"2.0", "id":1, "method":"getBalance", "params":["83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"]} '
    – vicyyn
    Aug 25, 2022 at 19:20
  • I'm trying to do it with: public-api.solscan.io --- i don't want to install anything on my server or local. Aug 29, 2022 at 16:01

You can use Shyft's get_balance REST API, to get the sol balance of any account address on Solana:


Here is the link to the documentation: https://docs.shyft.to/start-hacking/wallet#get-balance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.