How get informations in javascript from API JSON?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







-3















I need help ! Can you tell me how can I get informations from this in javascript :
I would like to get the Third values from the fisrt array (121,73) and also the Fourth (99,25) . Thank you in advance !





{    
"error": ,
"result": {
"XETHZEUR": [
[
1545955200,
"100.76",
"121.73",
"99.25",
"120.16",
"111.15",
"186385.05723331",
25420
],
[
1546041600,
"120.52",
"130.00",
"115.91",
"117.89",
"121.47",
"154551.36751227",
23261
],
"last": 1546387200
}
}









share|improve this question




















  • 2





    This JSON is invalid: [ on the 4th line is closed by a }. Please edit your question so as to include valid JSON.

    – Nino Filiu
    Jan 3 at 13:41











  • Possible duplicate of For-each over an array in JavaScript?

    – Nicolás Carrasco
    Jan 3 at 13:49











  • Hi Samuel, your question is a specific application of how to get values from a JSON Array, so I would suggest that you look into more general questions here in SO that deal with JSON parsing and/or traversing. Here is a good place to start

    – Nicolás Carrasco
    Jan 3 at 13:51


















-3















I need help ! Can you tell me how can I get informations from this in javascript :
I would like to get the Third values from the fisrt array (121,73) and also the Fourth (99,25) . Thank you in advance !





{    
"error": ,
"result": {
"XETHZEUR": [
[
1545955200,
"100.76",
"121.73",
"99.25",
"120.16",
"111.15",
"186385.05723331",
25420
],
[
1546041600,
"120.52",
"130.00",
"115.91",
"117.89",
"121.47",
"154551.36751227",
23261
],
"last": 1546387200
}
}









share|improve this question




















  • 2





    This JSON is invalid: [ on the 4th line is closed by a }. Please edit your question so as to include valid JSON.

    – Nino Filiu
    Jan 3 at 13:41











  • Possible duplicate of For-each over an array in JavaScript?

    – Nicolás Carrasco
    Jan 3 at 13:49











  • Hi Samuel, your question is a specific application of how to get values from a JSON Array, so I would suggest that you look into more general questions here in SO that deal with JSON parsing and/or traversing. Here is a good place to start

    – Nicolás Carrasco
    Jan 3 at 13:51














-3












-3








-3








I need help ! Can you tell me how can I get informations from this in javascript :
I would like to get the Third values from the fisrt array (121,73) and also the Fourth (99,25) . Thank you in advance !





{    
"error": ,
"result": {
"XETHZEUR": [
[
1545955200,
"100.76",
"121.73",
"99.25",
"120.16",
"111.15",
"186385.05723331",
25420
],
[
1546041600,
"120.52",
"130.00",
"115.91",
"117.89",
"121.47",
"154551.36751227",
23261
],
"last": 1546387200
}
}









share|improve this question
















I need help ! Can you tell me how can I get informations from this in javascript :
I would like to get the Third values from the fisrt array (121,73) and also the Fourth (99,25) . Thank you in advance !





{    
"error": ,
"result": {
"XETHZEUR": [
[
1545955200,
"100.76",
"121.73",
"99.25",
"120.16",
"111.15",
"186385.05723331",
25420
],
[
1546041600,
"120.52",
"130.00",
"115.91",
"117.89",
"121.47",
"154551.36751227",
23261
],
"last": 1546387200
}
}






javascript api






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 13:55









Shubham Jain

678821




678821










asked Jan 3 at 13:35









Samuel Dana Samuel Dana

1




1








  • 2





    This JSON is invalid: [ on the 4th line is closed by a }. Please edit your question so as to include valid JSON.

    – Nino Filiu
    Jan 3 at 13:41











  • Possible duplicate of For-each over an array in JavaScript?

    – Nicolás Carrasco
    Jan 3 at 13:49











  • Hi Samuel, your question is a specific application of how to get values from a JSON Array, so I would suggest that you look into more general questions here in SO that deal with JSON parsing and/or traversing. Here is a good place to start

    – Nicolás Carrasco
    Jan 3 at 13:51














  • 2





    This JSON is invalid: [ on the 4th line is closed by a }. Please edit your question so as to include valid JSON.

    – Nino Filiu
    Jan 3 at 13:41











  • Possible duplicate of For-each over an array in JavaScript?

    – Nicolás Carrasco
    Jan 3 at 13:49











  • Hi Samuel, your question is a specific application of how to get values from a JSON Array, so I would suggest that you look into more general questions here in SO that deal with JSON parsing and/or traversing. Here is a good place to start

    – Nicolás Carrasco
    Jan 3 at 13:51








2




2





This JSON is invalid: [ on the 4th line is closed by a }. Please edit your question so as to include valid JSON.

– Nino Filiu
Jan 3 at 13:41





This JSON is invalid: [ on the 4th line is closed by a }. Please edit your question so as to include valid JSON.

– Nino Filiu
Jan 3 at 13:41













Possible duplicate of For-each over an array in JavaScript?

– Nicolás Carrasco
Jan 3 at 13:49





Possible duplicate of For-each over an array in JavaScript?

– Nicolás Carrasco
Jan 3 at 13:49













Hi Samuel, your question is a specific application of how to get values from a JSON Array, so I would suggest that you look into more general questions here in SO that deal with JSON parsing and/or traversing. Here is a good place to start

– Nicolás Carrasco
Jan 3 at 13:51





Hi Samuel, your question is a specific application of how to get values from a JSON Array, so I would suggest that you look into more general questions here in SO that deal with JSON parsing and/or traversing. Here is a good place to start

– Nicolás Carrasco
Jan 3 at 13:51












1 Answer
1






active

oldest

votes


















0














   var feild = {
"error": ,
"result": {
"XETHZEUR": [
[
1545955200,
"100.76",
"121.73",
"99.25",
"120.16",
"111.14",
"183581.25666187",
25053
],
[
1546041600,
"120.16",
"130.00",
"115.91",
"117.89",
"121.48",
"152980.08236398",
21309
],
[
1546128000,
"117.96",
"123.75",
"112.78",
"121.99",
"119.43",
"108719.51659796",
14936
],
[
1546214400,
"121.99",
"122.30",
"113.00",
"114.96",
"118.14",
"69796.43117029",
9347
],
[
1546300800,
"114.97",
"123.90",
"114.00",
"122.46",
"119.83",
"64248.31302812",
9713
],
[
1546387200,
"122.62",
"138.80",
"121.25",
"135.57",
"131.69",
"189734.68299147",
37935
],
[
1546473600,
"135.57",
"136.25",
"128.33",
"131.45",
"132.12",
"67066.92874540",
8790
]
],
"last": 1546387200
}
}
let empty= ;

feild.result.XETHZEUR.map(e=>{

empty.push(e[2])
empty.push(e[3])

})


empty.map(e=>{
if(e=="121.73"){
console.log(e)
}
if(e=="99.25"){
console.log(e)
}
})





share|improve this answer


























  • Of course it's working but this JSON is an API who change values all time so i can't do that : api.kraken.com/0/public/…

    – Samuel Dana
    Jan 3 at 14:01











  • you need to get all the third and forth values in a json data ??

    – vinoth s
    Jan 3 at 14:10













  • I have update the anwser you can check if there is a any issue please let me know !!!!!1

    – vinoth s
    Jan 3 at 14:57











  • Ok perfect thank you very much !!

    – Samuel Dana
    Jan 3 at 15:17











  • .....hmm yeah ok

    – vinoth s
    Jan 3 at 15:32












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54023358%2fhow-get-informations-in-javascript-from-api-json%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














   var feild = {
"error": ,
"result": {
"XETHZEUR": [
[
1545955200,
"100.76",
"121.73",
"99.25",
"120.16",
"111.14",
"183581.25666187",
25053
],
[
1546041600,
"120.16",
"130.00",
"115.91",
"117.89",
"121.48",
"152980.08236398",
21309
],
[
1546128000,
"117.96",
"123.75",
"112.78",
"121.99",
"119.43",
"108719.51659796",
14936
],
[
1546214400,
"121.99",
"122.30",
"113.00",
"114.96",
"118.14",
"69796.43117029",
9347
],
[
1546300800,
"114.97",
"123.90",
"114.00",
"122.46",
"119.83",
"64248.31302812",
9713
],
[
1546387200,
"122.62",
"138.80",
"121.25",
"135.57",
"131.69",
"189734.68299147",
37935
],
[
1546473600,
"135.57",
"136.25",
"128.33",
"131.45",
"132.12",
"67066.92874540",
8790
]
],
"last": 1546387200
}
}
let empty= ;

feild.result.XETHZEUR.map(e=>{

empty.push(e[2])
empty.push(e[3])

})


empty.map(e=>{
if(e=="121.73"){
console.log(e)
}
if(e=="99.25"){
console.log(e)
}
})





share|improve this answer


























  • Of course it's working but this JSON is an API who change values all time so i can't do that : api.kraken.com/0/public/…

    – Samuel Dana
    Jan 3 at 14:01











  • you need to get all the third and forth values in a json data ??

    – vinoth s
    Jan 3 at 14:10













  • I have update the anwser you can check if there is a any issue please let me know !!!!!1

    – vinoth s
    Jan 3 at 14:57











  • Ok perfect thank you very much !!

    – Samuel Dana
    Jan 3 at 15:17











  • .....hmm yeah ok

    – vinoth s
    Jan 3 at 15:32
















0














   var feild = {
"error": ,
"result": {
"XETHZEUR": [
[
1545955200,
"100.76",
"121.73",
"99.25",
"120.16",
"111.14",
"183581.25666187",
25053
],
[
1546041600,
"120.16",
"130.00",
"115.91",
"117.89",
"121.48",
"152980.08236398",
21309
],
[
1546128000,
"117.96",
"123.75",
"112.78",
"121.99",
"119.43",
"108719.51659796",
14936
],
[
1546214400,
"121.99",
"122.30",
"113.00",
"114.96",
"118.14",
"69796.43117029",
9347
],
[
1546300800,
"114.97",
"123.90",
"114.00",
"122.46",
"119.83",
"64248.31302812",
9713
],
[
1546387200,
"122.62",
"138.80",
"121.25",
"135.57",
"131.69",
"189734.68299147",
37935
],
[
1546473600,
"135.57",
"136.25",
"128.33",
"131.45",
"132.12",
"67066.92874540",
8790
]
],
"last": 1546387200
}
}
let empty= ;

feild.result.XETHZEUR.map(e=>{

empty.push(e[2])
empty.push(e[3])

})


empty.map(e=>{
if(e=="121.73"){
console.log(e)
}
if(e=="99.25"){
console.log(e)
}
})





share|improve this answer


























  • Of course it's working but this JSON is an API who change values all time so i can't do that : api.kraken.com/0/public/…

    – Samuel Dana
    Jan 3 at 14:01











  • you need to get all the third and forth values in a json data ??

    – vinoth s
    Jan 3 at 14:10













  • I have update the anwser you can check if there is a any issue please let me know !!!!!1

    – vinoth s
    Jan 3 at 14:57











  • Ok perfect thank you very much !!

    – Samuel Dana
    Jan 3 at 15:17











  • .....hmm yeah ok

    – vinoth s
    Jan 3 at 15:32














0












0








0







   var feild = {
"error": ,
"result": {
"XETHZEUR": [
[
1545955200,
"100.76",
"121.73",
"99.25",
"120.16",
"111.14",
"183581.25666187",
25053
],
[
1546041600,
"120.16",
"130.00",
"115.91",
"117.89",
"121.48",
"152980.08236398",
21309
],
[
1546128000,
"117.96",
"123.75",
"112.78",
"121.99",
"119.43",
"108719.51659796",
14936
],
[
1546214400,
"121.99",
"122.30",
"113.00",
"114.96",
"118.14",
"69796.43117029",
9347
],
[
1546300800,
"114.97",
"123.90",
"114.00",
"122.46",
"119.83",
"64248.31302812",
9713
],
[
1546387200,
"122.62",
"138.80",
"121.25",
"135.57",
"131.69",
"189734.68299147",
37935
],
[
1546473600,
"135.57",
"136.25",
"128.33",
"131.45",
"132.12",
"67066.92874540",
8790
]
],
"last": 1546387200
}
}
let empty= ;

feild.result.XETHZEUR.map(e=>{

empty.push(e[2])
empty.push(e[3])

})


empty.map(e=>{
if(e=="121.73"){
console.log(e)
}
if(e=="99.25"){
console.log(e)
}
})





share|improve this answer















   var feild = {
"error": ,
"result": {
"XETHZEUR": [
[
1545955200,
"100.76",
"121.73",
"99.25",
"120.16",
"111.14",
"183581.25666187",
25053
],
[
1546041600,
"120.16",
"130.00",
"115.91",
"117.89",
"121.48",
"152980.08236398",
21309
],
[
1546128000,
"117.96",
"123.75",
"112.78",
"121.99",
"119.43",
"108719.51659796",
14936
],
[
1546214400,
"121.99",
"122.30",
"113.00",
"114.96",
"118.14",
"69796.43117029",
9347
],
[
1546300800,
"114.97",
"123.90",
"114.00",
"122.46",
"119.83",
"64248.31302812",
9713
],
[
1546387200,
"122.62",
"138.80",
"121.25",
"135.57",
"131.69",
"189734.68299147",
37935
],
[
1546473600,
"135.57",
"136.25",
"128.33",
"131.45",
"132.12",
"67066.92874540",
8790
]
],
"last": 1546387200
}
}
let empty= ;

feild.result.XETHZEUR.map(e=>{

empty.push(e[2])
empty.push(e[3])

})


empty.map(e=>{
if(e=="121.73"){
console.log(e)
}
if(e=="99.25"){
console.log(e)
}
})






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 3 at 14:56

























answered Jan 3 at 13:56









vinoth svinoth s

795




795













  • Of course it's working but this JSON is an API who change values all time so i can't do that : api.kraken.com/0/public/…

    – Samuel Dana
    Jan 3 at 14:01











  • you need to get all the third and forth values in a json data ??

    – vinoth s
    Jan 3 at 14:10













  • I have update the anwser you can check if there is a any issue please let me know !!!!!1

    – vinoth s
    Jan 3 at 14:57











  • Ok perfect thank you very much !!

    – Samuel Dana
    Jan 3 at 15:17











  • .....hmm yeah ok

    – vinoth s
    Jan 3 at 15:32



















  • Of course it's working but this JSON is an API who change values all time so i can't do that : api.kraken.com/0/public/…

    – Samuel Dana
    Jan 3 at 14:01











  • you need to get all the third and forth values in a json data ??

    – vinoth s
    Jan 3 at 14:10













  • I have update the anwser you can check if there is a any issue please let me know !!!!!1

    – vinoth s
    Jan 3 at 14:57











  • Ok perfect thank you very much !!

    – Samuel Dana
    Jan 3 at 15:17











  • .....hmm yeah ok

    – vinoth s
    Jan 3 at 15:32

















Of course it's working but this JSON is an API who change values all time so i can't do that : api.kraken.com/0/public/…

– Samuel Dana
Jan 3 at 14:01





Of course it's working but this JSON is an API who change values all time so i can't do that : api.kraken.com/0/public/…

– Samuel Dana
Jan 3 at 14:01













you need to get all the third and forth values in a json data ??

– vinoth s
Jan 3 at 14:10







you need to get all the third and forth values in a json data ??

– vinoth s
Jan 3 at 14:10















I have update the anwser you can check if there is a any issue please let me know !!!!!1

– vinoth s
Jan 3 at 14:57





I have update the anwser you can check if there is a any issue please let me know !!!!!1

– vinoth s
Jan 3 at 14:57













Ok perfect thank you very much !!

– Samuel Dana
Jan 3 at 15:17





Ok perfect thank you very much !!

– Samuel Dana
Jan 3 at 15:17













.....hmm yeah ok

– vinoth s
Jan 3 at 15:32





.....hmm yeah ok

– vinoth s
Jan 3 at 15:32




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54023358%2fhow-get-informations-in-javascript-from-api-json%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

Npm cannot find a required file even through it is in the searched directory