There are two ways to actually do this:
option 1: blockchain.info has an open API (REST + JSON) https://blockchain.info/it/api/blockchain_api here how: https://blockchain.info/it/rawaddr/$bitcoin_address bear in mind that you can only acquire info from an address that actually moved at least once some bitcoin on the network. If you just create a new wallet and do not transact then the public address is non existent on the blockchain (i.e. there's no difference between a newly generated address and a non existent address). That's the "shameful" approach as you are building a blockchain explorer using another blockchain explorer, see option 2 for the correct approach:
option 2: Run a bitcoin node on your own and query your stuff on it. You may not be able to run a node on a normal hosting, probably you need something more like an Amazon AWS instance or host on your own server