You can use eosjs to solve this.
According to the documentation here: https://developers.eos.io/manuals/eosjs/latest/how-to-guides/how-to-stake
You can stake for resources. The example below is staking for NET and CPU for the user "mynewaccount" in the name of "useraaaaaaaa". I assume if you provide the "stake_ram_quantity" it ...
First of all: Never publish your private key, don't make it public, don't paste it to any api's or so, the only place to paste it is your wallet.
Assuming you are speaking about the public key of a specific account, there's the get_accounts_by_authorizers-endpoint provided by the chain-api.
Note that it's only available if enable-account-queries is set to ...
There is a command line example that can be found here. A team of community members created a JS library that is worth checking out.
As for auto-powering up an account that is a feature that was requested and is being evaluated.