alpacar is an R package wrapper for the Alpaca API.
API documentation can be found here.
The functionality for this package is covered in a series of blog posts:
Load
Once installed you can load the package. I also like to increase the number of significant figures in tibble
output (completely optional).
Authenticate
I store my credentials in environment variables. Specifically I use a .env
file in my project directory.
library(dotenv)
load_dot_env()
authenticate(
key = Sys.getenv("ALPACA_KEY"),
secret = Sys.getenv("ALPACA_SECRET_KEY")
)