Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda