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

197
Vistas
when using node-fetch i am not getting the data that's returned by an API when i use a variable but if i hardcode it then it works

if I go to the link used in the fetch then there is data but as you can see in the screenshot it logs an object with an empty sales array if I hardcode the link then the information is returned correctly

the res variable is an object returned by an event listener and isn't the problem

const { transactionHash } = res;
console.log(transactionHash);

const url = `https://api.reservoir.tools/sales/v3?txHash=${transactionHash}`;
console.log(url);

fetch(url, {
    method: 'GET',
    headers: { Accept: '*/*', 'x-api-key': '' },
})
    .then((response) => response.json())
    .then((response) => console.log(response))
    .catch((err) => console.error(err));

edit: when I use

const url = `https://api.reservoir.tools/sales/v3?txHash=${transactionHash}`;

then the fetch returns an empty sales array but if I hardcode the hash directly onto the link like this then it returns data inside the sales array (0x33a2907d being the hash for demonstration)

const url = `https://api.reservoir.tools/sales/v3?txHash=0x33a2907d`;
about 4 years ago · Santiago Trujillo
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