node.jsapibitcoiniota

how to get iota balance via api url?


I've searched for few days... to get IOTA Coin balance via api call directly.

They provided us a documentation for that:- https://iota.readme.io/reference#getbalances


Solution

  • Well, not sure what you expect here, either run your own node (thus, the localhost reference in the docs) or call a public one...

    $ curl -s http://iota.bitfinex.com \
      -X POST \
      -H 'Content-Type: application/json' \
      -H 'X-IOTA-API-Version: 1' \
      -d '{"command": "getBalances", "addresses": ["HBBYKAKTILIPVUKFOTSLHGENPTXYBNKXZFQFR9VQFWNBMTQNRVOUKPVPRNBSZVVILMAFBKOTBLGLWLOHQ"], "threshold": 100}' \
      | jq
    
    
    {
      "balances": [
        "0"
      ],
      "references": [
        "BTJRZDCMYEEQBMGKIGZFDFHQWIWTX9UYUFEOLYIHVVWM9HYRZPOZCKRQFNYDLNGTT9KZHGUTGNSNZ9999"
      ],
      "milestoneIndex": 328554,
      "duration": 160
    }