Question: I am trying to interact with the coinbase api and keep getting "TypeError: Object of type method is not JSON serializable" when trying to print out this json data, I know the get request is correct as it returns a 200 when I remove the json.dumps().

```
    import requests
    import json

    response = requests.get('https://api.coinbase.com/v2/prices/BTC-USD/buy')
    data = json.dumps(response.json)
    print(data)

```

Answer: 
Your return is:

```json
{'data': {'base': 'BTC', 'currency': 'USD', 'amount': '40880.98'}}

```

It has a JSON syntax error

Try this

```
response = requests.get('https://api.coinbase.com/v2/prices/BTC-USD/buy')
data = response.json()
dataJson = json.dumps(data['data'])
print(dataJson)

```
Try this:

```py
response = requests.get('https://api.coinbase.com/v2/prices/BTC-USD/buy')
data = json.loads(response.text)
print(data)  # {'data': {'base': 'BTC', 'currency': 'USD', 'amount': '40935.10'}}

```