I using MyMonero wallet.
atm there is no way to query the balance when using mymonero.
if you run your own daemon and simplewallet you get a rpc api which you can use like this...
curl -X POST http://127.0.0.1:18500/json_rpc -d '{"jsonrpc":"2.0","method":"get_bulk_payments","id":"test", "params":{"payment_ids": ["666c75666679706f6e7920697320746865206265737420706f6e792065766572"]}}' -H "Content-Type: application/json"
...to get a list of all received payments (in this case filtered for a specific payment id).
simplewallet has an option which will disable all rpc commands which may be used to send money. so you can run it on another machine if you want to.
Bad, very bad. I think i cant write python or php script for this. I'ill wait coinpayments.com support XMR. :/