Pro tip: If you’re getting `TypeError`, print the type of your variable first (`print(type(response))`). Might still be a string!
For nested JSON, I write tiny helper functions to drill down. Like:
```python
def get_nested(data, *keys):
for key in keys:
data = data.get(key, {})
return data
```
Makes life easier. Also, `pydantic` is great for validating JSON if you’re into that.
For nested JSON, I write tiny helper functions to drill down. Like:
```python
def get_nested(data, *keys):
for key in keys:
data = data.get(key, {})
return data
```
Makes life easier. Also, `pydantic` is great for validating JSON if you’re into that.
