G
G
g1tufix2020-09-09 21:12:05
Python
g1tufix, 2020-09-09 21:12:05

How to sort JSON in Python?

Hello!
There is a page api.site.com, it contains JSON

JSON
[{
"id": "223866924113592320",
"game": "GAME1",
"date": 1599674833,
"duration": 146,
"players": 2
},
{
"id": "223866923908071424",
"game": "GAME2",
},
"date": 1599674833,
"duration": 270,
"players": 16
}]
И так далее

How to get all ID strings?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-09-09
@SoreMix

import json
data = json.loads(json_str)

And then exactly the same as with the dictionary. json_str - your JSON from the response itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question