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

156
Views
Cómo obtener datos después de "response.data" de API

No sé cuál es el código correcto para obtener todos los datos de la API después de response.data . Yo uso la API de ethermine. Aquí está mi código:

 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 });

Cuando probé response.data.price.eur el error es: TypeError: Cannot read property 'eur' of undefined . Además, response.data.price no funcionó. La respuesta de response.data es:

 { 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

Como dijo @J_K, la forma correcta era "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!