import jsonpath

s = {
"code": 0,
"msg": "success!",
"data": [

{
"id": 154,

},

{
"id": 1,
}

]

取第一个id

data1 = jsonpath.jsonpath(s, '$.data[0].id')
print(data1)