Getting Staking holdings

I want to check the holdings of stakings and its rewards of a particular delegator programatically. How can I get its api or rpc method to interact