1import alpaca_trade_api as tradeapi
2
3# authentication and connection details
4api_key = 'Insert_your_api_key_here'
5api_secret = 'Insert_your_api_secret_here'
6base_url = 'https://paper-api.alpaca.markets'
7
8# instantiate REST API
9api = tradeapi.REST(api_key, api_secret, base_url, api_version='v2')
10
11# obtain account information
12account = api.get_account()
13print(account)