Difference in balance in my wallet and in btc explorer I am coding a website to get BTC balance from explorer using the following url:

https://blockexplorer.com/api/addr/3CyZgGhkhE3z2WY8E5ztPMRYCDdg1hdD7g/balance


The problem is that the balance appeared using this url (explorer) is totally different from what in my wallet (nicehash).

Explorer balance for this address: 0.00946525 BTC

Wallet balance for this address: 0.01642334 BTC


What is the cause of this? and how to show the real balance in explorer exactly as in wallet?
The 3CyZ... address has a balance of 0.00946525 BTC, so it appears that your nicehash wallets includes some other addresses as well.

In general, a bitcoin wallet will include a collection of addresses: the more you use the wallet the more addresses it will generate. Best practices include only using each receiving address once (if you search 'address reuse' you'll find the reasoning behind this), so every time you send or receive a transaction the number of addresses you wallet controls will increase.  

So to get an accurate account of your wallet balance, you'll need to sum the balance of all of the addresses the wallet controls, not just the 3CyZ.. address.