Closed herzo175 closed 5 years ago
Make sure you are using the right API key. The error appears when you use paper API key with live endpoint.
I think I am using the correct API key. I only have a paper trading account and I was using that endpoint. On a related note, when I tried to call SetBaseUrl, I got a message saying that method was undefined (it appears in the code though), but I worked around it by setting the environment variable "APCA_API_BASE_URL" to the paper trading endpoint.
Right. So if your API key has prefix "PK", that is your paper trading API key and it won't work for live trading endpoint which is the default unless you set APCA_API_BASE_URL environment variable.
That makes sense, but I'm still confused why I'm getting an error saying SetBaseUrl is undefined:
apca.SetBaseUrl("https://paper-api.alpaca.markets")
alpacaClient := apca.NewClient(common.Credentials())
acct, err := alpacaClient.GetAccount()
if err != nil {
panic(err)
}
log.Println(acct)
service/alpaca.go:53:2: undefined: alpaca.SetBaseUrl
Someone just told that we are missing release tag so you need to explicitly set go.mod to master to use the latest
Yeah, I just saw that and it fixed the issue. Thanks for your help!
Hi,
I was calling client.GetAccount() and I get an error saying "account not found for (my account id)". I'm wondering if this endpoint is working properly - When I make a request to "https://paper-api.alpaca.markets/v1/account", I can successfully get my account information
Thanks