Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
Binance Futures API: Signature is not valid

I'm currently developing a trading bot for fun, but when I want to send a POST request with axios I get following error as a response: {code: -1022, msg: 'Signature for this request is not valid.'}

I use the node.js crypto package to create a hmac sha256 hash like mentionend in the binance api docs and in every other tutorial i've seen.

I also already created a new API, so my key & secret is correct!

Here's the code:

let querystring = `symbol=LTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=0.05&price=${price}&recvWindow=5000&timestamp=${new Date().getTime()}`;
            let signature = crypto
                .createHmac('sha256', credentials.secret)
                .update(querystring)
                .digest('hex');

            axios
                .post(
                    `https://fapi.binance.com/fapi/v1/order?${querystring}&signature=${signature}`,
                    {},
                    {
                        headers: {
                            'X-MBX-APIKEY': credentials.key,
                            'content-type': 'application/x-www-form-urlencoded',
                        },
                    }
                )
                .then((response) => {
                    console.log(response.data);
                    resolve(response);
                })
                .catch(function (error) {
                    if (error.response) {
                        // Request made and server responded
                        console.log(error.response.data);
                        console.log(error.response.status);
                        console.log(error.response.headers);
                    } else if (error.request) {
                        // The request was made but no response was received
                        console.log(error.request);
                    } else {
                        // Something happened in setting up the request that triggered an Error
                        console.log('Error', error.message);
                    }
                });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!