-1

Hi I'm working on node js and I wanted to get some values.

So I tried using data.list['dt'], but was unsuccessful.

Actually I want to show: dt, day, humidity, description .

Please help me to show this. Thanks in advance!

"list": [
{
  "dt": 1487242800,
  "temp": {
    "day": 286.67,
    "min": 272.78,
    "max": 286.67,
    "night": 273.34,
    "eve": 277.05,
    "morn": 281.56
  },
  "pressure": 972.73,
  "humidity": 75,
  "weather": [
    {
      "id": 800,
      "main": "Clear",
      "description": "sky is clear",
      "icon": "01d"
    }
  ],
  "speed": 1.81,
  "deg": 248,
  "clouds": 0
}
]
Parrish Husband
  • 3,148
  • 18
  • 40
Prabu
  • 47
  • 1
  • 11

2 Answers2

1

Value for key List in your data json is an array so first you need to access element in list by index and then keys dt, day, humidity, description etc. like follows:

data.list[0]['dt']
Ashish
  • 623
  • 4
  • 10
1

To show dt, day, humidity, and description values.

Like @hurricane said:

data.list[0]['dt'];
data.list[0]['temp']['day'];
data.list[0]['humidity'];
data.list[0]['weather']['description'];
Zaren Wienclaw
  • 181
  • 4
  • 15