Im trying to load JSON data from an API using the Python json.loads command but Im getting an error message "No JSON Object Could be Decoded".
This is the JSON API data that Im trying to load: https://financialmodelingprep.com/api/financials/income-statement/AAPL
The API call is successful and when I do a "print (response.content)" it prints correctly. However, when I place the response.content into a variable using the json.loads it gives the error message.
In the code below the first Print works well. The second Print gives the error message.
here is my code:
import json
import requests
response = requests.get("https://financialmodelingprep.com/api/financials/income-statement/AAPL")
print (response.content)
data = json.loads(response.content)
print (data)