I'm struggling with kind of a trivial issue. I call an API endpoint and receive the following response as an object:
{
'data': [{
'id': 18136910,
'league_id': 501,
'season_id': 18369,
'stage_id': 77453684,
'round_id': 247435,
'group_id': None,
'aggregate_id': None,
'venue_id': 219,
}
{ ....
- Approach: Turn object into dict and grab data
print(response.json().data)
# Prints AttributeError: 'dict' object has no attribute 'data'
- Approach to enter the object
print(response.data) or print(response.data[0])
# Prints AttributeError: 'Response' object has no attribute 'data'
So how to assign e.g. 'id' to a variable x?