issue with trying to get airq quality us-epa-index data

"air_quality": {
"co": 217.0,
"no2": 3.5999999046325684,
"o3": 74.4000015258789,
"so2": 2.0999999046325684,
"pm2_5": 2.9000000953674316,
"pm10": 3.5999999046325684,
"us-epa-index": 1,
"gb-defra-index": 1
}
"air_quality": {
"co": 217.0,
"no2": 3.5999999046325684,
"o3": 74.4000015258789,
"so2": 2.0999999046325684,
"pm2_5": 2.9000000953674316,
"pm10": 3.5999999046325684,
"us-epa-index": 1,
"gb-defra-index": 1
}
I am able to get all the data except the air quality, only one i am trying to grab from it is the us-epa-index. Here is how I did the rest currDayNight: current.is_day, currWeather: current.condition.text, currWeatherIcon: current.condition.icon, currTempF: current.temp_f, currTempFeelsLike: current.feelslike_f, currWindSpeed: current.wind_mph, currWindGust: current.gust_mph, currWindDirection: current.wind_dir, currHumidity: current.humidity, currVisibility: current.vis_miles, currAirQuality: current.air_quality.us - epa - index, Are the - causing issues when trying to get the data?r
2 Replies
Joao
Joao3y ago
Yes, you should use square bracket notation to get to that data: current.air_quality['us-epa-index']
Errtu
ErrtuOP3y ago
@joao6246 Thank you worked perfectly.
Want results from more Discord servers?
Add your server