1 def getJsonValue(variableCode, data): 2 for ts in data['value']['timeSeries']: 3 if ts['variable']['valueType'] == variableCode: 4 value = ts['values'][0]['value'][0]['value'] 5 return value