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

167
Views
How to get data after "response.data" of API

I don't know what the right code is to get all the data of the API after response.data. I use the API by ethermine. Here's my code:

global.etherminepool = `https://api.ethermine.org/poolStats`;
axios.get(etherminepool)
.then(function(response) {
  // handle success
  
  console.log(response.data); // I tried "response.data.price.eur". Do I have to use () or []?

})
.catch(function (error) {
  // handle error
  console.log(error);
})
.then(function () {
  // always executed
});

When I tried response.data.price.eur the error is: TypeError: Cannot read property 'eur' of undefined. Also response.data.price didn't work. The response of response.data is:

{
  status: 'OK',
  data: {
    topMiners: [],       
    minedBlocks: [       
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object]
    ],
    poolStats: {
      hashRate: 180365172843161.53,
      miners: 320965,
      workers: 980198,
      blocksPerHour: 68.92
    },
    price: {
      time: '2021-10-10T10:09:56.000Z',
      usd: 3580.5,
      btc: 0.0650543794,
      eur: 3094.580078125,
      cny: 23070,
      rub: 257127
    },
    estimates: {
      time: '2021-10-10T10:09:56.000Z',
      blockReward: 2.1481,
      hashrate: 695958780441595,
      blockTime: 13.5318,
      gasPrice: 59.0492384812
    }
  }
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As @J_K sayed the correct way was "response.data.data.price.eur"

about 4 years ago · Juan Pablo Isaza Report
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!