How to use Rest Api?

I want to use XYM Rest API to get a balance of any address … from where I can get that api link and Endpoints for that !

The following documentation shows you all available API endpoints: Endpoints - Symbol Developers
More information on how to use the API: REST Gateway — Symbol Documentation

You can send requests to all available API nodes (have a look at the nodes section in the Symbol Block Explorer to see available nodes).

So for example to get information on a specific account you’d send a request to a node of your choosing like this:


NDS2WNRTH53LIVX43ZSAQQDVALZJBJTMKERJSD : this is my address and not getting any responce on this .

It looks like your address has a wrong format. Is there a missing character?

To elaborate a bit on this… I’ve noticed that all responses from the API encode the resulting address in a format that isn’t desktop wallet friendly…

I.e. the response from is:

How can one translate the address value ‘68258605CB5ABC592FE691190202CDFD6DDEE659A6BB30B8’ back to ‘NASYMBOLLK6FSL7GSEMQEAWN7VW55ZSZU25TBOA’?

Quick follow-up… I bolded the account balance output from the example provided by @thomasoehri - note that it is in satoshis (divide by 1,000,000 to get user-friendly balance) –

Also build functions in python (3.7.6) to convert between hex and base32 addresses (i.e. ‘68258605CB5ABC592FE691190202CDFD6DDEE659A6BB30B8’ to ‘NASYMBOLLK6FSL7GSEMQEAWN7VW55ZSZU25TBOA’)

import base64

def hexToAddress(hexKey):
    return base64.b32encode(bytes.fromhex(hexKey)).decode("utf-8").replace("=","")

def addresstoHex(address):
    return bytes.hex(base64.b32decode(address))
1 Like

It is strongly suggested NOT to use REST layer directly.
Please consider using TS sdk instead.

(well, depends if you’re developing something or if it’s just for your own needs).