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

164
Views
Call a specific array in a JSON API call

I'm trying to call the API but it doesn't return me anything. I'm calling it like: res.on('data', d => { const RetrieveFromApi = JSON.parse(d).FLUX.quote.USD.price;.

The API is successfully called since I can see it in the API history, and data is defined as d.

API Call

Can you help me please?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

from your screen provided in comment, you passed one property you don't access to it which is data So just add property data before FLUX

JSON.parse(d).FLUX.quote.USD.price;
             ^data.FLUX.quote.USD.price;
about 4 years ago · Juan Pablo Isaza Report

0

From the image of the log the object seems incomplete at the end, did you try to use JSON.stringify(d) to see if there are any errors on the json object? or copy the response on https://jsonlint.com to check?

Because the error message points that the parse doesn't find a valid json object, maybe that is the whole point.

And the other tip is to try to store the value of JSON.parse in an variable before trying to access his values.

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!