If you are using cli_wallet JSON-RPC then fetch "info" and calculate VESTS like this:
total_vesting_shares / total_vesting_fund_steem * desired_steem_power
Similar with steemd RPC, call get_state with an empty string as parameter:
>>> get_state ""
Nice tip :)