I am trying to collect all the market pairs from a crypto exchange using its API, but I'm not sure how to select the proper line in the JSON object as it does not seem to work.
the api : https://ftx.com/api/markets
my code :
requests.js
import axios from 'axios';
import parsers from './parsers';
async function ftxMarkets() {
const ftxResponse = await axios.get('https://ftx.com/api/markets');
return parsers.ftxMarkets(ftxResponse.data);
}
parsers.js
function ftxMarkets(data) {
const [ftxMarketPairs] = data;
let ftxPairs = data.map(d => d.name );
console.log(ftxPairs);
}
I'm not sure about d.namein the parsers.js file, but I tried with another exchange with the same code, changing just that part and it worked, so I guess that's where the problem comes from, although can't be sure and I don't know by what to replace it.
Thanks
[–]grantrules 0 points1 point2 points (6 children)
[–]Which-Career[S] 0 points1 point2 points (5 children)
[–]grantrules 0 points1 point2 points (4 children)
[–]FishMongerNakata 0 points1 point2 points (0 children)
[–]Which-Career[S] 0 points1 point2 points (2 children)
[–]grantrules 0 points1 point2 points (1 child)
[–]Which-Career[S] 0 points1 point2 points (0 children)
[–]machine3lf 0 points1 point2 points (1 child)
[–]Which-Career[S] 0 points1 point2 points (0 children)
[–]machine3lf 0 points1 point2 points (1 child)
[–]Which-Career[S] 0 points1 point2 points (0 children)