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;
}
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
add a comment |
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
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
add a comment |
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
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
javascript api
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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)
}
})
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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)
}
})
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
add a comment |
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)
}
})
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
add a comment |
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)
}
})
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)
}
})
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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