To use getrawtransaction to lookup any transaction, you have to have the -txindex flag set, so that all transactions are indexed. But, you have to know the txid.
getrawtransaction "txid" ( verbose "blockhash" )
NOTE: By default this function only works for mempool transactions. If the -txindex option is
enabled, it also works for blockchain transactions. If the block which contains the transaction
is known, its hash can be provided even for nodes without -txindex. Note that if a blockhash is
provided, only that block will be searched and if the transaction is in the mempool or other
blocks, or if this node does not have the given block available, the transaction will not be found.
I would recommend using an api such as blockchain.info
Single Address
https://blockchain.info/rawaddr/$bitcoin_address
Address can be base58 or hash160
Optional limit parameter to show n transactions e.g. &limit=50 (Default: 50, Max: 50)
- Optional offset parameter to skip the first n transactions e.g. &offset=100 (Page 2 for limit 50)
{
"hash160":"660d4ef3a743e3e696ad990364e555c271ad504b",
"address":"1AJbsFZ64EpEfS5UAjAfcUG8pH8Jn3rn1F",
"n_tx":17,
"n_unredeemed":2,
"total_received":1031350000,
"total_sent":931250000,
"final_balance":100100000,
"txs":[--Array of Transactions--]
}
What you want is in the txs property of the returned json object.