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

196
Views
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
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!