Authentication issues (.Net)

I’m running into an issue at the very start. I’m trying to access my account using the Alpaca NuGet Package, and it all seemed to be fine, building with no errors. The problem is that it’s not recognizing my account. The code is almost bone stock. I’ve tested switching the key position and have refreshed my keys, with no effect.

the error message is “Alpaca.Markets.RestClientErrorException: account not found for (account number)”

public async Task CheckAccount()

        var client = Environments.Paper.GetAlpacaTradingClient(new SecretKey(AlpacaKey,SAlpacaKey));

        var account = await client.GetAccountAsync();

        if (account.IsTradingBlocked)
            Console.WriteLine("Account is currently restricted from trading.");

        Console.WriteLine(account.BuyingPower + " is available as buying power.");


I’m sure it’s something glaringly obvious that I’m overlooking but I’d appreciate a bit of help. Is it the Alpaca NuGet? Should I switch to direct contact with the API without that middleman? Thanks in advance.

When you login into, you have to switch to paper account and get the api key from there. If you are already doing that, please ignore this.

1 Like

That was it and it was just as simple as I expected. Thanks for your help.