Unable to make a GET request to vapi/v1/account

There’s no category for VAPI, so I choose Spot/Margin.

I am trying to retrieve my account data. As stated in the Binance docs, what I’m looking for is located at: /vapi/v1/account

Unfortunately, after lots of messing around, trial/error & googling, I am still unable to make the request. Final message that I’m getting now is: “You are not authorized to execute this request.”

Posting my code below, hoping someone can lead me in the right direction.

const timestamp = Date.now().toString()
const signature = createHmac('sha256', process.env.BINANCE_API_SECRET!)
  .update(`timestamp=${timestamp}`)
  .digest('hex')

const queryParams = new URLSearchParams({
  timestamp,
  signature,
})

const data = await fetch(
  `https://vapi.binance.com/vapi/v1/account?${queryParams}`,
  {
    method: 'GET',
    headers: {
      'X-MBX-APIKEY': process.env.BINANCE_API_KEY!,
    },
  },
).then((res) => res.json())

console.log(data)

please check if you have:

  • enable vanilla option from UI.
  • tick the permission of “Enable Vanilla Options”

Hey, thank you for your response.
I did this yesterday and it lead to another error that I couldn’t figure out either, so I unchecked the option.

Checked it again, ran the function and error is this:
“Option user does not exist”

Looks like I’m using the wrong api. I need a way to check my SPOT wallet. I’d like to get in response my balance and yesterday’s PNL.

So I thought the vanilla api is the right one, but seems like there’s Vanilla Options trading, which I do not use.